Re: [Qemu-devel] [Qemu-block] [PATCH] block: clarify error message for qmp-eject

2016-05-17 Thread Fam Zheng
On Wed, 05/18 07:36, Markus Armbruster wrote: > Fam Zheng writes: > > > On Tue, 05/17 20:42, John Snow wrote: > >> If you use HMP's eject but the CDROM tray is locked, you may get a > >> confusing error message informing you that the "tray isn't open." > >> > >> As this is the point of eject, we

[Qemu-devel] [PATCH] backup: Fail early if cannot determine cluster size

2016-05-17 Thread Fam Zheng
Otherwise the job is orphaned and block_job_cancel_sync in bdrv_close_all() when quiting will hang. A simple reproducer is running blockdev-backup from null-co:// to null-co://. Cc: qemu-sta...@nongnu.org Signed-off-by: Fam Zheng --- block/backup.c | 34 ++ 1 fil

[Qemu-devel] [PATCH 0/2] block/nfs: add support for libnfs pagecache

2016-05-17 Thread Peter Lieven
this adds support for the upcoming libnfs cachepage to Qemu. While at it neglect to use readahead if cache.direct is on. Peter Lieven (2): block/nfs: add support for libnfs pagecache block/nfs: refuse readahead if cache.direct is on block/nfs.c | 45 +-

Re: [Qemu-devel] [Qemu-block] [PATCH] block: clarify error message for qmp-eject

2016-05-17 Thread Markus Armbruster
Fam Zheng writes: > On Tue, 05/17 20:42, John Snow wrote: >> If you use HMP's eject but the CDROM tray is locked, you may get a >> confusing error message informing you that the "tray isn't open." >> >> As this is the point of eject, we can do a little better and help >> clarify that the tray wa

[Qemu-devel] [PATCH 1/2] block/nfs: add support for libnfs pagecache

2016-05-17 Thread Peter Lieven
upcoming libnfs will have support for a read cache that can significantly help to speed up requests since libnfs by design circumvents the kernel cache. Example: qemu -cdrom nfs://127.0.0.1/iso/my.iso?pagecache=1024 The pagecache parameters takes the maximum amount of pages to cache. A page in

[Qemu-devel] [PATCH] block/iscsi: allow caching of the allocation map

2016-05-17 Thread Peter Lieven
until now the allocation map was used only as a hint if a cluster is allocated or not. If a block was not allocated (or Qemu had no info about the allocation status) a get_block_status call was issued to check the allocation status and possibly avoid a subsequent read of unallocated sectors. If a b

[Qemu-devel] [PATCH 2/2] block/nfs: refuse readahead if cache.direct is on

2016-05-17 Thread Peter Lieven
Signed-off-by: Peter Lieven --- block/nfs.c | 5 + 1 file changed, 5 insertions(+) diff --git a/block/nfs.c b/block/nfs.c index 975510f..8b73a35 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -331,6 +331,11 @@ static int64_t nfs_client_open(NFSClient *client, const char *filename,

Re: [Qemu-devel] [PATCH] block/rbd: add .bdrv_reopen_prepare() stub

2016-05-17 Thread Jeff Cody
On Tue, May 17, 2016 at 12:03:53PM +0200, Sebastian Färber wrote: > Hi Kevin, > > > A correct reopen implementation must consider all options and flags that > > .bdrv_open() looked at. > > > > The options are okay, as both "filename" and "password-secret" aren't > > things that we want to allow a

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

2016-05-17 Thread Zhou Jie
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, resulting in the qemu eventfd handler getting invoked. this patch is to pass the error to guest and let the guest driver recover from the err

[Qemu-devel] [PATCH 09/12] vfio: vote the function 0 to do host bus reset when aer occurred

2016-05-17 Thread Zhou Jie
From: Chen Fan Due to all devices assigned to VM on the same way as host if enable aer, so we can easily do the hot reset by selecting the function #0 to do the hot reset. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 14 ++ hw/vfio/pci.h | 1 + 2 files changed, 15 insertions(+) di

[Qemu-devel] [PATCH 04/12] vfio: add aer support for vfio device

2016-05-17 Thread Zhou Jie
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 | 83 +-- hw/vfio/pci.h | 3 +++ 2 fil

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

2016-05-17 Thread Zhou Jie
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 05/12] vfio: refine function vfio_pci_host_match

2016-05-17 Thread Zhou Jie
From: Chen Fan Signed-off-by: Chen Fan --- hw/vfio/pci.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 0516d94..5b23a86 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -2060,14 +2060,27 @@ static void vfio_pci_po

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

2016-05-17 Thread Zhou Jie
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 03/12] vfio: add pcie extended capability support

2016-05-17 Thread Zhou Jie
From: Chen Fan For vfio pcie device, we could expose the extended capability on PCIE bus. due to add a new pcie capability at the tail of the chain, in order to avoid config space overwritten, we introduce a copy config for parsing extended caps. and rebuild the pcie extended config space. Signe

[Qemu-devel] [PATCH 06/12] vfio: add check host bus reset is support or not

