Re: [Qemu-devel] [PATCH v3 02/11] fdc: refactor pick_geometry

2015-12-16 Thread Markus Armbruster
John Snow writes: > Modify this function to operate directly on FDrive objects instead of > unpacking and passing all of those parameters manually. > > Helps reduce complexity in each caller, and reduces the number of args. For now, there's just one. Diffstat suggests it's an overall simplifica

Re: [Qemu-devel] [PATCH] rtc: introduce nmi disable bit handler for cmos

2015-12-16 Thread Gonglei (Arei)
Hello Paolo, > > > On 16/12/2015 11:28, Gonglei (Arei) wrote: > > I'll move the global nmi_disabled into RTCState, then I have to add a global > RTCState > > Variable so that other C files can use the rtc_state->external_nmi_disabled. > > Hmm, I think it should be done differently. This is a l

[Qemu-devel] [PATCH v2] coverity: Model g_poll()

2015-12-16 Thread Markus Armbruster
In my testing, Coverity reported two more CHECKED_RETURN: * qemu-char.c:1248: fixed in commit c1f2448: "qemu-char: retry g_poll on EINTR". * migration/qemu-file-unix.c:75: harmless, cleaned up in commit 4e39f57 "migration: Clean up use of g_poll() in socket_writev_buffer() Signed-off-by: M

Re: [Qemu-devel] [PATCH v2 4/4] spapr: Introduce FWNMI KVM capability

2015-12-16 Thread Thomas Huth
On 16/12/15 07:08, Aravinda Prasad wrote: > Introduce a new KVM capability to control how KVM > behaves on machine check exception. > > Without this capability, KVM redirects machine check > exceptions to guest's 0x200 vector if the address in > error belongs to guest. With this capability KVM > c

Re: [Qemu-devel] [PATCH 06/12] hw/arm/virt: Fix property "gic-version" error handling

2015-12-16 Thread Markus Armbruster
Peter Maydell writes: > On 10 December 2015 at 10:29, Markus Armbruster wrote: >> virt_set_gic_version() calls exit(1) when passed an invalid property >> value. Property setters are not supposed to do that. Screwed up in >> commit b92ad39. Harmless, because the property belongs to a machine.

Re: [Qemu-devel] [Patch v12 resend 00/10] Block replication for continuous checkpoints

2015-12-16 Thread Wen Congyang
Stefan:Ping... What about this feature? I have worked for it about 1 year, but it is still in the way... On 12/02/2015 01:31 PM, Wen Congyang wrote: > Block replication is a very important feature which is used for > continuous checkpoints(for example: COLO). > > You can get the detailed inform

Re: [Qemu-devel] [TCG only][Migration Bug? ] Occasionally, the content of VM's memory is inconsistent between Source and Destination of migration

2015-12-16 Thread Amit Shah
On (Fri) 04 Dec 2015 [01:43:07], Li, Liang Z wrote: > > > > Thanks for describing how to reproduce the bug. > > If some pages are not transferred to destination then it is a bug, so we > > need > > to know what the problem is, notice that the problem can be that TCG is not > > marking dirty some

[Qemu-devel] [PATCH 1/2] block: Remove prototype of bdrv_swap from header

2015-12-16 Thread Fam Zheng
The function has gone. Signed-off-by: Fam Zheng --- include/block/block.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/block/block.h b/include/block/block.h index 3477328..028f2fb 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -197,7 +197,6 @@ int bdrv_create_fil

[Qemu-devel] [PATCH 2/2] iotests: Don't mention bdrv_swap in comments

2015-12-16 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/qemu-iotests/094 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/qemu-iotests/094 b/tests/qemu-iotests/094 index 27a2be2..d30c78d 100755 --- a/tests/qemu-iotests/094 +++ b/tests/qemu-iotests/094 @@ -1,6 +1,6 @@ #!/bin/bash # -# Tes

[Qemu-devel] [PATCH 0/2] Clean up the remainders of bdrv_swap

2015-12-16 Thread Fam Zheng
Fam Zheng (2): block: Remove prototype of bdrv_swap from header iotests: Don't mention bdrv_swap in comments include/block/block.h | 1 - tests/qemu-iotests/094 | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) -- 2.4.3

Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 3/4] target-ppc: Handle NMI guest exit

2015-12-16 Thread Aravinda Prasad
On Thursday 17 December 2015 09:30 AM, David Gibson wrote: > On Wed, Dec 16, 2015 at 11:38:37AM +0530, Aravinda Prasad wrote: >> Memory error such as bit flips that cannot be corrected >> by hardware are passed on to the kernel for handling. >> If the memory address in error belongs to guest then

Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 2/4] spapr: Handle "ibm, nmi-register" and "ibm, nmi-interlock" RTAS calls

2015-12-16 Thread Aravinda Prasad
On Thursday 17 December 2015 09:21 AM, David Gibson wrote: > On Wed, Dec 16, 2015 at 11:38:22AM +0530, Aravinda Prasad wrote: >> This patch adds support in QEMU to handle "ibm,nmi-register" >> and "ibm,nmi-interlock" RTAS calls. >> >> The machine check notification address is saved when the >> OS

Re: [Qemu-devel] [PATCH v2 4/4] spapr: Introduce FWNMI KVM capability

