[Qemu-devel] [PATCH v7 16/27] cputlb: add tlb_flush_by_mmuidx async routines

2017-01-19 Thread Alex Bennée
This converts the remaining TLB flush routines to use async work when detecting a cross-vCPU flush. The only minor complication is having to serialise the var_list of MMU indexes into a form that can be punted to an asynchronous job. The pending_tlb_flush field on QOM's CPU structure also becomes

[Qemu-devel] [Bug 1657841] [NEW] QEMU Intel HAX Windows

2017-01-19 Thread therock247uk
Public bug reported: Hi, Using the latest exe's from http://qemu.weilnetz.de/w32/ C:\Users\therock247uk\Desktop\jan\qemu-w64-setup-20170113>qemu-system-i386 --enable-hax -m 512 -cdrom C:\Users\therock247uk\Desktop\jan\en_windows_xp_professional_with_service_pack_3_x86_cd_x14-80428.iso HAX is w

[Qemu-devel] [PATCH v7 15/27] cputlb: introduce tlb_flush_* async work.

2017-01-19 Thread Alex Bennée
From: KONRAD Frederic Some architectures allow to flush the tlb of other VCPUs. This is not a problem when we have only one thread for all VCPUs but it definitely needs to be an asynchronous work when we are in true multithreaded work. We take the tb_lock() when doing this to avoid racing with o

[Qemu-devel] [PATCH v7 17/27] cputlb: atomically update tlb fields used by tlb_reset_dirty

2017-01-19 Thread Alex Bennée
The main use case for tlb_reset_dirty is to set the TLB_NOTDIRTY flags in TLB entries to force the slow-path on writes. This is used to mark page ranges containing code which has been translated so it can be invalidated if written to. To do this safely we need to ensure the TLB entries in question

[Qemu-devel] [PATCH v7 14/27] cputlb: tweak qemu_ram_addr_from_host_nofail reporting

2017-01-19 Thread Alex Bennée
This moves the helper function closer to where it is called and updates the error message to report via error_report instead of the deprecated fprintf. Signed-off-by: Alex Bennée --- cputlb.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cputlb.c

[Qemu-devel] [PATCH v7 21/27] target-arm: helpers which may affect global state need the BQL

2017-01-19 Thread Alex Bennée
As the arm_call_el_change_hook may affect global state (for example with updating the global GIC state) we need to assert/take the BQL. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- target/arm/helper.c| 6 ++ target/arm/op_helper.c | 4 2 files changed, 10 insertion

Re: [Qemu-devel] [libvirt] [PATCH 0/9] i386: query-cpu-model-expansion test script

2017-01-19 Thread David Hildenbrand
>> Also think about "query-cpu-model-expansion model=host type=static", >> which will primarily be used by libvirt on s390x. There is no way to >> expand this into a static cpu model. Faking anything will just hide errors. > > Yes, static expansion of host model must always return an error > if i

Re: [Qemu-devel] VM Hung issue

2017-01-19 Thread Umar Draz
Yes the display is blank, and network also not responding, it means vm somewhere hung. On Thu, Jan 19, 2017 at 9:26 PM, Stefan Hajnoczi wrote: > On Wed, Jan 18, 2017 at 10:46 AM, Umar Draz wrote: > > Well yes, whenever vm hung, then there is nothing on vnc display, and > > network of that vm is

[Qemu-devel] [PATCH v7 18/27] cputlb: introduce tlb_flush_*_all_cpus

2017-01-19 Thread Alex Bennée
This introduces support to the cputlb API for flushing all CPUs TLBs with one call. This avoids the need for target helpers to iterate through the vCPUs themselves. Additionally these functions provide a "wait" argument which will cause the work to be scheduled and the calling vCPU to exit its loop

Re: [Qemu-devel] [Qemu-block] [PATCH v10 14/16] file-posix: Implement image locking

2017-01-19 Thread Richard W.M. Jones
On Thu, Jan 19, 2017 at 10:19:29AM -0600, Eric Blake wrote: > On 01/19/2017 09:49 AM, Daniel P. Berrange wrote: > > On Thu, Jan 19, 2017 at 10:38:14PM +0800, Fam Zheng wrote: > >> This implements open flag sensible image locking for local file > >> and host device protocol. > >> > >> virtlockd in l