2016-05-17 Thread Zhou Jie
From: Chen Fan When assigning a vfio device with AER enabled, we must check whether the device supports a host bus reset (ie. hot reset) as this may be used by the guest OS in order to recover the device from an AER error. QEMU must therefore have the ability to perform a physical host bus reset

[Qemu-devel] [PATCH 11/12] vfio: register aer resume notification handler for aer resume

2016-05-17 Thread Zhou Jie
From: Chen Fan For supporting aer recovery, host and guest would run the same aer recovery code, that would do the secondary bus reset if the error is fatal, the aer recovery process: 1. error_detected 2. reset_link (if fatal) 3. slot_reset/mmio_enabled 4. resume It indicates that host w

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

2016-05-17 Thread Zhou Jie
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

[Qemu-devel] [PATCH 08/12] vfio: add check aer functionality for hotplug device

2016-05-17 Thread Zhou Jie
From: Chen Fan when function 0 is hot-added, we can check the vfio device whether support hot bus reset. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 832f25e..109b11b 100644 --- a/hw/vfio/pci.c

[Qemu-devel] [PATCH v7 00/12] vfio-pci: pass the aer error to guest

2016-05-17 Thread Zhou Jie
From: Chen Fan v6-v7: 1. Stall any access to the device until resume is signaled. Do guest directed bus reset after receive resume notification. If don't get the resume notification after some timeout unplug the device. 2. fix the patches 11/12 as Alex sugguestion. v5-v6: 1.

[Qemu-devel] [PATCH 07/12] pci: add a pci_function_is_valid callback to check function if valid

2016-05-17 Thread Zhou Jie
From: Chen Fan PCI hotplug requires that function 0 is added last to close the slot. Since vfio supporting AER, we require that the VM bus contains the same set of devices as the host bus to support AER, we can perform an AER validation test whenever a function 0 in the VM is hot-added. Signed-

Re: [Qemu-devel] [PATCH v3 2/5] net: handle optional VLAN header in checksum computation.

2016-05-17 Thread Jason Wang
On 2016年05月09日 03:41, Jean-Christophe Dubois wrote: Signed-off-by: Jean-Christophe Dubois --- Changes since v1: * Not present on v1 Changes since v2: * Not present on v2 net/checksum.c | 35 +++ 1 file changed, 31 insertions(+), 4 deletions(-) diff

Re: [Qemu-devel] [PATCH v3 0/5] Add Ethernet device for i.MX6 SOC

2016-05-17 Thread Jason Wang
On 2016年05月17日 21:00, Peter Maydell wrote: On 8 May 2016 at 20:40, Jean-Christophe Dubois wrote: This patch series adds Gb ENET Ethernet device to the i.MX6 SOC. The ENET device is an evolution of the FEC device present on the i.MX25 SOC and is backward compatible with it. Therefore the ENE

Re: [Qemu-devel] [PATCH V4] net/net: Add SocketReadState for reuse codes

2016-05-17 Thread Jason Wang
On 2016年05月13日 15:35, Zhang Chen wrote: This function is from net/socket.c, move it to net.c and net.h. Add SocketReadState to make others reuse net_fill_rstate(). suggestion from jason. v4: - move 'rs->finalize = finalize' to rs_init() v3: - remove SocketReadState init callback - put f

Re: [Qemu-devel] [PATCH] net: vl: Move default_net to vl.c

2016-05-17 Thread Jason Wang
On 2016年05月16日 23:21, Paolo Bonzini wrote: On 12/05/2016 16:17, Eduardo Habkost wrote: All handling of defaults (default_* variables) is inside vl.c, move default_net there too, so we can more easily refactor that code later. Signed-off-by: Eduardo Habkost --- include/net/net.h | 1 - n

Re: [Qemu-devel] [PATCH v5 00/16] Introduce Intel 82574 GbE Controller Emulation (e1000e)

2016-05-17 Thread Jason Wang
On 2016年05月15日 21:49, Leonid Bloch wrote: Hello All, This is v5 of e1000e series. For convenience, the same patches are available at: https://github.com/daynix/qemu-e1000e/tree/e1000e-submit-v5 Best regards, Dmitry. Applied to -net. There's still some work need to be done on top: - add e

Re: [Qemu-devel] [PATCH] block: clarify error message for qmp-eject

2016-05-17 Thread Eric Blake
On 05/17/2016 06:42 PM, John Snow wrote: > If you use HMP's eject but the CDROM tray is locked, you may get a > confusing error message informing you that the "tray isn't open." > > As this is the point of eject, we can do a little better and help > clarify that the tray was locked and that it (mi

Re: [Qemu-devel] [PATCH 0/2] convert device initialization functions

2016-05-17 Thread Wei, Jiangang
received hint that Message to <*@redhat.com> was undeliverable. ping to confirm my message had been sent successfully. On Tue, 2016-05-17 at 18:18 +0800, Wei Jiangang wrote: > The first had been reviewed. > The second had been posted last month, but no feedback. > They're similar, so resend them t