2015-12-16 Thread Aravinda Prasad
On Thursday 17 December 2015 09:32 AM, David Gibson wrote: > On Wed, Dec 16, 2015 at 11:38:47AM +0530, Aravinda Prasad wrote: >> Introduce a new KVM capability to control how KVM >> behaves on machine check exception. >> >> Without this capability, KVM redirects machine check >> exceptions to gue

Re: [Qemu-devel] [PATCH v2 3/4] target-ppc: Handle NMI guest exit

2015-12-16 Thread David Gibson
On Wed, Dec 16, 2015 at 11:38:37AM +0530, Aravinda Prasad wrote: > Memory error such as bit flips that cannot be corrected > by hardware are passed on to the kernel for handling. > If the memory address in error belongs to guest then > guest kernel is responsible for taking suitable action. > Patch

Re: [Qemu-devel] [PATCH v2 4/4] spapr: Introduce FWNMI KVM capability

2015-12-16 Thread David Gibson
On Wed, Dec 16, 2015 at 11:38:47AM +0530, Aravinda Prasad wrote: > Introduce a new KVM capability to control how KVM > behaves on machine check exception. > > Without this capability, KVM redirects machine check > exceptions to guest's 0x200 vector if the address in > error belongs to guest. With

Re: [Qemu-devel] [PATCH v2 1/4] spapr: Register and handle HCALL to receive updated RTAS region

2015-12-16 Thread David Gibson
On Wed, Dec 16, 2015 at 11:38:13AM +0530, Aravinda Prasad wrote: > Receive updates from SLOF about the updated rtas-base. > A separate patch for SLOF [1] adds functionality to invoke > a private HCALL whenever OS issues instantiate-rtas with > a new rtas-base. > > This is required as QEMU needs to

Re: [Qemu-devel] [PATCH v2 2/4] spapr: Handle "ibm, nmi-register" and "ibm, nmi-interlock" RTAS calls

2015-12-16 Thread David Gibson
On Wed, Dec 16, 2015 at 11:38:22AM +0530, Aravinda Prasad wrote: > This patch adds support in QEMU to handle "ibm,nmi-register" > and "ibm,nmi-interlock" RTAS calls. > > The machine check notification address is saved when the > OS issues "ibm,nmi-register" RTAS call. > > This patch also handles

Re: [Qemu-devel] [PATCH untested] mirror: start drained section earlier