Re: [Qemu-devel] [PATCH v6 kernel 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2017-01-19 Thread David Hildenbrand
> As long as the interface is similar, it seems to make > sense for me - why invent a completely new device that > looks very much like the old one? The only reason would be that this feature could be used independently of virtio-balloon. But this would of course only be the case, if ballooning i

Re: [Qemu-devel] [PATCH v6 0/2] allow blockdev-add for NFS

2017-01-19 Thread Kevin Wolf
Am 19.01.2017 um 16:58 hat Peter Lieven geschrieben: > Am 19.01.2017 um 16:55 schrieb Kevin Wolf: > >Am 19.01.2017 um 16:44 hat Peter Lieven geschrieben: > >>Am 19.01.2017 um 16:42 schrieb Kevin Wolf: > >>>Am 19.01.2017 um 16:34 hat Peter Lieven geschrieben: > Am 19.01.2017 um 16:20 schrieb Kev

Re: [Qemu-devel] Virtual Machine Generation ID

2017-01-19 Thread Ben Warren
Thanks Laszlo! > On Jan 19, 2017, at 1:25 AM, Laszlo Ersek wrote: > > On 01/19/17 08:09, Ben Warren wrote: >> >>> On Jan 18, 2017, at 4:02 PM, Ben Warren >>> wrote: >>> >>> Hi Michael, On Jan 17, 2017, at 9:45 AM, Michael S. Tsirkin wrote: On Mon, Jan 16, 2017 at 10:57:42

Re: [Qemu-devel] [PATCH v2 2/6] qdict: Add convenience helpers for wrapped puts

2017-01-19 Thread Stefan Hajnoczi
On Wed, Jan 18, 2017 at 10:16:49AM -0600, Eric Blake wrote: > Quite a few users of qdict_put() were manually wrapping a > non-QObject. We can make such call-sites shorter, by providing > common macros to do the tedious work. Also shorten nearby > qdict_put_obj(,,QOBJECT()) sequences. > > Signed-o

[Qemu-devel] [PATCH v7 27/27] target-ppc: take global mutex for set_irq

2017-01-19 Thread Alex Bennée
We have to do this conditionally as the reset paths can trigger IRQ setting when the machine is first brought up. Signed-off-by: Alex Bennée --- hw/ppc/ppc.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index 8945869009..59c3faa

Re: [Qemu-devel] [PATCH v6 1/5] block/vvfat: Remove the undesirable comment

2017-01-19 Thread Dr. David Alan Gilbert
* Ashijeet Acharya (ashijeetacha...@gmail.com) wrote: > Remove the "// assert(is_consistent(s))" comment in block/vvfat.c > > Signed-off-by: Ashijeet Acharya It looks like it's been commented out for about 11 years now - it can go. Reviewed-by: Dr. David Alan Gilbert > --- > block/vvfat.c |

Re: [Qemu-devel] [PULL 0/2] Fixes for x86 host

2017-01-19 Thread Peter Maydell
On 17 January 2017 at 23:03, Richard Henderson wrote: > Fixing a regression reported by Eduardo. > > > r~ > > > The following changes since commit 23eb9e6b6d5315171cc15969bbc755f258004df0: > > Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2017-01-16' > into staging (2017-01-17 13:

[Qemu-devel] [PATCH v7 24/27] target-arm: introduce ARM_CP_EXIT_PC

2017-01-19 Thread Alex Bennée
Some helpers may trigger an immediate exit of the cpu_loop. If this happens the PC need to be rectified to ensure the restart will begin on the next instruction. Signed-off-by: Alex Bennée --- target/arm/cpu.h | 3 ++- target/arm/translate-a64.c | 4 target/arm/translate.c | 4

Re: [Qemu-devel] [PATCH] i386: Support "-cpu host" on TCG too

2017-01-19 Thread Daniel P. Berrange
On Mon, Jan 16, 2017 at 05:54:52PM -0200, Eduardo Habkost wrote: > Change the meaning of "-cpu host" to "enable all features > supported by the accelerator in the current host", so that it can > be used to enable/query all features supported by TCG. > > To make sure "host" is still at the end of t

Re: [Qemu-devel] [libvirt] [PATCH 0/9] i386: query-cpu-model-expansion test script

2017-01-19 Thread Daniel P. Berrange
On Thu, Jan 19, 2017 at 06:21:22PM +0100, David Hildenbrand wrote: > > >> Also think about "query-cpu-model-expansion model=host type=static", > >> which will primarily be used by libvirt on s390x. There is no way to > >> expand this into a static cpu model. Faking anything will just hide errors.

Re: [Qemu-devel] [PATCH v6 0/2] allow blockdev-add for NFS

2017-01-19 Thread Peter Lieven
Am 19.01.2017 um 18:08 schrieb Kevin Wolf: Am 19.01.2017 um 16:58 hat Peter Lieven geschrieben: Am 19.01.2017 um 16:55 schrieb Kevin Wolf: Am 19.01.2017 um 16:44 hat Peter Lieven geschrieben: Am 19.01.2017 um 16:42 schrieb Kevin Wolf: Am 19.01.2017 um 16:34 hat Peter Lieven geschrieben: Am 1

Re: [Qemu-devel] [PATCH v6 2/5] migration: Add a new option to enable only-migratable

2017-01-19 Thread Dr. David Alan Gilbert
* Ashijeet Acharya (ashijeetacha...@gmail.com) wrote: > Add a new option "--only-migratable" in qemu which will allow to add > only those devices which will not fail qemu after migration. Devices > set with the flag 'unmigratable' cannot be added when this option will > be used. > > Signed-off-by:

Re: [Qemu-devel] [PATCH RFC 0/3] vfio: allow to notify unmap for very big region

2017-01-19 Thread Alex Williamson
On Thu, 19 Jan 2017 17:25:29 +0800 Peter Xu wrote: > This requirement originates from the VT-d vfio series: > > https://lists.nongnu.org/archive/html/qemu-devel/2017-01/msg03495.html > > The goal of this series is to allow IOMMU to notify unmap with very > big IOTLB range, for example, with b

Re: [Qemu-devel] [PATCH v2 1/6] Add cfgend parameter for ARM CPU selection.

2017-01-19 Thread Julian Brown
On Thu, 19 Jan 2017 15:12:49 + Peter Maydell wrote: > I'm actually looking at a patch at the moment that attempts > to fix this by adding a cpu_generic_init_unrealized(), > which does everything that cpu_generic_init() does except > the final "set the realized prop to true" step, so that you

Re: [Qemu-devel] [PATCH RFC] acpi: add reset register to fadt

2017-01-19 Thread Phil Dennis-Jordan
On 18 January 2017 at 17:30, Michael S. Tsirkin wrote: > I think what's important is the Fadt format revision. That one was 1 for 1.0b > and 3 for 2.0. > > See page 112, Table 5-5 Fixed ACPI Description Table Format in acpi spec > 1.0b. > > Now look at page 110 in spec 2.0, this time > "Table 5-8

Re: [Qemu-devel] Virtual Machine Generation ID

2017-01-19 Thread Laszlo Ersek
On 01/19/17 18:47, Ben Warren wrote: > Thanks Laszlo! >> On Jan 19, 2017, at 1:25 AM, Laszlo Ersek > > wrote: >> >> On 01/19/17 08:09, Ben Warren wrote: >>> On Jan 18, 2017, at 4:02 PM, Ben Warren >>> > wrote: Hi Michael,

Re: [Qemu-devel] [PATCH] i386: Support "-cpu host" on TCG too

2017-01-19 Thread Peter Maydell
On 19 January 2017 at 17:50, Daniel P. Berrange wrote: > On Mon, Jan 16, 2017 at 05:54:52PM -0200, Eduardo Habkost wrote: >> Change the meaning of "-cpu host" to "enable all features >> supported by the accelerator in the current host", so that it can >> be used to enable/query all features suppor

Re: [Qemu-devel] [PATCH v2 1/6] Add cfgend parameter for ARM CPU selection.

2017-01-19 Thread Peter Maydell
On 19 January 2017 at 18:02, Julian Brown wrote: > We're using integratorcp That board model is extremely ancient and unloved, by the way. If we ever make good on the suggestion from last year to start deprecating and eventually removing unmaintained board models, it's probably going to be on the

[Qemu-devel] [Bug 1174654] Re: qemu-system-x86_64 takes 100% CPU after host machine resumed from suspend to ram

2017-01-19 Thread Francois Gouget
This sounds sort of like a problem I have with reverting to live snapshots. What I found out is that this is related to restoring the clock in the guest. You can find out more about it there: https://bugs.launchpad.net/qemu/+bug/1505041 The takeaway is that a workaround is to set track='guest' on

Re: [Qemu-devel] [PATCH] i386: Support "-cpu host" on TCG too

2017-01-19 Thread Eduardo Habkost
On Thu, Jan 19, 2017 at 06:22:40PM +, Peter Maydell wrote: > On 19 January 2017 at 17:50, Daniel P. Berrange wrote: > > On Mon, Jan 16, 2017 at 05:54:52PM -0200, Eduardo Habkost wrote: > >> Change the meaning of "-cpu host" to "enable all features > >> supported by the accelerator in the curre

Re: [Qemu-devel] [PULL 00/12] s390x update

2017-01-19 Thread Peter Maydell
On 17 January 2017 at 08:56, Cornelia Huck wrote: > The following changes since commit 2ccede18bd24fce5db83fef3674563a1f256717b: > > Merge remote-tracking branch > 'remotes/vivier/tags/m68k-for-2.9-pull-request' into staging (2017-01-16 > 12:41:35 +) > > are available in the git repository

[Qemu-devel] [Bug 1505041] Re: Live snapshot revert times increases linearly with snapshot age

2017-01-19 Thread Francois Gouget
See also: https://bugs.launchpad.net/qemu/+bug/1174654 -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1505041 Title: Live snapshot revert times increases linearly with snapshot age Status in QEMU:

Re: [Qemu-devel] [PATCH] i386: Support "-cpu host" on TCG too

2017-01-19 Thread Daniel P. Berrange
On Thu, Jan 19, 2017 at 04:31:45PM -0200, Eduardo Habkost wrote: > On Thu, Jan 19, 2017 at 06:22:40PM +, Peter Maydell wrote: > > On 19 January 2017 at 17:50, Daniel P. Berrange wrote: > > > On Mon, Jan 16, 2017 at 05:54:52PM -0200, Eduardo Habkost wrote: > > >> Change the meaning of "-cpu hos

Re: [Qemu-devel] [PATCH v6 3/5] migration: Allow "device add" options to only add migratable devices

2017-01-19 Thread Dr. David Alan Gilbert
* Ashijeet Acharya (ashijeetacha...@gmail.com) wrote: > Introduce checks for the unmigratable flag in the VMStateDescription > structs of respective devices when user attempts to add them. If the > "--only-migratable" was specified, all unmigratable devices will > rightly fail to add. This feature

[Qemu-devel] [QEMU PATCH v17 1/4] migration: extend VMStateInfo

2017-01-19 Thread Jianjun Duan
Current migration code cannot handle some data structures such as QTAILQ in qemu/queue.h. Here we extend the signatures of put/get in VMStateInfo so that customized handling is supported. put now will return int type. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Jianjun Duan --- hw/displ

[Qemu-devel] [QEMU PATCH v17 2/4] migration: migrate QTAILQ

2017-01-19 Thread Jianjun Duan
Currently we cannot directly transfer a QTAILQ instance because of the limitation in the migration code. Here we introduce an approach to transfer such structures. We created VMStateInfo vmstate_info_qtailq for QTAILQ. Similar VMStateInfo can be created for other data structures such as list. When

[Qemu-devel] [QEMU PATCH v17 0/4] migration: migrate QTAILQ

2017-01-19 Thread Jianjun Duan
Hi all, Comments are welcome. v17: - Fixed a type cast issue in test-vmstate.c. Previous versions are: v16: - Moved a variable to global in test-vmstate.c following Dave's suggestion. (link: http://lists.nongnu.org/archive/html/qemu-devel/2016-12/msg01187.html) v15: - Improved error me

[Qemu-devel] [QEMU PATCH v17 3/4] tests/migration: Add test for QTAILQ migration

2017-01-19 Thread Jianjun Duan
Add a test for QTAILQ migration to tests/test-vmstate.c. Signed-off-by: Jianjun Duan --- tests/test-vmstate.c | 147 +++ 1 file changed, 147 insertions(+) diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c index d2f529b..9d87faf 100644 --- a

[Qemu-devel] [QEMU PATCH v17 4/4] migration: add error_report

2017-01-19 Thread Jianjun Duan
Added error_report where version_ids do not match in vmstate_load_state. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Jianjun Duan --- migration/vmstate.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/migration/vmstate.c b/migration/vmstate.c index 2f9d4ba..8ddd230 100644 ---

Re: [Qemu-devel] [PATCH] i386: Support "-cpu host" on TCG too

2017-01-19 Thread Eduardo Habkost
On Thu, Jan 19, 2017 at 06:38:36PM +, Daniel P. Berrange wrote: > On Thu, Jan 19, 2017 at 04:31:45PM -0200, Eduardo Habkost wrote: > > On Thu, Jan 19, 2017 at 06:22:40PM +, Peter Maydell wrote: > > > On 19 January 2017 at 17:50, Daniel P. Berrange > > > wrote: > > > > On Mon, Jan 16, 2017

Re: [Qemu-devel] [PULL 00/30] target-sparc sun4v support

2017-01-19 Thread Peter Maydell
On 18 January 2017 at 22:38, Artyom Tarasenko wrote: > This series adds sun4v support. Its v2 was previously submitted via Richard's > tree, but produced > a clang warning due to a missing #ifdef. > > v2 -> v3: > added an #ifdef to avoid unused function warning in user mode > > The following chan

Re: [Qemu-devel] [PATCH v2 3/4] compiler: expression version of QEMU_BUILD_BUG_ON

2017-01-19 Thread Michael S. Tsirkin
On Thu, Jan 19, 2017 at 02:33:40PM +0100, Markus Armbruster wrote: > Paolo Bonzini writes: > > > On 19/01/2017 09:12, Markus Armbruster wrote: > >> "Michael S. Tsirkin" writes: > >> > >>> QEMU_BUILD_BUG_ON uses a typedef in order to be safe > >>> to use outside functions, but sometimes it's use

Re: [Qemu-devel] [PATCH v2 07/11] aspeed/smc: handle SPI flash Command mode

2017-01-19 Thread Peter Maydell
On 9 January 2017 at 16:24, Cédric Le Goater wrote: > The Aspeed SMC controllers have a mode (Command mode) in which > accesses to the flash content are no different than doing MMIOs. The > controller generates all the necessary commands to load (or store) > data in memory. > > However, accesses a

Re: [Qemu-devel] [PATCH v2] vfio/pci: Support error recovery

2017-01-19 Thread Alex Williamson
On Thu, 19 Jan 2017 11:04:37 +0800 Cao jin wrote: > On 01/19/2017 05:32 AM, Alex Williamson wrote: > > On Tue, 10 Jan 2017 17:11:01 +0200 > > "Michael S. Tsirkin" wrote: > > > >> On Tue, Jan 10, 2017 at 07:46:17PM +0800, Cao jin wrote: > >>> > >>> > >>> On 01/10/2017 07:04 AM, Michael S. Ts

Re: [Qemu-devel] [PATCH v6 4/5] migration: disallow migrate_add_blocker during migration

2017-01-19 Thread Dr. David Alan Gilbert
* Ashijeet Acharya (ashijeetacha...@gmail.com) wrote: > If a migration is already in progress and somebody attempts > to add a migration blocker, this should rightly fail. > > Add an errp parameter and a retcode return value to migrate_add_blocker. Reviewed-by: Dr. David Alan Gilbert armbru: Ar

Re: [Qemu-devel] [PATCH v6 5/5] migration: Fail migration blocker for --only-migratable

2017-01-19 Thread Dr. David Alan Gilbert
* Ashijeet Acharya (ashijeetacha...@gmail.com) wrote: > migrate_add_blocker should rightly fail if the '--only-migratable' > option was specified and the device in use should not be able to > perform the action which results in an unmigratable VM. > > Make migrate_add_blocker return -EACCES in thi

[Qemu-devel] [PATCH RFC] vfio error recovery: kernel support

2017-01-19 Thread Michael S. Tsirkin
This is a design and an initial patch for kernel side for AER support in VFIO. 0. What happens now (PCIE AER only) Fatal errors cause a link reset. Non fatal errors don't. All errors stop the VM eventually, but not immediately because it's detected and reported asynchronously. Inter

Re: [Qemu-devel] [PATCH v2 07/11] aspeed/smc: handle SPI flash Command mode

2017-01-19 Thread Cédric Le Goater
On 01/19/2017 08:26 PM, Peter Maydell wrote: > On 9 January 2017 at 16:24, Cédric Le Goater wrote: >> The Aspeed SMC controllers have a mode (Command mode) in which >> accesses to the flash content are no different than doing MMIOs. The >> controller generates all the necessary commands to load (o

[Qemu-devel] [PATCH] aspeed/smc: remove unused routine aspeed_smc_is_usermode()

2017-01-19 Thread Cédric Le Goater
Signed-off-by: Cédric Le Goater --- hw/ssi/aspeed_smc.c | 5 - 1 file changed, 5 deletions(-) diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c index a0a816407fc1..ae1ad2dba6ff 100644 --- a/hw/ssi/aspeed_smc.c +++ b/hw/ssi/aspeed_smc.c @@ -406,11 +406,6 @@ static inline int aspeed_smc_f

[Qemu-devel] [PATCH v2 0/3] scsi-generic and BLKSECTGET

2017-01-19 Thread Eric Farman
In the Linux kernel, I see two (three) places where the BLKSECTGET ioctl is handled: (1) block/(compat_)ioctl.c -- (compat_)blkdev_ioctl (2) drivers/scsi/sg.c -- sg_ioctl The former has been around forever[1], and returns a short value measured in sectors. A sector is generally assumed to be 512

[Qemu-devel] [PATCH v2 3/3] block: get max_transfer limit for char (scsi-generic) devices

2017-01-19 Thread Eric Farman
Commit 6f607174 introduced a routine to get the maximum number of bytes for a single I/O transfer for block devices, however scsi generic devices are character devices, not block. Add a condition for this, such that scsi generic devices can view the same data. Some tweaking of data is required, b

[Qemu-devel] [PATCH v2 1/3] hw/scsi: Fix debug message of cdb structure in scsi-generic

2017-01-19 Thread Eric Farman
When running with debug enabled, the scsi-generic cdb that is dumped skips byte 0 of the command, which is the opcode. This makes identifying which command is being issued/completed a little difficult. Example: 0x00 0x00 0x01 0x00 0x00 scsi-generic: scsi_read_data 0x0 scsi-generic: Data re

[Qemu-devel] [PATCH v2 2/3] block: Fix target variable of BLKSECTGET ioctl

2017-01-19 Thread Eric Farman
Commit 6f607174 introduced a routine to call the kernel BLKSECTGET ioctl, which stores the result back to user space. However, the size of the data returned depends on the routine handling the ioctl. The (compat_)blkdev_ioctl returns a short, while sg_ioctl returns an int. Thus, on big-endian sys

Re: [Qemu-devel] [PATCH v2 3/4] compiler: expression version of QEMU_BUILD_BUG_ON

2017-01-19 Thread Eric Blake
On 01/19/2017 01:25 PM, Michael S. Tsirkin wrote: > +#define QEMU_BUILD_BUG_ON_ZERO(x) (sizeof(int[(x) ? -1 : 1]) - > sizeof(int)) >>> >>> Linux here uses: >>> >>> #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) >>> >>> and the issue is that sizeof(int[(x) ? -1 : 1]) could b

[Qemu-devel] [PATCH] pci: mark ROMs read-only

2017-01-19 Thread Michael S. Tsirkin
Looks like we didn't mark PCI ROMs as RO allowing mischief such as guests writing there. Further, e.g. vhost gets confused trying to allocate enough space to log writes there. Fix it up. Signed-off-by: Michael S. Tsirkin --- hw/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) dif

Re: [Qemu-devel] [PATCH v2 3/4] compiler: expression version of QEMU_BUILD_BUG_ON

2017-01-19 Thread Michael S. Tsirkin
On Thu, Jan 19, 2017 at 02:33:40PM +0100, Markus Armbruster wrote: > Paolo Bonzini writes: > > > On 19/01/2017 09:12, Markus Armbruster wrote: > >> "Michael S. Tsirkin" writes: > >> > >>> QEMU_BUILD_BUG_ON uses a typedef in order to be safe > >>> to use outside functions, but sometimes it's use

[Qemu-devel] [PATCH 6/6] i386: Don't set CPUClass::cpu_def on "max" model

2017-01-19 Thread Eduardo Habkost
Host CPUID info is used by the "max" CPU model only in KVM mode. Move the initialization of CPUID data for "max" from class_init to instance_init, and don't set CPUClass::cpu_def for "max". Signed-off-by: Eduardo Habkost --- target/i386/cpu-qom.h | 4 +++- target/i386/cpu.c | 45 +++

[Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM

2017-01-19 Thread Eduardo Habkost
This is v2 of the previous series that enabled the "host" CPU model on TCG. Now a new "max" CPU is being added, while keeping "host" KVM-specific. In addition to simply adding "max" as a copy of the existing "host" CPU model, additional patches change it to not use any host CPUID information when

[Qemu-devel] [PATCH 3/6] i386: Rename X86CPU::host_features to X86CPU::max_features

2017-01-19 Thread Eduardo Habkost
Rename the field and add a small comment to make its purpose clearer. Signed-off-by: Eduardo Habkost --- target/i386/cpu.h | 2 +- target/i386/cpu.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 10c5a3538d..889363e120 10064

Re: [Qemu-devel] [PATCH v2 3/4] compiler: expression version of QEMU_BUILD_BUG_ON

2017-01-19 Thread Michael S. Tsirkin
On Thu, Jan 19, 2017 at 02:58:48PM -0600, Eric Blake wrote: > On 01/19/2017 01:25 PM, Michael S. Tsirkin wrote: > > > +#define QEMU_BUILD_BUG_ON_ZERO(x) (sizeof(int[(x) ? -1 : 1]) - > > sizeof(int)) > >>> > >>> Linux here uses: > >>> > >>> #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int

[Qemu-devel] [PATCH 1/6] i386: Unset cannot_destroy_with_object_finalize_yet on "host" model

2017-01-19 Thread Eduardo Habkost
The class is now safe because the assert(kvm_enabled()) line was removed by commit e435601058e656e6d24e3e87b187e5518f7bf16a. Signed-off-by: Eduardo Habkost --- target/i386/cpu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index cff23e129d..7947c8737

[Qemu-devel] [PATCH 4/6] i386: Create "max" CPU model

2017-01-19 Thread Eduardo Habkost
Rename the existing "host" CPU model to "max, and set it to kvm_enabled=false. The new "max" CPU model will be able to enable all features supported by TCG out of the box, because its logic is based on x86_cpu_get_supported_feature_word(), which already works with TCG. A new KVM-specific "host" cl

[Qemu-devel] [PATCH] KVM: PPC: eliminate unnecessary duplicate constants

2017-01-19 Thread Paolo Bonzini
These are not needed since linux-headers/ provides up-to-date definitions. The constants are in linux-headers/asm-powerpc/kvm.h. The sole users, hw/intc/xics_kvm.c and target/ppc/kvm.c, include asm/kvm.h via sysemu/kvm.h->linux/kvm.h. Signed-off-by: Paolo Bonzini --- target/ppc/kvm_ppc.h | 12 -

[Qemu-devel] [PATCH 5/6] i386: Make "max" model not use any host CPUID info on TCG

2017-01-19 Thread Eduardo Habkost
Instead of reporting host CPUID data on "max", use the qemu64 CPU model as reference to initialize CPUID vendor/family/model/stepping/model-id. Signed-off-by: Eduardo Habkost --- target/i386/cpu.c | 9 + 1 file changed, 9 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c

[Qemu-devel] [PATCH v3 3/4] compiler: expression version of QEMU_BUILD_BUG_ON

2017-01-19 Thread Michael S. Tsirkin
QEMU_BUILD_BUG_ON uses a typedef in order to be safe to use outside functions, but sometimes it's useful to have a version that can be used within an expression. Following what Linux does, introduce QEMU_BUILD_BUG_ON_ZERO that return zero after checking condition at build time. Signed-off-by: Mich

[Qemu-devel] [PATCH v3 2/4] compiler: rework BUG_ON using a struct

2017-01-19 Thread Michael S. Tsirkin
There are theoretical concerns that some compilers might not trigger build failures on attempts to define an array of size -1 and make it a variable sized array instead. Let rewrite using a struct with a negative bit field size instead as there are no dynamic bit field sizes. This is similar to wh

[Qemu-devel] [PULL 01/17] virtio-net: enable ioeventfd even if vhost=off

2017-01-19 Thread Michael S. Tsirkin
From: Paolo Bonzini virtio-net-pci does not enable ioeventfd for historical reasons (and nobody ever checked whether it should be revisited). Note that other backends do enable ioeventfd for virtio-net. However, it has a major effect on performance. On Windows, throughput is _multiplied_ by 2

[Qemu-devel] [PATCH 2/6] i386: Add ordering field to CPUClass

2017-01-19 Thread Eduardo Habkost
Instead of using kvm_enabled to order the "-cpu help" list, use a new "ordering" field for that. Signed-off-by: Eduardo Habkost --- target/i386/cpu-qom.h | 2 ++ target/i386/cpu.c | 8 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/target/i386/cpu-qom.h b/target/i386

[Qemu-devel] [PULL 00/17] virtio, vhost, pc: fixes, features

2017-01-19 Thread Michael S. Tsirkin
The following changes since commit 23eb9e6b6d5315171cc15969bbc755f258004df0: Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2017-01-16' into staging (2017-01-17 13:53:50 +) are available in the git repository at: git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_u

[Qemu-devel] [PATCH v3 0/4] ARRAY_SIZE fixups

2017-01-19 Thread Michael S. Tsirkin
Turns out virtio kept using ARRAY_SIZE on fields which stopped being arrays, this was noticed by a coverity scan. I fixed this up, this patchset fixes up the ARRAY_SIZE macro so that this bug does not reappear in any other place. changes from v2: - dropped the merged virtio patch - whitesp

[Qemu-devel] [PULL 10/17] virtio_mmio: add standard header file

2017-01-19 Thread Michael S. Tsirkin
Signed-off-by: Michael S. Tsirkin --- include/standard-headers/linux/virtio_mmio.h | 141 +++ 1 file changed, 141 insertions(+) create mode 100644 include/standard-headers/linux/virtio_mmio.h diff --git a/include/standard-headers/linux/virtio_mmio.h b/include/standard-h

[Qemu-devel] [PULL 03/17] virtio: disable notifications again after poll succeeded

2017-01-19 Thread Michael S. Tsirkin
From: Stefan Hajnoczi While AioContext is in polling mode virtqueue notifications are not necessary. Some device virtqueue handlers enable notifications. Make sure they stay disabled to avoid unnecessary vmexits. Signed-off-by: Stefan Hajnoczi Reviewed-by: Michael S. Tsirkin Signed-off-by: M

[Qemu-devel] [PATCH v3 1/4] compiler: drop ; after BUILD_BUG_ON

2017-01-19 Thread Michael S. Tsirkin
All users include the trailing ; anyway, let's require that - it seems cleaner. Signed-off-by: Michael S. Tsirkin --- include/qemu/compiler.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 157698b..7512082 100644 ---

[Qemu-devel] [PULL 06/17] fw-cfg: turn FW_CFG_FILE_SLOTS into a device property

2017-01-19 Thread Michael S. Tsirkin
From: Laszlo Ersek We'd like to raise the value of FW_CFG_FILE_SLOTS. Doing it naively could lead to problems with backward migration: a more recent QEMU (running an older machine type) would allow the guest, in fw_cfg_select(), to select a high key value that is unavailable in the same machine t

[Qemu-devel] [PULL 14/17] update-linux-headers.sh: support __bitwise

2017-01-19 Thread Michael S. Tsirkin
In 4.10, Linux is switching from __bitwise__ to use __bitwise exclusively. Update our script accordingly. Signed-off-by: Michael S. Tsirkin --- scripts/update-linux-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-lin

[Qemu-devel] [PULL 11/17] virtio-mmio: switch to linux headers

2017-01-19 Thread Michael S. Tsirkin
Switch to virtio_mmio.h from Linux - will make it easier to implement virtio 1. Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-mmio.c | 95 +++-- 1 file changed, 37 insertions(+), 58 deletions(-) diff --git a/hw/virtio/virtio-mmio.c b/hw/virti

[Qemu-devel] [PATCH v3 4/4] ARRAY_SIZE: check that argument is an array

2017-01-19 Thread Michael S. Tsirkin
It's a familiar pattern: some code uses ARRAY_SIZE, then refactoring changes the argument from an array to a pointer to a dynamically allocated buffer. Code keeps compiling but any ARRAY_SIZE calls now return the size of the pointer divided by element size. Let's add build time checks to ARRAY_SI

[Qemu-devel] [PULL 08/17] fw-cfg: bump "x-file-slots" to 0x20 for 2.9+ machine types

2017-01-19 Thread Michael S. Tsirkin
From: Laszlo Ersek More precisely, the "x-file-slots" count is bumped for all machine types that: (a) use fw_cfg, and (b) are not versioned (hence migration is not expected to work for them across QEMU releases anyway), or have version 2.9. This affects machine types implemented in the follo

[Qemu-devel] [PULL 17/17] virtio: force VIRTIO_F_IOMMU_PLATFORM

2017-01-19 Thread Michael S. Tsirkin
From: Jason Wang We allow vhost to clear VIRITO_F_IOMMU_PLATFORM which is wrong since VIRTIO_F_IOMMU_PLATFORM is mandatory for security. Fixing this by enforce it after vdc->get_features(). Signed-off-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/vir

[Qemu-devel] [PULL 12/17] pci_regs: update to latest linux

2017-01-19 Thread Michael S. Tsirkin
this drops a duplicate definition of PCI_EXT_CAP_ATS_SIZEOF Signed-off-by: Michael S. Tsirkin --- include/standard-headers/linux/pci_regs.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/standard-headers/linux/pci_regs.h b/include/standard-headers/linux/pci_regs.h index be5b066..e5a

[Qemu-devel] [PULL 09/17] virtio: drop an obsolete comment

2017-01-19 Thread Michael S. Tsirkin
virtio core has code to revert queue number to maximum on reset. Drop TODO to add that. Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi --- hw/virtio/virtio-pci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 8baaf2b..092

[Qemu-devel] [PULL 02/17] Revert "virtio: turn vq->notification into a nested counter"

2017-01-19 Thread Michael S. Tsirkin
From: Stefan Hajnoczi This reverts commit aff8fd18f1786fc5af259a9bc0077727222f51ca. Both virtio-net and virtio-crypto do not balance virtio_queue_set_notification() enable and disable calls. This makes the notifications_disabled counter unreliable and Doug Goldstein reported the following asser

[Qemu-devel] [PULL 04/17] vhost_net: device IOTLB support

2017-01-19 Thread Michael S. Tsirkin
From: Jason Wang This patches implements Device IOTLB support for vhost kernel. This is done through: 1) switch to use dma helpers when map/unmap vrings from vhost codes 2) introduce a set of VhostOps to: - setting up device IOTLB request callback - processing device IOTLB request - pro

[Qemu-devel] [PULL 15/17] vhost: drop VHOST_F_DEVICE_IOTLB

2017-01-19 Thread Michael S. Tsirkin
Upstream does not have it, uses VIRTIO_F_IOMMU_PLATFORM to signal support instead. Signed-off-by: Michael S. Tsirkin --- linux-headers/linux/vhost.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h index ac7a1f1..1e86a3d 100644 --- a/

[Qemu-devel] [PULL 13/17] virtio_crypto: header update

2017-01-19 Thread Michael S. Tsirkin
Update header from latest linux driver. Session creation structs gain padding to make them same size. Formatting cleanups. Signed-off-by: Michael S. Tsirkin Tested-by: Gonglei Reviewed-by: Gonglei --- include/standard-headers/linux/virtio_crypto.h | 481 + 1 file chang

[Qemu-devel] [PULL 07/17] pc: Add 2.9 machine-types

2017-01-19 Thread Michael S. Tsirkin
From: Eduardo Habkost Cc: "Michael S. Tsirkin" Cc: Laszlo Ersek Cc: Igor Mammedov Signed-off-by: Eduardo Habkost Reviewed-by: Laszlo Ersek Reviewed-by: Michael S. Tsirkin Acked-by: Gabriel Somlo Tested-by: Gabriel Somlo Cc: Gabriel Somlo Signed-off-by: Laszlo Ersek Reviewed-by: Michael

Re: [Qemu-devel] [PATCH v3 2/4] compiler: rework BUG_ON using a struct

2017-01-19 Thread Eric Blake
On 01/19/2017 03:07 PM, Michael S. Tsirkin wrote: > There are theoretical concerns that some compilers might not trigger > build failures on attempts to define an array of size -1 and make it a > variable sized array instead. Rather, the concern is that if someone changes code so that the 'x' of Q

Re: [Qemu-devel] [PATCH v3 3/4] compiler: expression version of QEMU_BUILD_BUG_ON

2017-01-19 Thread Eric Blake
On 01/19/2017 03:07 PM, Michael S. Tsirkin wrote: > QEMU_BUILD_BUG_ON uses a typedef in order to be safe > to use outside functions, but sometimes it's useful > to have a version that can be used within an expression. > Following what Linux does, introduce QEMU_BUILD_BUG_ON_ZERO > that return zero

[Qemu-devel] [PULL 05/17] fw-cfg: support writeable blobs

2017-01-19 Thread Michael S. Tsirkin
Useful to send guest data back to QEMU. Changes from Laszlo Ersek : - rebase the patch from Michael Tsirkin's original postings at [1] and [2] to the following patches: - loader: Allow a custom AddressSpace when loading ROMs - loader: Add AddressSpace loading support to uImages - loader: f

[Qemu-devel] [PULL 16/17] virtio: fix up max size checks

2017-01-19 Thread Michael S. Tsirkin
Coverity reports that ARRAY_SIZE(elem->out_sg) (and all the others too) is wrong because elem->out_sg is a pointer. However, the check is not in the right place and the max_size argument of virtqueue_map_iovec can be removed. The check on in_num/out_num should be moved to qemu_get_virtqueue_eleme

Re: [Qemu-devel] [PATCH v6] hw/ssi/imx_spi.c: fix CS handling during SPI access.

2017-01-19 Thread Jean-Christophe DUBOIS
Le 16/01/2017 à 20:06, mar.krzeminski a écrit : W dniu 16.01.2017 o 18:22, Peter Maydell pisze: On 11 January 2017 at 20:00, Jean-Christophe Dubois wrote: The i.MX SPI device was not de-asserting the CS line at the end of memory access. This triggered a SIGSEGV in Qemu when the sabrelite emul

Re: [Qemu-devel] [PATCH v3 1/4] compiler: drop ; after BUILD_BUG_ON

2017-01-19 Thread Eric Blake
On 01/19/2017 03:07 PM, Michael S. Tsirkin wrote: > All users include the trailing ; anyway, let's require that - > it seems cleaner. > > Signed-off-by: Michael S. Tsirkin > --- > include/qemu/compiler.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake > > di

Re: [Qemu-devel] [PATCH v3 4/4] ARRAY_SIZE: check that argument is an array

2017-01-19 Thread Eric Blake
On 01/19/2017 03:07 PM, Michael S. Tsirkin wrote: > It's a familiar pattern: some code uses ARRAY_SIZE, then refactoring > changes the argument from an array to a pointer to a dynamically > allocated buffer. Code keeps compiling but any ARRAY_SIZE calls now > return the size of the pointer divided

Re: [Qemu-devel] [PATCH RFC] vfio error recovery: kernel support

2017-01-19 Thread Alex Williamson
On Thu, 19 Jan 2017 22:16:03 +0200 "Michael S. Tsirkin" wrote: > This is a design and an initial patch for kernel side for AER > support in VFIO. > > 0. What happens now (PCIE AER only) >Fatal errors cause a link reset. >Non fatal errors don't. >All errors stop the VM eventually, but

Re: [Qemu-devel] [PATCH v3 4/4] ARRAY_SIZE: check that argument is an array

2017-01-19 Thread Michael S. Tsirkin
On Thu, Jan 19, 2017 at 03:59:33PM -0600, Eric Blake wrote: > On 01/19/2017 03:07 PM, Michael S. Tsirkin wrote: > > It's a familiar pattern: some code uses ARRAY_SIZE, then refactoring > > changes the argument from an array to a pointer to a dynamically > > allocated buffer. Code keeps compiling b

Re: [Qemu-devel] [PATCH RFC] vfio error recovery: kernel support

2017-01-19 Thread Michael S. Tsirkin
On Thu, Jan 19, 2017 at 03:10:56PM -0700, Alex Williamson wrote: > On Thu, 19 Jan 2017 22:16:03 +0200 > "Michael S. Tsirkin" wrote: > > > This is a design and an initial patch for kernel side for AER > > support in VFIO. > > > > 0. What happens now (PCIE AER only) > >Fatal errors cause a lin

Re: [Qemu-devel] [PATCH] virtio: force VIRTIO_F_IOMMU_PLATFORM

2017-01-19 Thread Michael S. Tsirkin
On Thu, Jan 19, 2017 at 11:12:21AM +0800, Jason Wang wrote: > > > On 2017年01月19日 01:50, Michael S. Tsirkin wrote: > > On Wed, Jan 18, 2017 at 10:42:48AM +0800, Jason Wang wrote: > > > > > > On 2017年01月17日 22:44, Michael S. Tsirkin wrote: > > > > On Tue, Jan 17, 2017 at 12:01:00PM +0800, Jason Wa

Re: [Qemu-devel] [PATCH RFC] vfio error recovery: kernel support

2017-01-19 Thread Alex Williamson
On Fri, 20 Jan 2017 00:21:02 +0200 "Michael S. Tsirkin" wrote: > On Thu, Jan 19, 2017 at 03:10:56PM -0700, Alex Williamson wrote: > > On Thu, 19 Jan 2017 22:16:03 +0200 > > "Michael S. Tsirkin" wrote: > > > > > This is a design and an initial patch for kernel side for AER > > > support in VFI

Re: [Qemu-devel] [PATCH v3 4/4] ARRAY_SIZE: check that argument is an array

2017-01-19 Thread Eric Blake
On 01/19/2017 04:11 PM, Michael S. Tsirkin wrote: >>> +#define QEMU_IS_ARRAY(x) (!__builtin_types_compatible_p(typeof(x), \ >>> +typeof(&(x)[0]))) >>> #ifndef ARRAY_SIZE >>> -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) >>> +#define AR

Re: [Qemu-devel] [PATCH v7 26/27] tcg: enable MTTCG by default for ARM on x86 hosts

2017-01-19 Thread Pranith Kumar
Alex Bennée writes: > This enables the multi-threaded system emulation by default for ARMv7 > and ARMv8 guests using the x86_64 TCG backend. This is because on the > guest side: > > - The ARM translate.c/translate-64.c have been converted to > - use MTTCG safe atomic primitives > - emit

<    1   2   3   4   >