Re: [Qemu-devel] [Qemu-block] [PATCH] block: clarify error message for qmp-eject

2016-05-17 Thread Eric Blake
On 05/17/2016 08:18 PM, Fam Zheng wrote: > On Tue, 05/17 20:42, John Snow wrote: >> If you use HMP's eject but the CDROM tray is locked, you may get a >> confusing error message informing you that the "tray isn't open." >> >> As this is the point of eject, we can do a little better and help >> clar

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-17 Thread Richard Henderson
On 05/17/2016 10:13 AM, Sergey Fedorov wrote: >> > +static inline void qemu_spin_lock(QemuSpin *spin) >> > +{ >> > +while (atomic_test_and_set_acquire(&spin->value)) { >>From gcc-4.8 info page, node "__atomic Builtins", description of > __atomic_test_and_set(): > > It should be only used f

Re: [Qemu-devel] [PATCH] block: clarify error message for qmp-eject

2016-05-17 Thread Fam Zheng
On Tue, 05/17 20:42, John Snow wrote: > If you use HMP's eject but the CDROM tray is locked, you may get a > confusing error message informing you that the "tray isn't open." > > As this is the point of eject, we can do a little better and help > clarify that the tray was locked and that it (might

Re: [Qemu-devel] [PATCH v6 8/8] vfio/pci: Add IGD documentation

2016-05-17 Thread Eric Blake
On 05/17/2016 02:20 PM, Alex Williamson wrote: > Document the usage modes, host primary graphics considerations, usage, > and fw_cfg ABI required for IGD assignment with vfio. > > Signed-off-by: Alex Williamson > --- > docs/igd-assign.txt | 133 > +++

Re: [Qemu-devel] [PATCH v5 08/18] exec: add tb_hash_func5, derived from xxhash

2016-05-17 Thread Emilio G. Cota
On Tue, May 17, 2016 at 20:22:52 +0300, Sergey Fedorov wrote: > On 14/05/16 06:34, Emilio G. Cota wrote: (snip) > > +static inline > > +uint32_t tb_hash_func5(uint64_t a0, uint64_t b0, uint32_t e) > > +{ > > +uint32_t v1 = TB_HASH_XX_SEED + PRIME32_1 + PRIME32_2; > > +uint32_t v2 = TB_HASH_

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-17 Thread Emilio G. Cota
On Tue, May 17, 2016 at 12:19:27 -0700, Richard Henderson wrote: > On 05/17/2016 10:13 AM, Sergey Fedorov wrote: > >> > +static inline void qemu_spin_lock(QemuSpin *spin) > >> > +{ > >> > +while (atomic_test_and_set_acquire(&spin->value)) { > >>From gcc-4.8 info page, node "__atomic Builtins",

Re: [Qemu-devel] [PATCH 2/3] qcow2: Fix write_zeroes with partially allocated backing file cluster

2016-05-17 Thread Denis V. Lunev
On 05/17/2016 07:51 PM, Kevin Wolf wrote: In order to correctly check whether a given cluster is read as zero, we don't only need to check whether bdrv_get_block_status_above() sets BDRV_BLOCK_ZERO, but also if all sectors for the whole cluster have the same status. Signed-off-by: Kevin Wolf --

[Qemu-devel] [PATCH v6 3/8] vfio/pci: Fix return of vfio_populate_vga()

2016-05-17 Thread Alex Williamson
This function returns success if either we setup the VGA region or the host vfio doesn't return enough regions to support the VGA index. This latter case doesn't make any sense. If we're asked to populate VGA, fail if it doesn't exist and let the caller decide if that's important. Signed-off-by:

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-17 Thread Sergey Fedorov
On 17/05/16 23:04, Emilio G. Cota wrote: > On Tue, May 17, 2016 at 12:19:27 -0700, Richard Henderson wrote: >> On 05/17/2016 10:13 AM, Sergey Fedorov wrote: > +static inline void qemu_spin_lock(QemuSpin *spin) > +{ > +while (atomic_test_and_set_acquire(&spin->value)) { >>> >From gcc

[Qemu-devel] [PATCH v6 2/8] vfio: Create device specific region info helper

2016-05-17 Thread Alex Williamson
Given a device specific region type and sub-type, find it. Also cleanup return point on error in vfio_get_region_info() so that we always return 0 with a valid pointer or -errno and NULL. Signed-off-by: Alex Williamson --- hw/vfio/common.c | 36 +++

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-17 Thread Emilio G. Cota
On Tue, May 17, 2016 at 20:13:24 +0300, Sergey Fedorov wrote: > On 14/05/16 06:34, Emilio G. Cota wrote: (snip) > > +static inline void qemu_spin_lock(QemuSpin *spin) > > +{ > > +while (atomic_test_and_set_acquire(&spin->value)) { > > From gcc-4.8 info page, node "__atomic Builtins", descripti

Re: [Qemu-devel] [PATCH v5 09/18] tb hash: hash phys_pc, pc, and flags with xxhash

2016-05-17 Thread Emilio G. Cota
On Tue, May 17, 2016 at 20:47:52 +0300, Sergey Fedorov wrote: > On 14/05/16 06:34, Emilio G. Cota wrote: > > For some workloads such as arm bootup, tb_phys_hash is performance-critical. > > The is due to the high frequency of accesses to the hash table, originated > > by (frequent) TLB flushes that

[Qemu-devel] [PATCH v6 5/8] vfio/pci: Setup BAR quirks after capabilities probing

2016-05-17 Thread Alex Williamson
Capability probing modifies wmask, which quirks may be interested in changing themselves. Apply our BAR quirks after the capability scan to make this possible. Signed-off-by: Alex Williamson --- hw/vfio/pci.c |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/vfio

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-17 Thread Sergey Fedorov
On 17/05/16 22:19, Richard Henderson wrote: > On 05/17/2016 10:13 AM, Sergey Fedorov wrote: +static inline void qemu_spin_lock(QemuSpin *spin) +{ +while (atomic_test_and_set_acquire(&spin->value)) { >> >From gcc-4.8 info page, node "__atomic Builtins", description of >> __atomic_

[Qemu-devel] [PATCH v6 7/8] vfio/pci: Add a separate option for IGD OpRegion support

2016-05-17 Thread Alex Williamson
The IGD OpRegion is enabled automatically when running in legacy mode, but it can sometimes be useful in universal passthrough mode as well. Without an OpRegion, output spigots don't work, and even though Intel doesn't officially support physical outputs in UPT mode, it's a useful feature. Note th

[Qemu-devel] vfio IGD assignment (was Re: [PATCH v6 0/8] Series short description)

2016-05-17 Thread Alex Williamson
On Tue, 17 May 2016 14:19:19 -0600 Alex Williamson wrote: > The following series implements... Gag, I blame a bum vpn connection and botch vim recovery ;) Here's what I meant to list: This is the first non-RFC posting, so if you wish to review and provide comments, now is the time to do so. W

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-17 Thread Sergey Fedorov
On 17/05/16 22:57, Sergey Fedorov wrote: > On 17/05/16 22:19, Richard Henderson wrote: >> On 05/17/2016 10:13 AM, Sergey Fedorov wrote: > +static inline void qemu_spin_lock(QemuSpin *spin) > +{ > +while (atomic_test_and_set_acquire(&spin->value)) { >>> >From gcc-4.8 info page, node

[Qemu-devel] [PATCH v6 0/8] Series short description

2016-05-17 Thread Alex Williamson
The following series implements... --- Alex Williamson (8): vfio: Enable sparse mmap capability vfio: Create device specific region info helper vfio/pci: Fix return of vfio_populate_vga() vfio/pci: Consolidate VGA setup vfio/pci: Setup BAR quirks after capabilities p

[Qemu-devel] [PATCH v6 8/8] vfio/pci: Add IGD documentation

2016-05-17 Thread Alex Williamson
Document the usage modes, host primary graphics considerations, usage, and fw_cfg ABI required for IGD assignment with vfio. Signed-off-by: Alex Williamson --- docs/igd-assign.txt | 133 +++ 1 file changed, 133 insertions(+) create mode 100644 do

[Qemu-devel] [PATCH] monitor: Typo fix

2016-05-17 Thread Eric Blake
s/partinal/partial/ Signed-off-by: Eric Blake --- monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index 4393151..2f56488 100644 --- a/monitor.c +++ b/monitor.c @@ -312,7 +312,7 @@ static void monitor_flush_locked(Monitor *mon) retu

[Qemu-devel] [PATCH v6 1/8] vfio: Enable sparse mmap capability

2016-05-17 Thread Alex Williamson
The sparse mmap capability in a vfio region info allows vfio to tell us which sub-areas of a region may be mmap'd. Thus rather than assuming a single mmap covers the entire region and later frobbing it ourselves for things like the PCI MSI-X vector table, we can read that directly from vfio. Sign

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-17 Thread Sergey Fedorov
On 17/05/16 22:38, Emilio G. Cota wrote: > On Tue, May 17, 2016 at 20:13:24 +0300, Sergey Fedorov wrote: >> On 14/05/16 06:34, Emilio G. Cota wrote: (snip) >>> +while (atomic_read(&spin->value)) { >>> +cpu_relax(); >>> +} >>> +} >> Looks like relaxed atomic access ca

[Qemu-devel] [PATCH v6 6/8] vfio/pci: Intel graphics legacy mode assignment

2016-05-17 Thread Alex Williamson
Enable quirks to support SandyBridge and newer IGD devices as primary VM graphics. This requires new vfio-pci device specific regions added in kernel v4.6 to expose the IGD OpRegion, the shadow ROM, and config space access to the PCI host bridge and LPC/ISA bridge. VM firmware support, SeaBIOS on

[Qemu-devel] [PATCH v6 4/8] vfio/pci: Consolidate VGA setup

2016-05-17 Thread Alex Williamson
Combine VGA discovery and registration. Quirks can have dependencies on BARs, so the quirks push out until after we've scanned the BARs. Signed-off-by: Alex Williamson --- hw/vfio/pci.c | 49 ++--- 1 file changed, 26 insertions(+), 23 deletions(-)

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-17 Thread Emilio G. Cota
On Tue, May 17, 2016 at 23:35:57 +0300, Sergey Fedorov wrote: > On 17/05/16 22:38, Emilio G. Cota wrote: > > On Tue, May 17, 2016 at 20:13:24 +0300, Sergey Fedorov wrote: > >> On 14/05/16 06:34, Emilio G. Cota wrote: > (snip) > >>> +while (atomic_read(&spin->value)) { > >>> +cpu

Re: [Qemu-devel] [PATCH 3/3] qemu-iotests: Some more write_zeroes tests

2016-05-17 Thread Eric Blake
On 05/17/2016 10:51 AM, Kevin Wolf wrote: > This covers some more write_zeroes cases which are relevant for the > recent qcow2 optimisations that check the allocation status of the > backing file for partial cluster write_zeroes requests. > > Signed-off-by: Kevin Wolf > --- > +# qcow2 specific b

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-17 Thread Richard Henderson
On 05/17/2016 01:01 PM, Sergey Fedorov wrote: >> Sorry, I can't see reading ARMv6 ARM that 1-byte access can't be atomic. What >> I've found: >> >> B2.4.1 Normal memory attribute >> (snip) >> Shared Normal memory >> >> (snip) >> ... Reads to Shared Normal Memory that are

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-17 Thread Richard Henderson
On 05/17/2016 03:12 PM, Richard Henderson wrote: > On 05/17/2016 01:01 PM, Sergey Fedorov wrote: >>> Sorry, I can't see reading ARMv6 ARM that 1-byte access can't be atomic. >>> What >>> I've found: >>> >>> B2.4.1 Normal memory attribute >>> (snip) >>> Shared Normal memory >>> >>>

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-17 Thread Emilio G. Cota
On Tue, May 17, 2016 at 23:20:11 +0300, Sergey Fedorov wrote: > On 17/05/16 23:04, Emilio G. Cota wrote: (snip) > > +/* > > + * We might we tempted to use __atomic_test_and_set with __ATOMIC_ACQUIRE; > > + * however, the documentation explicitly says that we should only pass > > + * a boolean to it

[Qemu-devel] [PATCH v5] fw/pci: Add support for mapping Intel IGD via QEMU

2016-05-17 Thread Alex Williamson
QEMU provides two fw_cfg files to support IGD. The first holds the OpRegion data which holds the Video BIOS Table (VBT). This needs to be copied into reserved memory and the address stored in the ASL Storage register of the device at 0xFC offset in PCI config space. The OpRegion is generally 8KB.

Re: [Qemu-devel] [PATCH] block: Propagate AioContext change to all children

2016-05-17 Thread Stefan Hajnoczi
On Tue, May 17, 2016 at 01:38:04PM +0200, Max Reitz wrote: > Instead of propagating any change of a BDS's AioContext only to its file > and backing children and letting driver-specific code do the rest, just > propagate it to all and drop the thus superfluous implementations of > bdrv_{at,de}tach_a

[Qemu-devel] [PATCH] block: clarify error message for qmp-eject

2016-05-17 Thread John Snow
If you use HMP's eject but the CDROM tray is locked, you may get a confusing error message informing you that the "tray isn't open." As this is the point of eject, we can do a little better and help clarify that the tray was locked and that it (might) open up later, so try again. It's not ideal,

Re: [Qemu-devel] [PATCH] pci_register_bar: cleanup

2016-05-17 Thread Cao jin
ping? On 05/12/2016 09:39 AM, Cao jin wrote: Hi, Since it has been Reviewed-by: Paolo Bonzini for almost 2 months, is it forgot to put into upstream? On 03/25/2016 05:25 PM, Paolo Bonzini wrote: On 25/03/2016 07:49, Cao jin wrote: place relevant code tegother, make the code eas

Re: [Qemu-devel] [PATCH v2] rbd:change error_setg() to error_setg_errno()

2016-05-17 Thread Josh Durgin
On 05/09/2016 12:51 AM, Vikhyat Umrao wrote: Ceph RBD block driver does not use error_setg_errno() where it is possible to use. This patch replaces error_setg() from error_setg_errno(). Signed-off-by: Vikhyat Umrao --- block/rbd.c | 38 +++--- 1 file changed,

Re: [Qemu-devel] [PATCH] block/rbd: add .bdrv_reopen_prepare() stub

2016-05-17 Thread Josh Durgin
On 05/17/2016 03:03 AM, Sebastian Färber wrote: Hi Kevin, A correct reopen implementation must consider all options and flags that .bdrv_open() looked at. The options are okay, as both "filename" and "password-secret" aren't things that we want to allow a reopen to change. However, in the flag

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Richard W.M. Jones
Just to close this thread out, I have implemented the exportname in qemu. NBD_OPT_LIST returns the exportname. nbdkit now interoperates with qemu 2.5 and 2.6. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: ht

Re: [Qemu-devel] [PATCH 1/2] e1000: Fixing interrupts pace.

2016-05-17 Thread Sameeh Jubran
This seems like a good idea, thanks! On Mon, May 16, 2016 at 1:55 PM, Shmulik Ladkani < shmulik.ladk...@ravellosystems.com> wrote: > Hi, > > On Mon, 16 May 2016 08:58:32 +0300, sam...@daynix.com wrote: > > This means that on a real hardware when mit_delay==0 ( don't use the > timer > > ) the Ethe

Re: [Qemu-devel] [PATCH v5 09/18] tb hash: hash phys_pc, pc, and flags with xxhash

2016-05-17 Thread Sergey Fedorov
On 14/05/16 06:34, Emilio G. Cota wrote: > For some workloads such as arm bootup, tb_phys_hash is performance-critical. > The is due to the high frequency of accesses to the hash table, originated > by (frequent) TLB flushes that wipe out the cpu-private tb_jmp_cache's. > More info: > https://lis

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Alex Bligh
On 17 May 2016, at 17:56, Eric Blake wrote: > That's why I wonder if we need to document a minimum cutoff at which > clients should assume will always be serviced, and which servers should > not treat as an attack, and whether it should be larger than 32. I don't think we need a specific number

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Alex Bligh
On 17 May 2016, at 17:50, Eric Blake wrote: > > Option 1: I think what I would prefer is a doc patch to the NBD protocol > that explicitly states that returning 0 names followed by NBD_REP_ACK > (current nbdkit behavior) implies that the server doesn't honor names at > all, and will let ANY name

Re: [Qemu-devel] [PATCH 1/3] qcow2: fix condition in is_zero_cluster

2016-05-17 Thread Eric Blake
On 05/17/2016 10:51 AM, Kevin Wolf wrote: > From: "Denis V. Lunev" > > We should check for (res & BDRV_BLOCK_ZERO) only. The situation when we > will have !(res & BDRV_BLOCK_DATA) and will not have BDRV_BLOCK_ZERO is > not possible for images with bdi.unallocated_blocks_are_zero == true. > > For

Re: [Qemu-devel] [PATCH v5 08/18] exec: add tb_hash_func5, derived from xxhash

2016-05-17 Thread Sergey Fedorov
On 14/05/16 06:34, Emilio G. Cota wrote: > This will be used by upcoming changes for hashing the tb hash. > > Add this into a separate file to include the copyright notice from > xxhash. > > Reviewed-by: Richard Henderson > Signed-off-by: Emilio G. Cota > --- > include/exec/tb-hash-xx.h | 94 >

Re: [Qemu-devel] [PATCH 2/3] qcow2: Fix write_zeroes with partially allocated backing file cluster

2016-05-17 Thread Eric Blake
On 05/17/2016 10:51 AM, Kevin Wolf wrote: > In order to correctly check whether a given cluster is read as zero, we > don't only need to check whether bdrv_get_block_status_above() sets > BDRV_BLOCK_ZERO, but also if all sectors for the whole cluster have the > same status. > > Signed-off-by: Kevi

Re: [Qemu-devel] [PATCH v5 06/18] atomics: add atomic_read_acquire and atomic_set_release

2016-05-17 Thread Paolo Bonzini
On 17/05/2016 18:53, Sergey Fedorov wrote: > On 14/05/16 06:34, Emilio G. Cota wrote: >> > When __atomic is not available, we use full memory barriers instead >> > of smp/wmb, since acquire/release barriers apply to all memory >> > operations and not just to loads/stores, respectively. >> > >> >

Re: [Qemu-devel] [PATCH v5 05/18] atomics: add atomic_test_and_set_acquire

2016-05-17 Thread Paolo Bonzini
On 17/05/2016 18:47, Sergey Fedorov wrote: >>> >> On 14/05/16 06:34, Emilio G. Cota wrote: >>> This new helper expands to __atomic_test_and_set with acquire semantics >>> where available; otherwise it expands to __sync_test_and_set, which >>> has acquire semantics. >>> >> Why don't

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Eric Blake
On 05/17/2016 10:26 AM, Alex Bligh wrote: > > On 17 May 2016, at 16:54, Richard W.M. Jones wrote: > >> On Tue, May 17, 2016 at 04:22:06PM +0100, Alex Bligh wrote: >>> nbdkit is non-compliant in that case. Support of NBD_OPT_LIST is >>> compulsory, even if you support it by returning a nameless e

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Eric Blake
On 05/17/2016 10:39 AM, Richard W.M. Jones wrote: > On Tue, May 17, 2016 at 09:59:02AM -0600, Eric Blake wrote: >> On 05/17/2016 09:52 AM, Eric Blake wrote: > Perhaps nbdkit should implement NBD_OPT_LIST returning just "" (the > default name) as its only list entry? Or "default".

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Eric Blake
On 05/17/2016 10:41 AM, Richard W.M. Jones wrote: > On Tue, May 17, 2016 at 10:05:50AM -0600, Eric Blake wrote: >> On 05/17/2016 09:58 AM, Richard W.M. Jones wrote: >>> On Tue, May 17, 2016 at 09:52:30AM -0600, Eric Blake wrote: so it might be nicer to make a change to the protocol docume

Re: [Qemu-devel] [PATCH v5 06/18] atomics: add atomic_read_acquire and atomic_set_release

2016-05-17 Thread Sergey Fedorov
On 14/05/16 06:34, Emilio G. Cota wrote: > When __atomic is not available, we use full memory barriers instead > of smp/wmb, since acquire/release barriers apply to all memory > operations and not just to loads/stores, respectively. > > Signed-off-by: Emilio G. Cota > --- > include/qemu/atomic.h

[Qemu-devel] [PATCH 3/3] qemu-iotests: Some more write_zeroes tests

2016-05-17 Thread Kevin Wolf
This covers some more write_zeroes cases which are relevant for the recent qcow2 optimisations that check the allocation status of the backing file for partial cluster write_zeroes requests. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/154 | 100 ++

[Qemu-devel] [PATCH 1/3] qcow2: fix condition in is_zero_cluster

2016-05-17 Thread Kevin Wolf
From: "Denis V. Lunev" We should check for (res & BDRV_BLOCK_ZERO) only. The situation when we will have !(res & BDRV_BLOCK_DATA) and will not have BDRV_BLOCK_ZERO is not possible for images with bdi.unallocated_blocks_are_zero == true. For those images where it's false, however, it can happen a

Re: [Qemu-devel] [PATCH v5 05/18] atomics: add atomic_test_and_set_acquire

2016-05-17 Thread Sergey Fedorov
On 17/05/16 19:23, Paolo Bonzini wrote: > > On 17/05/2016 18:15, Sergey Fedorov wrote: >> On 14/05/16 06:34, Emilio G. Cota wrote: >>> This new helper expands to __atomic_test_and_set with acquire semantics >>> where available; otherwise it expands to __sync_test_and_set, which >>> has acquire sema

[Qemu-devel] [PATCH 2/3] qcow2: Fix write_zeroes with partially allocated backing file cluster

2016-05-17 Thread Kevin Wolf
In order to correctly check whether a given cluster is read as zero, we don't only need to check whether bdrv_get_block_status_above() sets BDRV_BLOCK_ZERO, but also if all sectors for the whole cluster have the same status. Signed-off-by: Kevin Wolf --- block/qcow2.c | 3 ++- 1 file changed, 2

[Qemu-devel] [PATCH 0/3] qcow2: write_zeroes corruption fixes and tests

2016-05-17 Thread Kevin Wolf
These are the qcow2 write_zeroes fixes that need to be merged with the next pull request as they can actually cause image corruption. The rest of Den's patches are mostly cleanups, so they aren't quite as urgent. Denis V. Lunev (1): qcow2: fix condition in is_zero_cluster Kevin Wolf (2): qcow

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Eric Blake
On 05/17/2016 10:22 AM, Alex Bligh wrote: [replying as I read, so I may seem to change my mind as I go...] >> >> As I read the protocol, I don't see "default" as a permissible name of >> the default export, just "". > > Sorry, I meant that if Richard implements NBD_OPT_LIST he could either > ret

Re: [Qemu-devel] [PATCH 2/4] intel_iommu: use deliver_msi APIC callback

2016-05-17 Thread Paolo Bonzini
On 17/05/2016 15:53, Eduardo Habkost wrote: > On Tue, May 17, 2016 at 03:09:49PM +0200, Paolo Bonzini wrote: >> >> >> On 13/05/2016 19:33, Eduardo Habkost wrote: >>> On Fri, May 06, 2016 at 10:53:46PM +0200, Radim Krčmář wrote: The memory-mapped interface cannot express x2APIC destinations t

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Richard W.M. Jones
On Tue, May 17, 2016 at 09:59:02AM -0600, Eric Blake wrote: > On 05/17/2016 09:52 AM, Eric Blake wrote: > >>> Perhaps nbdkit should implement NBD_OPT_LIST returning just "" (the > >>> default name) as its only list entry? > >> > >> Or "default". > > > > As I read the protocol, I don't see "default

Re: [Qemu-devel] [PATCH v8 0/3] Add optionrom compatible with fw_cfg DMA version

2016-05-17 Thread Paolo Bonzini
On 17/05/2016 16:35, Laszlo Ersek wrote: > On 05/17/16 16:18, Richard W.M. Jones wrote: >> On Wed, May 11, 2016 at 10:06:44PM +0100, Richard W.M. Jones wrote: >>> v7 -> v8: >>> >>> - Add file magic check to signrom.py. >>> >>> - Some whitespace-only changes in linuxboot_dma.c. >>> >>> - Retest

Re: [Qemu-devel] [PATCH 20/50] target-xtensa: make cpu-qom.h not target specific

2016-05-17 Thread Paolo Bonzini
On 17/05/2016 16:24, Max Filippov wrote: >> > Make XtensaCPU an opaque type within cpu-qom.h, and move all definitions >> > of private methods, as well as all type definitions that require knowledge >> > of the layout to cpu.h. Conversely, move all definitions needed to >> > define a class to cp

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Richard W.M. Jones
On Tue, May 17, 2016 at 10:05:50AM -0600, Eric Blake wrote: > On 05/17/2016 09:58 AM, Richard W.M. Jones wrote: > > On Tue, May 17, 2016 at 09:52:30AM -0600, Eric Blake wrote: > >> so it might be nicer to > >> make a change to the protocol document that instead permits current > >> nbdkit behavior

Re: [Qemu-devel] [PATCH 1/5] block: split write_zeroes always

2016-05-17 Thread Kevin Wolf
Am 17.05.2016 um 11:15 hat Denis V. Lunev geschrieben: > We should split requests even if they are less than write_zeroes_alignment. > For example we can have the following request: > offset 62k > size 4k > write_zeroes_alignment 64k > The original code sent 1 request covering 2 qcow2 clust

Re: [Qemu-devel] [PULL 00/20] First round of s390x patches for 2.7

2016-05-17 Thread Peter Maydell
ble in the git repository at: > > git://github.com/cohuck/qemu tags/s390x-20160517 > > for you to fetch changes up to c26916942a4a085b316fd102d1725412a6544b04: > > s390x/pci: remove whitespace (2016-05-17 15:50:29 +0200) > > ---

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Alex Bligh
On 17 May 2016, at 16:54, Richard W.M. Jones wrote: > On Tue, May 17, 2016 at 04:22:06PM +0100, Alex Bligh wrote: >> nbdkit is non-compliant in that case. Support of NBD_OPT_LIST is >> compulsory, even if you support it by returning a nameless export >> (or default). Moreover support of export n

Re: [Qemu-devel] [PATCH v5 05/18] atomics: add atomic_test_and_set_acquire

2016-05-17 Thread Paolo Bonzini
On 17/05/2016 18:15, Sergey Fedorov wrote: > On 14/05/16 06:34, Emilio G. Cota wrote: >> This new helper expands to __atomic_test_and_set with acquire semantics >> where available; otherwise it expands to __sync_test_and_set, which >> has acquire semantics. > > Why don't also add atomic_clear_re

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Alex Bligh
On 17 May 2016, at 16:52, Eric Blake wrote: > On 05/17/2016 09:22 AM, Alex Bligh wrote: > nbdkit's implemention of NBD_OPT_LIST returns an error, because there is no such thing as a list of export names supported (in effect nbdkit allows any export name). >> >> nbdkit is non-com

Re: [Qemu-devel] [PATCH v5 05/18] atomics: add atomic_test_and_set_acquire

2016-05-17 Thread Sergey Fedorov
On 14/05/16 06:34, Emilio G. Cota wrote: > This new helper expands to __atomic_test_and_set with acquire semantics > where available; otherwise it expands to __sync_test_and_set, which > has acquire semantics. Why don't also add atomic_clear_release() for completeness? Kind regards, Sergey > > S

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Eric Blake
On 05/17/2016 09:58 AM, Richard W.M. Jones wrote: > On Tue, May 17, 2016 at 09:52:30AM -0600, Eric Blake wrote: >> so it might be nicer to >> make a change to the protocol document that instead permits current >> nbdkit behavior and puts the burden on clients to interoperate when >> NBD_OPT_LIST is

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Eric Blake
On 05/17/2016 09:52 AM, Eric Blake wrote: >>> Perhaps nbdkit should implement NBD_OPT_LIST returning just "" (the >>> default name) as its only list entry? >> >> Or "default". > > As I read the protocol, I don't see "default" as a permissible name of > the default export, just "". > > Also, we cu

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Richard W.M. Jones
On Tue, May 17, 2016 at 09:52:30AM -0600, Eric Blake wrote: > so it might be nicer to > make a change to the protocol document that instead permits current > nbdkit behavior and puts the burden on clients to interoperate when > NBD_OPT_LIST is not supported. The purpose of nbdkit is to be a server

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Richard W.M. Jones
On Tue, May 17, 2016 at 04:22:06PM +0100, Alex Bligh wrote: > nbdkit is non-compliant in that case. Support of NBD_OPT_LIST is > compulsory, even if you support it by returning a nameless export > (or default). Moreover support of export names is compulsory > (even if you have a single fixed one ca

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Eric Blake
On 05/17/2016 09:22 AM, Alex Bligh wrote: >>> nbdkit's implemention of NBD_OPT_LIST returns an error, because there >>> is no such thing as a list of export names supported (in effect nbdkit >>> allows any export name). > > nbdkit is non-compliant in that case. Support of NBD_OPT_LIST is > compul

Re: [Qemu-devel] [PULL 0/1] Block patches

2016-05-17 Thread Peter Maydell
On 17 May 2016 at 01:19, Stefan Hajnoczi wrote: > The following changes since commit 70f87e0f0aa04f764dabaeb3ed71ff195748076a: > > Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160513-1' into > staging (2016-05-13 13:39:38 +0100) > > are available in the git repository at: > > g

  1   2   3   4   >