2015-12-16 Thread Fam Zheng
On Wed, 12/16 19:33, Paolo Bonzini wrote: > Ensure that the guest does not write anything to disk after cnt is > read for the final time. > > Signed-off-by: Paolo Bonzini > --- > Untested. > > block/mirror.c | 22 +++--- > 1 file changed, 11 insertions(+), 11 deletions(-

Re: [Qemu-devel] [PATCH v2 for-2.6] hw/ppc/spapr: Use XHCI as host controller for new spapr machines

2015-12-16 Thread David Gibson
On Wed, Dec 09, 2015 at 01:34:13PM +0100, Thomas Huth wrote: > The OHCI has some bugs and performance issues, so for > newer machines it's preferable to use XHCI instead. > > Signed-off-by: Thomas Huth Sorry, I somehow missed this one for a while. I've now merged into ppc-for-2.6. -- David Gi

Re: [Qemu-devel] [PATCH] block: use drained section around bdrv_snapshot_delete

2015-12-16 Thread Fam Zheng
On Wed, 12/16 19:33, Paolo Bonzini wrote: > Do not use bdrv_drain, since by itself it does not guarantee > anything. > > Signed-off-by: Paolo Bonzini > --- > block/snapshot.c | 23 ++- > 1 file changed, 14 insertions(+), 9 deletions(-) > > diff --git a/block/snapshot.c b/blo

Re: [Qemu-devel] [PATCH] change type of pci_bridge_initfn() to void

2015-12-16 Thread Cao jin
Ping On 11/30/2015 05:19 PM, Michael S. Tsirkin wrote: On Mon, Nov 30, 2015 at 05:00:44PM +0800, Cao jin wrote: It always return 0(success), change its type to void, and modify its caller. Doing this can reduce a error path of its caller, and it is also good when convert init() to realize() Si

[Qemu-devel] [PATCH v14 Resend 11/13] pcie_aer: expose pcie_aer_msg() interface

2015-12-16 Thread Cao jin
From: Chen Fan For vfio device, we need to propagate the aer error to Guest OS. we use the pcie_aer_msg() to send aer error to guest. Signed-off-by: Chen Fan Reviewed-by: Michael S. Tsirkin --- hw/pci/pcie_aer.c | 2 +- include/hw/pci/pcie_aer.h | 1 + 2 files changed, 2 insertions(+)

[Qemu-devel] [PATCH v14 Resend 13/13] vfio: add 'aer' property to expose aercap

2015-12-16 Thread Cao jin
From: Chen Fan add 'aer' property to let user able to decide whether expose the aer capability. by default we should disable aer feature, because it needs configuration restrictions. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/vfio/pci.c b

[Qemu-devel] [PATCH v14 Resend 10/13] pci: add pci device pre-post reset callbacks for host bus reset

2015-12-16 Thread Cao jin
From: Chen Fan Particularly, For vfio devices, Once need to recovery devices by bus reset such as AER, we always need to reset the host bus to recovery the devices under the bus, so we need to add pci device callbacks to specify to do host bus reset. Signed-off-by: Chen Fan Reviewed-by: Michael

[Qemu-devel] [PATCH v14 Resend 08/13] vfio: add check host bus reset is support or not

2015-12-16 Thread Cao jin
From: Chen Fan when init vfio devices done, we should test all the devices supported aer whether conflict with others. For each one, get the hot reset info for the affected device list. For each affected device, all should attach to the VM and on/below the same bus. also, we should test all of t

[Qemu-devel] [PATCH v14 Resend 00/13] vfio-pci: pass the aer error to guest

2015-12-16 Thread Cao jin
From: Chen Fan For now, for vfio pci passthough devices when qemu receives an error from host aer report, currentlly just terminate the guest, but usually user want to know what error occurred but stopping the guest, so this patches add aer capability support for vfio device, and pass the error t

[Qemu-devel] [PATCH v14 Resend 06/13] aer: impove pcie_aer_init to support vfio device

2015-12-16 Thread Cao jin
From: Chen Fan pcie_aer_init was used to emulate an aer capability for pcie device, but for vfio device, the aer config space size is mutable and is not always equal to PCI_ERR_SIZEOF(0x48). it depends on where the TLP Prefix register required, so here we add a size argument. Signed-off-by: Chen

[Qemu-devel] [PATCH v14 Resend 07/13] vfio: add aer support for vfio device

2015-12-16 Thread Cao jin
From: Chen Fan Calling pcie_aer_init to initilize aer related registers for vfio device, then reload physical related registers to expose device capability. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 81 --- hw/vfio/pci.h | 3 +++ 2 fil

[Qemu-devel] [PATCH v14 Resend 03/13] pcie: modify the capability size assert

2015-12-16 Thread Cao jin
From: Chen Fan Device's Offset and size can reach PCIE_CONFIG_SPACE_SIZE, fix the corresponding assert. Signed-off-by: Chen Fan Reviewed-by: Marcel Apfelbaum Reviewed-by: Michael S. Tsirkin --- hw/pci/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci/pcie.c

[Qemu-devel] [PATCH v14 Resend 09/13] add check reset mechanism when hotplug vfio device

2015-12-16 Thread Cao jin
From: Chen Fan Since we support multi-function hotplug. the function 0 indicate the closure of the slot, so we have the chance to do the check. Signed-off-by: Chen Fan --- hw/pci/pci.c | 29 + hw/vfio/pci.c| 19 +++ hw/vfio/pc

[Qemu-devel] [PATCH v14 Resend 04/13] vfio: make the 4 bytes aligned for capability size

2015-12-16 Thread Cao jin
From: Chen Fan this function search the capability from the end, the last size should 0x100 - pos, not 0xff - pos. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index f333dfc..e305cda 100644 --- a/h

[Qemu-devel] [PATCH v14 Resend 02/13] vfio: squeeze out vfio_pci_do_hot_reset for support bus reset

2015-12-16 Thread Cao jin
From: Chen Fan squeeze out vfio_pci_do_hot_reset to do host bus reset when AER recovery. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 75 +++ 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c ind

[Qemu-devel] [PATCH v14 Resend 05/13] vfio: add pcie extanded capability support

2015-12-16 Thread Cao jin
From: Chen Fan For vfio pcie device, we could expose the extended capability on PCIE bus. in order to avoid config space broken, we introduce a copy config for parsing extended caps. and rebuild the pcie extended config space. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 70

[Qemu-devel] [PATCH v14 Resend 12/13] vfio-pci: pass the aer error to guest

2015-12-16 Thread Cao jin
From: Chen Fan when the vfio device encounters an uncorrectable error in host, the vfio_pci driver will signal the eventfd registered by this vfio device, the results in the qemu eventfd handler getting invoked. this patch is to pass the error to guest and have the guest driver recover from the

[Qemu-devel] [PATCH v14 Resend 01/13] vfio: extract vfio_get_hot_reset_info as a single function

2015-12-16 Thread Cao jin
From: Chen Fan the function is used to get affected devices by bus reset. so here extract it, and can used for aer soon. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 66 +++ 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/h

Re: [Qemu-devel] [PATCH 00/10] hw/sd: QOMify sd.c (and pxa2xx_mmci)

2015-12-16 Thread Alistair Francis
+Sai Pavan On Fri, Dec 11, 2015 at 8:37 AM, Peter Maydell wrote: > This series attempts to QOMify sd.c (the actual SD card model), > including a proper QOM bus between the controller and the card. > > This series removes the experimental x-drive property on sdhci-pci; > the syntax for using that

Re: [Qemu-devel] [PATCH] scsi: use scsi_req_cancel_async when purging requests

2015-12-16 Thread Fam Zheng
On Wed, 12/16 19:33, Paolo Bonzini wrote: > This avoids calls to aio_poll without having acquired the context first. > > Signed-off-by: Paolo Bonzini > --- > hw/scsi/scsi-bus.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c

Re: [Qemu-devel] [PATCH] rcu: optimize rcu_read_lock

2015-12-16 Thread Wen Congyang
On 12/16/2015 07:32 PM, Paolo Bonzini wrote: > rcu_read_lock cannot change rcu_gp_ongoing from true to false > (the previous value of p_rcu_reader->ctr is zero), hence > there is no need to check p_rcu_reader->waiting and wake up > a concurrent synchronize_rcu. > > While at it mark the wakeup as u

Re: [Qemu-devel] [PATCH] scsi: always call notifier on async cancellation

2015-12-16 Thread Fam Zheng
On Wed, 12/16 19:33, Paolo Bonzini wrote: > This was found by code inspection. If the request is cancelled twice, > the notifier is never called on the second cancellation request, > and hence for example a TMF might never finish. > > Signed-off-by: Paolo Bonzini > --- > hw/scsi/scsi-bus.c | 3

Re: [Qemu-devel] [PATCH] block: fix bdrv_ioctl called from coroutine

2015-12-16 Thread Fam Zheng
On Wed, 12/16 19:33, Paolo Bonzini wrote: > When called from a coroutine, bdrv_ioctl must be asynchronous just like > e.g. bdrv_flush. The code was incorrectly making it synchronous, fix > it. > > Signed-off-by: Paolo Bonzini > --- > Fam, any reason why you did it this way? I don't see

Re: [Qemu-devel] [PATCH v5 4/6] qdev: Add a function to rename busses

2015-12-16 Thread Alistair Francis
On Wed, Dec 16, 2015 at 2:36 PM, Peter Crosthwaite wrote: > On Wed, Dec 16, 2015 at 1:45 PM, Alistair Francis > wrote: >> Add a function which can be used to rename busses. >> >> Signed-off-by: Alistair Francis >> --- >> >> hw/core/qdev.c | 5 + >> include/hw/qdev-core.h | 2 ++ >>

[Qemu-devel] Jobs 2.0 QAPI [RFC]

2015-12-16 Thread John Snow
In working through a prototype to enable multiple block jobs. A few problem spots in our API compatibility become apparent. In a nutshell, old Blockjobs rely on the "device" to identify the job, which implies: 1) A job is always attached to a device / the root node of a device 2) There can only b

Re: [Qemu-devel] [PATCH v5 5/6] xlnx-zynqmp: Connect the SPI devices

2015-12-16 Thread Alistair Francis
On Wed, Dec 16, 2015 at 3:24 PM, Paolo Bonzini wrote: > > > On 16/12/2015 22:45, Alistair Francis wrote: >> + >> +/* Rename each SPI bus after the SPI device to allow the board >> + * to access all of the busses from the SoC. >> + */ >> +spi_bus = qdev_get_child_bus

[Qemu-devel] [ANNOUNCE] QEMU 2.5.0 is now available

2015-12-16 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the QEMU 2.5.0 release. This release contains 2000+ commits from 185 authors. You can grab the tarball from our download page here: http://wiki.qemu.org/Download As with the 2.4.0 release, the QEMU team has put togeth

Re: [Qemu-devel] [PATCH v5 5/6] xlnx-zynqmp: Connect the SPI devices

2015-12-16 Thread Paolo Bonzini
On 16/12/2015 22:45, Alistair Francis wrote: > + > +/* Rename each SPI bus after the SPI device to allow the board > + * to access all of the busses from the SoC. > + */ > +spi_bus = qdev_get_child_bus(DEVICE(&s->spi[i]), "spi0"); > +snprintf(bus_name, 6, "

Re: [Qemu-devel] [PATCH v3 04/11] fdc: add default drive type option

2015-12-16 Thread Eric Blake
On 12/16/2015 03:16 PM, John Snow wrote: > This patch adds a new explicit Floppy Drive Type option. The existing > behavior in QEMU is to automatically guess a drive type based on the > media inserted, or if a diskette is not present, arbitrarily assign one. > > This behavior can be described as "

Re: [Qemu-devel] [RFC PATCH v0 0/9] Generic cpu-core device

2015-12-16 Thread Igor Mammedov
On Wed, 16 Dec 2015 18:22:20 +0100 Igor Mammedov wrote: > On Wed, 16 Dec 2015 16:57:54 +0100 > Andreas Färber wrote: [...] > > > > Attendees in Seattle said that thread-level hot-plug were dangerous > > for Linux guests due to assumptions in the (guest's) scheduler > > breaking for any incomple

Re: [Qemu-devel] [PATCH v5 4/6] qdev: Add a function to rename busses

2015-12-16 Thread Peter Crosthwaite
On Wed, Dec 16, 2015 at 1:45 PM, Alistair Francis wrote: > Add a function which can be used to rename busses. > > Signed-off-by: Alistair Francis > --- > > hw/core/qdev.c | 5 + > include/hw/qdev-core.h | 2 ++ > 2 files changed, 7 insertions(+) > > diff --git a/hw/core/qdev.c b/hw/c

Re: [Qemu-devel] [PATCH v3 11/11] fdc: change auto fallback drive for ISA FDC to 288

2015-12-16 Thread John Snow
On 12/16/2015 05:16 PM, John Snow wrote: > The 2.88 drive is more suitable as a default because > it can still read 1.44 images correctly, but the reverse > is not true. > > Since there exist virtio-win drivers that are shipped on > 2.88 floppy images, this patch will allow VMs booted without >

Re: [Qemu-devel] [RFC PATCH v0 2/9] cpu: Store CPU typename in MachineState

2015-12-16 Thread Igor Mammedov
On Wed, 16 Dec 2015 17:39:02 -0200 Eduardo Habkost wrote: > On Wed, Dec 16, 2015 at 05:54:25PM +0100, Igor Mammedov wrote: > > On Tue, 15 Dec 2015 14:08:09 +0530 > > Bharata B Rao wrote: > > > > > On Mon, Dec 14, 2015 at 03:29:49PM -0200, Eduardo Habkost wrote: > > > > On Thu, Dec 10, 2015 at 1

[Qemu-devel] [PATCH v3 09/11] fdc: rework pick_geometry

2015-12-16 Thread John Snow
This one is the crazy one. fd_revalidate currently uses pick_geometry to tell if the diskette geometry has changed upon an eject/insert event, but it won't allow us to insert a 1.44MB diskette into a 2.88MB drive. This is inflexible. The new algorithm applies a new heuristic to guessing disk geom

[Qemu-devel] [PATCH v3 08/11] fdc: add physical disk sizes

2015-12-16 Thread John Snow
2.88MB capable drives can accept 1.44MB floppies, for instance. To rework the pick_geometry function, we need to know if our current drive can even accept the type of disks we're considering. NB: This allows us to distinguish between all of the "total sectors" collisions between 1.20MB and 1.44MB

[Qemu-devel] [PATCH v3 10/11] qtest/fdc: Support for 2.88MB drives

2015-12-16 Thread John Snow
The old test assumes a 1.44MB drive. Assert that the QEMU default drive is now either 1.44 or 2.88. Signed-off-by: John Snow --- tests/fdc-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fdc-test.c b/tests/fdc-test.c index b5a4696..526d459 100644 --- a/tests/fdc-

[Qemu-devel] [PATCH v3 05/11] fdc: Add fallback option

2015-12-16 Thread John Snow
Add the fallback drive type as an option so we can control the behavior as a function of the QEMU machine version. Signed-off-by: John Snow --- hw/block/fdc.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index ad0e052..b587de8 10064

[Qemu-devel] [PATCH v3 04/11] fdc: add default drive type option

2015-12-16 Thread John Snow
This patch adds a new explicit Floppy Drive Type option. The existing behavior in QEMU is to automatically guess a drive type based on the media inserted, or if a diskette is not present, arbitrarily assign one. This behavior can be described as "auto." This patch adds explicit behaviors: 120, 144

[Qemu-devel] [PATCH v3 00/11] fdc: fix 2.88mb floppy diskette support

2015-12-16 Thread John Snow
requires: 1448895398-13465-1-git-send-email-ehabk...@redhat.com pc: Add pc-*-2.6 machine classes Yes, it's been broken for ten years. No, it's not a CVE. The problem is that QEMU doesn't have a configuration option for the type of floppy drive you want. It determines that based on the t

[Qemu-devel] [PATCH v3 06/11] fdc: do not call revalidate on eject

2015-12-16 Thread John Snow
Currently, fd_revalidate is called in two different places, with two different expectations of behavior: (1) On initialization, as a routine to help pick the drive type and initial geometries as a side-effect of the pick_geometry routine (2) On insert/eject, which either sets the geometries t

[Qemu-devel] [PATCH v3 07/11] fdc: implement new drive type property

2015-12-16 Thread John Snow
Respect the drive type as given via the CLI. Set the type given by the CLI during fd_init. If the type remains the default (auto), we'll attempt to scan an inserted diskette if present to determine a type. If auto is selected but no diskette is present, we fall back to a predetermined default (cur

[Qemu-devel] [PATCH v3 01/11] fdc: move pick_geometry

2015-12-16 Thread John Snow
Code motion: I want to refactor this function to work with FDrive directly, so shuffle it below that definition. Signed-off-by: John Snow --- hw/block/fdc.c | 90 +- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/hw/block/f

[Qemu-devel] [PATCH v3 11/11] fdc: change auto fallback drive for ISA FDC to 288

2015-12-16 Thread John Snow
The 2.88 drive is more suitable as a default because it can still read 1.44 images correctly, but the reverse is not true. Since there exist virtio-win drivers that are shipped on 2.88 floppy images, this patch will allow VMs booted without a floppy disk inserted to later insert a 2.88MB floppy an

[Qemu-devel] [PATCH v3 02/11] fdc: refactor pick_geometry

2015-12-16 Thread John Snow
Modify this function to operate directly on FDrive objects instead of unpacking and passing all of those parameters manually. Helps reduce complexity in each caller, and reduces the number of args. Signed-off-by: John Snow --- hw/block/fdc.c | 54 +++-

[Qemu-devel] [PATCH v3 03/11] fdc: add disk field

2015-12-16 Thread John Snow
This allows us to distinguish between the current disk type and the current drive type. The drive is what's reported to CMOS, the disk is whatever the pick_geometry function suspects has been inserted. The drive field maintains the exact same meaning as it did previously, however pick_geometry/fd_

Re: [Qemu-devel] [PATCH v2 1/1] i386: expose floppy-related objects in SSDT

2015-12-16 Thread Igor Mammedov
On Wed, 16 Dec 2015 20:34:55 +0300 Roman Kagan wrote: > On Wed, Dec 16, 2015 at 05:46:57PM +0100, Igor Mammedov wrote: > > On Wed, 16 Dec 2015 10:45:09 +0300 "Denis V. Lunev" > > wrote: > > > @@ -1125,6 +1183,26 @@ build_ssdt(GArray *table_data, GArray > > > *linker, aml_append(ssdt, scope); > >

Re: [Qemu-devel] [RFC PATCH v0 0/9] Generic cpu-core device

2015-12-16 Thread Igor Mammedov
On Wed, 16 Dec 2015 16:46:37 +0100 Andreas Färber wrote: > Am 10.12.2015 um 13:35 schrieb Igor Mammedov: > > wrt CLI can't we do something like this? > > > > -device some-cpu-model,socket=x[,core=y[,thread=z]] > > That's problematic and where my x86 remodeling got stuck. It works > fine (more o

[Qemu-devel] [PATCH v5 6/6] xlnx-ep108: Connect the SPI Flash

2015-12-16 Thread Alistair Francis
Connect the sst25wf080 SPI flash to the EP108 board. Signed-off-by: Alistair Francis --- V4: - Only add one SPI flash V3: - Don't reach into the SoC V2: - Use sst25wf080 instead of m25p80 hw/arm/xlnx-ep108.c | 16 1 file changed, 16 insertions(+) diff --git a/hw/arm/xlnx-ep

[Qemu-devel] [PATCH v5 5/6] xlnx-zynqmp: Connect the SPI devices

2015-12-16 Thread Alistair Francis
Connect the Xilinx SPI devices to the ZynqMP model. Signed-off-by: Alistair Francis --- V5: - Use the bus renaming function V4: - Rename the SPI busses so that they can all be accessed from the SoC - Don't set the num-busses property V3: - Expose the SPI Bus as part of the SoC device V2: - D

[Qemu-devel] [PATCH v5 2/6] ssi: Move ssi.h into a separate directory

2015-12-16 Thread Alistair Francis
Move the ssi.h include file into the ssi directory. While touching the code also fix the typdef lines as checkpatch complains. Signed-off-by: Alistair Francis Reviewed-by: Peter Crosthwaite --- V2: - Change git patch to indicate rename hw/arm/pxa2xx.c | 2 +- hw/arm/spit

[Qemu-devel] [PATCH v5 4/6] qdev: Add a function to rename busses

2015-12-16 Thread Alistair Francis
Add a function which can be used to rename busses. Signed-off-by: Alistair Francis --- hw/core/qdev.c | 5 + include/hw/qdev-core.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index b3ad467..29a3e9d 100644 --- a/hw/core/qdev.c +++ b/hw/core

[Qemu-devel] [PATCH v5 0/6] Connect the SPI devices to ZynqMP

2015-12-16 Thread Alistair Francis
Connect the SPI devices to Xilinx's ZynqMP. I also need to make some changes to the actual SPI device to imporove the fuctionality, but for the time being this works. V5: - Fix a typo - Use a qdev API to rename the SPI bus V4: - Rebase - Rename the SPI busses so that they can all be accessed

[Qemu-devel] [PATCH v5 3/6] xilinx_spips: Separate the state struct into a header

2015-12-16 Thread Alistair Francis
Separate out the XilinxSPIPS struct into a separate header file. Signed-off-by: Alistair Francis --- V5: - Fix typos V4: - Don't split off R_MOD_ID and hardcode R_MAX V2: - Only split out required #defines - Prefix XLNX_SPIPS_ hw/ssi/xilinx_spips.c | 46 +++

[Qemu-devel] [PATCH v5 1/6] m25p80.c: Add sst25wf080 SPI flash device

2015-12-16 Thread Alistair Francis
Add the sst25wf080 SPI flash device. Signed-off-by: Alistair Francis Reviewed-by: Peter Crosthwaite --- hw/block/m25p80.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index efc43dd..7b9f97c 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -

Re: [Qemu-devel] [PATCH 0/5] target-i386: kvm: Increase MSR entry array limits, check for array overrun

2015-12-16 Thread Paolo Bonzini
On 16/12/2015 20:06, Eduardo Habkost wrote: > We are dangerously close to the array limits in kvm_put_msrs() > and kvm_get_msrs(): with the default mcg_cap configuration, we > can set up to 148 MSRs in kvm_put_msrs(), and if we allow mcg_cap > to be changed, we can write up to 236 MSRs[1]. > > T

[Qemu-devel] [PATCH 0/3] sdhci patches to enable Raspberry Pi

2015-12-16 Thread Andrew Baumann
This is a series of three tweaks needed to enable the generic sdhci controller to emulate Raspberry Pi (bcm2835/2836), and boot Linux and Windows. There was some discussion of these changes in the following thread: https://lists.gnu.org/archive/html/qemu-devel/2015-12/msg01401.html Cheers, Andrew

[Qemu-devel] [PATCH 1/3] sd: sdhci: Delete over-zealous power check

2015-12-16 Thread Andrew Baumann
This check was conditionalising SD card operation on the card being powered by the SDHCI host controller. It is however possible (particularly in embedded systems) for the power control of the SD card to be managed outside of SDHCI. This can be as trivial as hard-wiring the SD slot VCC to a constan

[Qemu-devel] [PATCH 2/3] sdhci: don't raise a command index error for an unexpected response

2015-12-16 Thread Andrew Baumann
This deletes a block of code that raised a command index error if a command returned response data, but the guest did not set the appropriate bits in the response register to handle such a response. I cannot find any documentation that suggests the controller should behave in this way, the error co

[Qemu-devel] [PATCH 3/3] sdhci: add optional quirk property to disable card insertion/removal interrupts

2015-12-16 Thread Andrew Baumann
This is needed for a quirk of the Raspberry Pi (bcm2835/6) MMC controller, where the card insert bit is documented as unimplemented (always reads zero, doesn't generate interrupts) but is in fact observed on hardware as set at power on, but is cleared (and remains clear) on subsequent controller re

Re: [Qemu-devel] [PATCH for-2.6 v2 01/10] fdc: move pick_geometry

2015-12-16 Thread John Snow
On 12/15/2015 04:51 PM, Hervé Poussineau wrote: > Le 08/12/2015 00:34, John Snow a écrit : >> Code motion: I want to refactor this function to work with FDrive >> directly, so shuffle it below that definition. >> >> Signed-off-by: John Snow >> --- >> hw/block/fdc.c | 90 >>

Re: [Qemu-devel] [PATCH] target-*: Get rid of "PC advancement" trick

2015-12-16 Thread Sergey Fedorov
On 12/16/15 20:03, Richard Henderson wrote: On 12/15/2015 01:02 PM, Sergey Fedorov wrote: For that, I think it might be interesting to arrange for non-empty TBs to exit prior to recognizing a breakpoint. So that a breakpoint TB is always just the one operation. Except for the fact that "gener

[Qemu-devel] [Bug 1307225] Re: Running a virtual machine on a Haswell system produces machine check events

2015-12-16 Thread cvbkf
Minor Update: Bug occurs under Intel Skylake, too. System-information: Intel Core i7-6700 with 4x8 GB Samsung M378A1G43DB0-CPB DDR4-2133 RAM, Motherboard: Fujitsu D3401-H1 Dec 15 06:53:30 srv01 kernel: [224214.850599] mce: [Hardware Error]: Machine check events logged Dec 15 06:55:08 srv01 kern

Re: [Qemu-devel] [PATCH 1/3] sd: sdhci: Delete over-zealous power check

2015-12-16 Thread Andrew Baumann
> From: Peter Crosthwaite [mailto:crosthwaitepe...@gmail.com] > Sent: Wednesday, 16 December 2015 12:00 > On Wed, Dec 16, 2015 at 11:47 AM, Andrew Baumann > wrote: > > This is exactly equivalent to Peter's patch here: > > https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg06271.html

Re: [Qemu-devel] [PATCH v4 4/5] xlnx-zynqmp: Connect the SPI devices

2015-12-16 Thread Alistair Francis
On Tue, Dec 15, 2015 at 10:46 AM, Peter Maydell wrote: > On 23 November 2015 at 08:54, Alistair Francis > wrote: >> Connect the Xilinx SPI devices to the ZynqMP model. >> >> Signed-off-by: Alistair Francis > >> +/* Rename each SPI bus after the SPI device to allow the board >> +

[Qemu-devel] [PATCH 8/9] scsi-generic: Factor out response interception

2015-12-16 Thread Alex Pyrgiotis
The interception of read/write responses is currently done in the main code that handles the read write response. Move the interception logic in a function of its own, so that it can be reused from the scatter-gather path. Also, instead of altering the response buffer directly, use the scsi_get_bu

[Qemu-devel] [PATCH 4/9] scsi-generic: Add common functions

2015-12-16 Thread Alex Pyrgiotis
In the `scsi_generic_req_ops' struct, instead of pointing to the implementations of read_data/write_data/send_command, point to wrappers around these functions, prefixed with "common_". Also, introduce the concept of "buffer" operations. Buffer operations are the read/write operations that rely on

Re: [Qemu-devel] [PATCH 1/3] sd: sdhci: Delete over-zealous power check

2015-12-16 Thread Peter Crosthwaite
On Wed, Dec 16, 2015 at 11:47 AM, Andrew Baumann wrote: > This check was conditionalising SD card operation on the card being > powered by the SDHCI host controller. It is however possible > (particularly in embedded systems) for the power control of the SD card > to be managed outside of SDHCI. T

[Qemu-devel] [PATCH v2 2/3] hw/sd: model a power-up delay, as a workaround for an EDK2 bug

2015-12-16 Thread Andrew Baumann
The SD spec for ACMD41 says that a zero argument is an "inquiry" ACMD41, which does not start initialisation and is used only for retrieving the OCR. However, Tianocore EDK2 (UEFI) has a bug [1]: it first sends an inquiry (zero) ACMD41. If that first request returns an OCR value with the power up b

[Qemu-devel] [PATCH v2 1/3] hw/sd: implement CMD23 (SET_BLOCK_COUNT) for MMC compatibility

2015-12-16 Thread Andrew Baumann
CMD23 is optional for SD but required for MMC, and the UEFI bootloader used for Windows on Raspberry Pi 2 issues it. Signed-off-by: Andrew Baumann --- hw/sd/sd.c | 37 + 1 file changed, 37 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 1a9935c..1a24

[Qemu-devel] [PATCH 9/9] scsi-generic: Allow full scatter-gather support

2015-12-16 Thread Alex Pyrgiotis
If the scsi controller uses scatter-gather lists, do not copy them to an intermediate buffer. Instead, use them as is via the dma_blk_ioctl() function. In order to make this feature possible, the following changes have been made to the code: * All I/O functions have been branched into two types o

[Qemu-devel] [PATCH v2 0/3] SD emulation fixes for Pi2 Tianocore EDK2 UEFI

2015-12-16 Thread Andrew Baumann
This series contains fixes to the SD card emulation that are needed to unblock Tianocore EDK2 UEFI (specifically, the bootloader for Windows on Raspberry Pi 2). Changes in v2, based on feedback from Peter Crosthwaite: * correct implementation of CMD23 to switch to transfer state on completion *

[Qemu-devel] [PATCH 7/9] scsi-generic: Make data-copying logic clearer

2015-12-16 Thread Alex Pyrgiotis
The copying of data to/from the intermediate buffer of the device is done by scsi_req_data(). Internally, scsi_req_data() also restarts the request with scsi_req_continue(). Therefore, we need a guard variable to know when the contents of the intermediate buffer are in sync with the data of the gue

[Qemu-devel] Block I/O Tracing

2015-12-16 Thread Luis Pabón
Hi all, I am really interested in the following feature: http://wiki.qemu.org/Features/Block/Todo#Trace_guest_block_I.2FO.2C_replay_with_qemu-io . Is there any more information about this feature? Thanks, - Luis

[Qemu-devel] [PATCH 2/9] dma-helpers: Add support for ioctl operations

2015-12-16 Thread Alex Pyrgiotis
Allow ioctl operations to benefit from the DMA functionality created for the read/write operations. More specifically, create a function called "dma_blk_ioctl" that uses the existing code for mapping scatter-gather lists to qiovs and ultimately calls the blk_aio_ioctl() function to perform the actu

[Qemu-devel] [PATCH 6/9] scsi-generic: Make request execution buf-specific

2015-12-16 Thread Alex Pyrgiotis
Move the request execution logic from execute_command() to scsi_buf_do_request(), since the way the io header is initialized and the ioctl is performed is used only for requests that use an intermediate buffer. For now, the above is the only request type, but we need to pave the way for the suppor

[Qemu-devel] [PATCH 1/9] dma-helpers: Expose the sg mapping logic

2015-12-16 Thread Alex Pyrgiotis
The mapping of scatter-gather lists from physical addresses (as perceived by the guest kernel) to the virtual address space of the QEMU process is a vital step for a DMA operation. This step is currently implemented, amongst other things, in dma_blk_cb(), making it impossible to be used by anyone e

[Qemu-devel] [PATCH] os-posix: Log to logfile in case of daemonize

2015-12-16 Thread Alex Pyrgiotis
From: Dimitris Aragiorgis In case of daemonize, use the logfile passed with the -D option in order to redirect stdout/stderr to a file instead of /dev/null. Signed-off-by: Dimitris Aragiorgis Signed-off-by: Alex Pyrgiotis diff --git a/include/qemu/log.h b/include/qemu/log.h index 362cbc4..b5d

[Qemu-devel] [PATCH 3/9] dma-helpers: Do not truncate small qiovs

2015-12-16 Thread Alex Pyrgiotis
If the size of the qiov is smaller than the sector size, do not truncate the qiov, which would effectively make it empty. Instead, allow it to pass as is. This is necessary for SCSI requests like READ CAPACITY which have small buffers, e.g. 32 bytes. Signed-off-by: Alex Pyrgiotis Signed-off-by:

[Qemu-devel] [PATCH v2 3/3] hw/sd: use guest error logging rather than fprintf to stderr

2015-12-16 Thread Andrew Baumann
Some of these errors may be harmless (e.g. probing unimplemented commands, or issuing CMD12 in the wrong state), and may also be quite frequent. Spamming the standard error output isn't desirable in such cases. Signed-off-by: Andrew Baumann --- It might also be desirable to have a squelch mechani

[Qemu-devel] [PATCH 0/9] Add full scatter-gather support for SCSI generic devices

2015-12-16 Thread Alex Pyrgiotis
Hi all, This patch is an attempt to boost the performance of "scsi-generic" and "scsi-block" device types, by removing an extra data copy and reducing their memory footprint. More specifically, the problem lies in the functions in the `scsi-generic_req_ops` struct of scsi-generic.c. These function

[Qemu-devel] [PATCH 5/9] scsi-generic: Separate `sg_io_hdr' initializations

2015-12-16 Thread Alex Pyrgiotis
Separate the initialization of the `sg_io_hdr' struct in two parts: one part that fills the struct with sane defaults, and another part that prepares it for an SG_IO request with DIRECT IO and a single buffer. The first part can also be reused later on by the code that uses scatter-gather lists. S

Re: [Qemu-devel] [PATCH v2 11/14] pc: Remove PcGuestInfo.isapc_ram_fw field

2015-12-16 Thread Eduardo Habkost
On Tue, Dec 15, 2015 at 04:27:51PM +0200, Marcel Apfelbaum wrote: > On 12/11/2015 08:42 PM, Eduardo Habkost wrote: [...] > >@@ -131,8 +130,7 @@ static void pc_q35_init(MachineState *machine) > > rom_memory = get_system_memory(); > > } > > > >-guest_info = pc_guest_info_init(pcms);

Re: [Qemu-devel] [PATCH v4 3/5] xilinx_spips: Seperate the state struct into a header

2015-12-16 Thread Alistair Francis
On Tue, Dec 15, 2015 at 10:48 AM, Peter Maydell wrote: > On 23 November 2015 at 08:54, Alistair Francis > wrote: >> Seperate out the XilinxSPIPS struct into a seperate header >> file. > > If you need to respin this series it would be nice to fix > the typos here and in the subject: it is "separat

  1   2   3   >