[Qemu-devel] [PATCH 3/4] target/s390x: Implement EXECUTE via new TranslationBlock

2017-05-24 Thread Richard Henderson
Previously, helper_ex would construct the insn and then implement the insn via direct calls other helpers. This was sufficient to boot Linux but that is all. It is easy enough to go the whole nine yards by stashing state for EXECUTE within the cpu, and then rely on a new TB to be created that pro

Re: [Qemu-devel] [PATCH v2 0/2] Add global device ID in virt machine

2017-05-24 Thread Michael S. Tsirkin
On Tue, May 23, 2017 at 02:12:43PM +0300, Diana Craciun wrote: > The NXP DPAA2 is a hardware architecture designed for high-speeed network > packet processing. The DPAA2 hardware components are managed by a hardware > component called the Management Complex (or MC) which provides an > object-base a

Re: [Qemu-devel] [PATCH 1/5] target/sh4: log unauthorized accesses using qemu_log_mask

2017-05-24 Thread Richard Henderson
On 05/16/2017 03:47 PM, Aurelien Jarno wrote: qemu_log_mask() is preferred over fprintf() for logging errors. Signed-off-by: Aurelien Jarno --- target/sh4/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [Qemu-devel] [PATCH 3/5] target/sh4: introduce DELAY_SLOT_MASK

2017-05-24 Thread Richard Henderson
On 05/16/2017 03:47 PM, Aurelien Jarno wrote: This will make easier the introduction of a new flag in the next patches. Signed-off-by: Aurelien Jarno --- target/sh4/cpu.h | 3 ++- target/sh4/helper.c| 4 ++-- target/sh4/translate.c | 17 - 3 files changed, 12 ins

Re: [Qemu-devel] [PATCH 4/5] target/sh4: ignore interrupts in a delay slot

2017-05-24 Thread Richard Henderson
On 05/16/2017 03:47 PM, Aurelien Jarno wrote: Delay slots are indivisible, therefore avoid scheduling an interrupt in the delay slot. However exceptions are possible. Signed-off-by: Aurelien Jarno --- target/sh4/helper.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) Re

Re: [Qemu-devel] [PATCH 2/5] target/sh4: fix reset when using a kernel and an initrd

2017-05-24 Thread Richard Henderson
On 05/16/2017 03:47 PM, Aurelien Jarno wrote: When a masked exception happens, the SH4 CPU generates a non-masked reset exception, which then jumps to the reset vector at address 0xA000. While this is emulated correctly in QEMU, this does not work when using a kernel and initrd as this addres

Re: [Qemu-devel] [PATCH 5/5] target/sh4: fix RTE instruction delay slot

2017-05-24 Thread Richard Henderson
On 05/16/2017 03:47 PM, Aurelien Jarno wrote: The ReTurn from Exception (RTE) instruction loads the system register (SR) with the saved system register (SSR). It has a delay slot, and behaves specially according to the SH4 manual: The SR value accessed by the instruction in the RTE delay slot

Re: [Qemu-devel] [PATCH V6 07/10] migration: add bitmap for copied page

2017-05-24 Thread Peter Xu
On Wed, May 24, 2017 at 03:16:23PM +0300, Alexey Perevalov wrote: > On 05/24/2017 03:01 PM, Peter Xu wrote: > >On Wed, May 24, 2017 at 10:56:37AM +0300, Alexey wrote: > >>On Wed, May 24, 2017 at 02:57:36PM +0800, Peter Xu wrote: > >>>On Tue, May 23, 2017 at 02:31:08PM +0300, Alexey Perevalov wrote:

Re: [Qemu-devel] [PATCH] target/i386: use multiple CPU AddressSpaces

2017-05-24 Thread Richard Henderson
On 05/19/2017 02:16 AM, Paolo Bonzini wrote: This speeds up SMM switches. Later on it may remove the need to take the BQL, and it may also allow to reuse code between TCG and KVM. Signed-off-by: Paolo Bonzini --- target/i386/cpu.c| 15 +- target/i386/cpu.h| 11 +++

Re: [Qemu-devel] [PATCH] migration: keep bytes_xfer_prev init'd to zero

2017-05-24 Thread Peter Xu
On Wed, May 24, 2017 at 01:02:25PM +, Felipe Franciosi wrote: > > > On 23 May 2017, at 05:27, Peter Xu wrote: > > > > On Fri, May 19, 2017 at 10:59:02PM +0100, Felipe Franciosi wrote: > >> The first time migration_bitmap_sync() is called, bytes_xfer_prev is set > >> to ram_state.bytes_transf

Re: [Qemu-devel] [PATCH v2 0/4] 9pfs: local: fix metadata of mapped-file security mode

2017-05-24 Thread Leo Gaspard
On 05/24/2017 10:54 AM, Greg Kurz wrote: > On Wed, 24 May 2017 00:59:29 +0200 > Leo Gaspard wrote: > >> On 05/23/2017 04:32 PM, Greg Kurz wrote: >>> v2: - posted patch for CVE-2017-7493 separately >>> - other changes available in each patch changelog >>> >>> Leo, >>> >>> If you find time to t

Re: [Qemu-devel] [PATCH 2/4] migration: set dirty_pages_rate before autoconverge logic

2017-05-24 Thread Peter Xu
On Wed, May 24, 2017 at 05:10:01PM +0100, Felipe Franciosi wrote: > Currently, a "period" in the RAM migration logic is at least a second > long and accounts for what happened since the last period (or the > beginning of the migration). The dirty_pages_rate counter is calculated > at the end this l

Re: [Qemu-devel] [PATCH 3/4] migration: set bytes_xfer_* outside of autoconverge logic

2017-05-24 Thread Peter Xu
On Wed, May 24, 2017 at 05:10:02PM +0100, Felipe Franciosi wrote: > The bytes_xfer_now/prev counters are only used by the auto convergence > logic. However, they are used alongside the dirty_pages_rate counter, > which is calculated (and required) outside of this logic. The problem > with this appr

Re: [Qemu-devel] [PATCH v2 1/5] qemu-io: Don't die on second open

2017-05-24 Thread Fam Zheng
On Wed, 05/24 15:28, Eric Blake wrote: > Most callback commands in qemu-io return 0 to keep the interpreter > loop running, or 1 to quit immediately. However, open_f() just > passed through the return value of openfile(), which has different > semantics of returning 0 if a file was opened, or 1 on

Re: [Qemu-devel] [PATCH 1/4] migration: keep bytes_xfer_prev init'd to zero

2017-05-24 Thread Peter Xu
On Wed, May 24, 2017 at 05:10:00PM +0100, Felipe Franciosi wrote: > The first time migration_bitmap_sync() is called, bytes_xfer_prev is set > to ram_state.bytes_transferred which is, at this point, zero. The next > time migration_bitmap_sync() is called, an iteration has happened and > bytes_xfer_

Re: [Qemu-devel] [PATCH] migration: remove register_savevm()

2017-05-24 Thread David Gibson
On Wed, May 24, 2017 at 02:10:48PM +0200, Laurent Vivier wrote: > We can replace the four remaining calls of register_savevm() by > calls to register_savevm_live(). So we can remove the function and > as we don't allocate anymore the ops pointer with g_new0() > we don't have to free it then. > > S

Re: [Qemu-devel] [PATCH] xics: add unrealize handler

2017-05-24 Thread David Gibson
On Wed, May 24, 2017 at 07:40:43PM +0200, Greg Kurz wrote: > Now that ICPState objects get finalized on CPU unplug, we should unregister > reset handlers as well to avoid a QEMU crash at machine reset time. > > Signed-off-by: Greg Kurz Applied to ppc-for-2.10. > --- > hw/intc/xics.c |5

Re: [Qemu-devel] [PATCH v5 1/4] net/rocker: Remove the dead error handling

2017-05-24 Thread David Gibson
On Wed, 24 May 2017 08:01:47 -0400 (EDT) Marcel Apfelbaum wrote: > - Original Message - > > From: "Markus Armbruster" > > To: "Philippe Mathieu-Daudé" > > Cc: qemu-devel@nongnu.org, "Mao Zhongyi" , > > j...@resnulli.us, jasow...@redhat.com, "Michael > > S. Tsirkin" , "Marcel Apfelbaum"

Re: [Qemu-devel] [PATCH 4/4] migration: use dirty_rate_high_cnt more aggressively

2017-05-24 Thread Peter Xu
On Wed, May 24, 2017 at 05:10:03PM +0100, Felipe Franciosi wrote: > The commit message from 070afca25 suggests that dirty_rate_high_cnt > should be used more aggressively to start throttling after two > iterations instead of four. The code, however, only changes the auto > convergence behaviour to

Re: [Qemu-devel] [Qemu-ppc] [PATCH 3/4] spapr: disable hotplugging without OS

2017-05-24 Thread David Gibson
On Wed, May 24, 2017 at 12:40:37PM -0500, Michael Roth wrote: > Quoting Laurent Vivier (2017-05-24 11:02:30) > > On 24/05/2017 17:54, Greg Kurz wrote: > > > On Wed, 24 May 2017 12:14:02 +0200 > > > Igor Mammedov wrote: > > > > > >> On Wed, 24 May 2017 11:28:57 +0200 > > >> Greg Kurz wrote: > > >

Re: [Qemu-devel] [Qemu-ppc] [PATCH 3/4] spapr: disable hotplugging without OS

2017-05-24 Thread David Gibson
On Wed, May 24, 2017 at 12:14:02PM +0200, Igor Mammedov wrote: > On Wed, 24 May 2017 11:28:57 +0200 > Greg Kurz wrote: > > > On Wed, 24 May 2017 15:07:54 +1000 > > David Gibson wrote: > > > > > On Tue, May 23, 2017 at 01:18:11PM +0200, Laurent Vivier wrote: > > > > If the OS is not started, Q

Re: [Qemu-devel] [Qemu-ppc] [PATCH 3/4] spapr: disable hotplugging without OS

2017-05-24 Thread David Gibson
On Wed, May 24, 2017 at 11:28:57AM +0200, Greg Kurz wrote: > On Wed, 24 May 2017 15:07:54 +1000 > David Gibson wrote: > > > On Tue, May 23, 2017 at 01:18:11PM +0200, Laurent Vivier wrote: > > > If the OS is not started, QEMU sends an event to the OS > > > that is lost and cannot be recovered. An

[Qemu-devel] [PATCH] qtest: add rtc periodic timer test

2017-05-24 Thread guangrong . xiao
From: Xiao Guangrong It tests the accuracy of rtc periodic timer which is recently improved & fixed by: mc146818rtc: precisely count the clock for periodic timer (commit id has not been decided yet) Note: as qemu needs a precise timer to drive its rtc timer callbacks, that means clock=vm i

[Qemu-devel] [PULL 02/18] ppc/xics: simplify prototype of xics_spapr_init()

2017-05-24 Thread David Gibson
From: Greg Kurz This function only does hypercall and RTAS-call registration, and thus never returns an error. This patch adapt the prototype to reflect that. Signed-off-by: Greg Kurz Reviewed-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Gibson --- hw/intc/x

[Qemu-devel] [PULL 03/18] spapr: sanitize error handling in spapr_ics_create()

2017-05-24 Thread David Gibson
From: Greg Kurz The spapr_ics_create() function handles errors in a rather convoluted way, with two local Error * variables. Moreover, failing to parent the ICS object to the machine should be considered as a bug but it is currently ignored. This patch addresses both issues. Signed-off-by: Greg

[Qemu-devel] [PULL 01/18] target/ppc: reset reservation in do_rfi()

2017-05-24 Thread David Gibson
From: Nikunj A Dadhania For transitioning back to userspace after the interrupt. Suggested-by: Richard Henderson Signed-off-by: Nikunj A Dadhania Signed-off-by: David Gibson --- target/ppc/excp_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/ppc/excp_helper.c b/target/

[Qemu-devel] [PULL 04/18] spapr-cpu-core: release ICP object when realization fails

2017-05-24 Thread David Gibson
From: Greg Kurz While here we introduce a single error path to avoid code duplication. Signed-off-by: Greg Kurz Signed-off-by: David Gibson --- hw/ppc/spapr_cpu_core.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_c

[Qemu-devel] [PULL 00/18] ppc-for-2.10 queue 20170525

2017-05-24 Thread David Gibson
The following changes since commit 9964e96dccf7f7c936ee854a795415d19b60: Merge remote-tracking branch 'jasowang/tags/net-pull-request' into staging (2017-05-23 15:01:31 +0100) are available in the git repository at: git://github.com/dgibson/qemu.git tags/ppc-for-2.10-20170525 for you t

[Qemu-devel] [PULL 05/18] spapr: Consolidate HPT freeing code into a routine

2017-05-24 Thread David Gibson
From: Bharata B Rao Consolidate the code that frees HPT into a separate routine spapr_free_hpt() as the same chunk of code is called from two places. Signed-off-by: Bharata B Rao Signed-off-by: David Gibson --- hw/ppc/spapr.c | 13 + hw/ppc/spapr_hcall.c | 5 + incl

[Qemu-devel] [PULL 08/18] hw/ppc/spapr_events.c: removing 'exception' from sPAPREventLogEntry

2017-05-24 Thread David Gibson
From: Daniel Henrique Barboza Currenty we do not have any RTAS event that is reported by the event-scan interface. The existing events, RTAS_LOG_TYPE_EPOW and RTAS_LOG_TYPE_HOTPLUG, are being reported by the check-exception interface and, as such, marked as 'exception=true'. Commit 79853e18d9, '

[Qemu-devel] [PULL 06/18] xics_kvm: cache already enabled vCPU ids

2017-05-24 Thread David Gibson
From: Greg Kurz Since commit a45863bda90d ("xics_kvm: Don't enable KVM_CAP_IRQ_XICS if already enabled"), we were able to re-hotplug a vCPU that had been hot- unplugged ealier, thanks to a boolean flag in ICPState that we set when enabling KVM_CAP_IRQ_XICS. This could work because the lifecycle

[Qemu-devel] [PULL 07/18] spapr: ensure core_slot isn't NULL in spapr_core_unplug()

2017-05-24 Thread David Gibson
From: Greg Kurz If we go that far on the path of hot-removing a core and we find out that the core-id is invalid, then we have a serious bug. Let's make it explicit with an assert() instead of dereferencing a NULL pointer. This fixes Coverity issue CID 1375404. Signed-off-by: Greg Kurz Review

[Qemu-devel] [PULL 11/18] pseries: Split CAS PVR negotiation out into a separate function

2017-05-24 Thread David Gibson
Guests of the qemu machine type go through a feature negotiation process known as "client architecture support" (CAS) during early boot. This does a number of things, one of which is finding a CPU compatibility mode which can be supported by both guest and host. In fact the CPU negotiation is pro

[Qemu-devel] [PULL 12/18] pseries: Restore support for total vcpus not a multiple of threads-per-core for old machine types

2017-05-24 Thread David Gibson
As of pseries-2.7 and later, we require the total number of guest vcpus to be a multiple of the threads-per-core. pseries-2.6 and earlier machine types, however, are supposed to allow this for the sake of migration from old qemu versions which allowed this. Unfortunately, 8149e29 "pseries: Enforc

[Qemu-devel] [PULL 10/18] spapr: fix error reporting in xics_system_init()

2017-05-24 Thread David Gibson
From: Greg Kurz If the user explicitely asked for kernel-irqchip support and "xics-kvm" initialization fails, we shouldn't fallback to emulated "xics" as we do now. It is also awkward to print an error message when we have an errp pointer argument. Let's use the errp argument to report the error

[Qemu-devel] [PULL 09/18] spapr_cpu_core: drop reference on ICP object during CPU realization

2017-05-24 Thread David Gibson
From: Greg Kurz When a piece of code allocates an object, it implicitely gets a reference on it. If it then makes that object a child property of another object, it should drop its own reference at some point otherwise the child object can never be finalized. The current code hence leaks one ICP

[Qemu-devel] [PULL 15/18] hw/ppc: removing drc->detach_cb and drc->detach_cb_opaque

2017-05-24 Thread David Gibson
From: Daniel Henrique Barboza The pointer drc->detach_cb is being used as a way of informing the detach() function inside spapr_drc.c which cb to execute. This information can also be retrieved simply by checking drc->type and choosing the right callback based on it. In this context, detach_cb is

[Qemu-devel] [PULL 18/18] xics: add unrealize handler

2017-05-24 Thread David Gibson
From: Greg Kurz Now that ICPState objects get finalized on CPU unplug, we should unregister reset handlers as well to avoid a QEMU crash at machine reset time. Signed-off-by: Greg Kurz Signed-off-by: David Gibson --- hw/intc/xics.c | 5 + hw/intc/xics_kvm.c | 6 ++ 2 files changed

[Qemu-devel] [PULL 13/18] spapr: add pre_plug function for memory

2017-05-24 Thread David Gibson
From: Laurent Vivier This allows to manage errors before the memory has started to be hotplugged. We already have the function for the CPU cores. Signed-off-by: Laurent Vivier Reviewed-by: Greg Kurz [dwg: Fixed a couple of style nits] Signed-off-by: David Gibson --- hw/ppc/spapr.c | 41 +

[Qemu-devel] [PULL 14/18] hw/ppc/spapr.c: adding pending_dimm_unplugs to sPAPRMachineState

2017-05-24 Thread David Gibson
The LMB DRC release callback, spapr_lmb_release(), uses an opaque parameter, a sPAPRDIMMState struct that stores the current LMBs that are allocated to a DIMM (nr_lmbs). After each call to this callback, the nr_lmbs is decremented by one and, when it reaches zero, the callback proceeds with the qde

[Qemu-devel] [PULL 17/18] hw/ppc/spapr.c: recover pending LMB unplug info in spapr_lmb_release

2017-05-24 Thread David Gibson
From: Daniel Henrique Barboza When a LMB hot unplug starts, the current DRC LMB status is stored at spapr->pending_dimm_unplugs QTAILQ. This queue isn't migrated, thus if a migration occurs in the middle of a LMB unplug the spapr_lmb_release callback will lost track of the LMB unplug progress. T

[Qemu-devel] [PULL 16/18] hw/ppc: migrating the DRC state of hotplugged devices

2017-05-24 Thread David Gibson
From: Daniel Henrique Barboza In pseries, a firmware abstraction called Dynamic Reconfiguration Connector (DRC) is used to assign a particular dynamic resource to the guest and provide an interface to manage configuration/removal of the resource associated with it. In other words, DRC is the 'plu

[Qemu-devel] Behavior of QMP "query-block"

2017-05-24 Thread Bruno Alvisio
Hello all, Summary I am using XEN hypervisor to run a HVM with a QEMU backed disk. After I start the HVM I use QMP "query-block" command to see the devices of the VM. Initially the command returns the disk that I set as part of the configuration. After a few seconds the a DEVICE_DELETE event occu

Re: [Qemu-devel] [PATCH V5 2/9] net/filter-mirror.c: Make filter mirror support vnet support.

2017-05-24 Thread Jason Wang
On 2017年05月23日 22:20, Zhang Chen wrote: We add the vnet_hdr option for filter-mirror, default is disable. If you use virtio-net-pci net driver, please enable it. You can use it for example: -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0,vnet_hdr=on If vnet_hdr=on we change the

Re: [Qemu-devel] [PATCH V5 3/9] net/filter-mirror.c: Add new option to enable vnet support for filter-redirector

2017-05-24 Thread Jason Wang
On 2017年05月23日 22:20, Zhang Chen wrote: We add the vnet_hdr option for filter-redirector, default is disable. If you use virtio-net-pci net driver, please enable it. Because colo-compare or other modules needs the vnet_hdr_len to parse packet, so we add this new option send the len to others. Y

Re: [Qemu-devel] [PATCH v2 2/5] block: Guarantee that *file is set on bdrv_get_block_status()

2017-05-24 Thread Fam Zheng
On Wed, 05/24 15:28, Eric Blake wrote: > We document that *file is valid if the return is not an error and > includes BDRV_BLOCK_OFFSET_VALID, but forgot to obey this contract > when a driver (such as blkdebug) lacks a callback. Broken in > commit 67a0fd2 (v2.6), when we added the file parameter.

Re: [Qemu-devel] [PATCH V5 6/9] net/colo-compare.c: Make colo-compare support vnet_hdr_len

2017-05-24 Thread Jason Wang
On 2017年05月23日 22:20, Zhang Chen wrote: We add the vnet_hdr option for colo-compare, default is disable. If you use virtio-net-pci net driver, please enable it. You can use it for example: -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,vnet_hdr=on

Re: [Qemu-devel] [PATCH V6 07/10] migration: add bitmap for copied page

2017-05-24 Thread Alexey Perevalov
On 05/25/2017 02:30 AM, Peter Xu wrote: On Wed, May 24, 2017 at 03:16:23PM +0300, Alexey Perevalov wrote: On 05/24/2017 03:01 PM, Peter Xu wrote: On Wed, May 24, 2017 at 10:56:37AM +0300, Alexey wrote: On Wed, May 24, 2017 at 02:57:36PM +0800, Peter Xu wrote: On Tue, May 23, 2017 at 02:31:08P

Re: [Qemu-devel] [PATCH v2 3/5] block: Allow NULL file for bdrv_get_block_status()

2017-05-24 Thread Fam Zheng
On Wed, 05/24 15:28, Eric Blake wrote: > Not all callers care about which BDS owns the mapping for a given > range of the file. This patch merely simplifies the callers by > consolidating the logic in the common call point, while guaranteeing > a non-NULL file to all the driver callbacks, for no s

Re: [Qemu-devel] [PATCH v2 4/5] block: Simplify use of BDRV_BLOCK_RAW

2017-05-24 Thread Fam Zheng
On Wed, 05/24 15:28, Eric Blake wrote: > The lone caller that cares about a return of BDRV_BLOCK_RAW > (namely, io.c:bdrv_co_get_block_status) completely replaces the > return value, so there is no point in passing BDRV_BLOCK_DATA. > > Signed-off-by: Eric Blake > > --- > v2: fix subject, tweak c

Re: [Qemu-devel] [PATCH v2 5/5] blkdebug: Support .bdrv_co_get_block_status

2017-05-24 Thread Fam Zheng
On Wed, 05/24 15:28, Eric Blake wrote: > Without a passthrough status of BDRV_BLOCK_RAW, anything wrapped by > blkdebug appears 100% allocated as data. Better is treating it the > same as the underlying file being wrapped. > > Update iotest 177 for the new expected output. > > Signed-off-by: Eri

Re: [Qemu-devel] [PATCH] Fix nmi injection failure when vcpu got blocked

2017-05-24 Thread Zhuangyanying
> -Original Message- > From: Radim Krčmář [mailto:rkrc...@redhat.com] > Sent: Wednesday, May 24, 2017 10:34 PM > To: Zhuangyanying > Cc: pbonz...@redhat.com; Herongguang (Stephen); qemu-devel@nongnu.org; > Gonglei (Arei); Zhangbo (Oscar); k...@vger.kernel.org > Subject: Re: [PATCH] Fix nmi

[Qemu-devel] [PATCH v2] KVM: x86: Fix nmi injection failure when vcpu got blocked

2017-05-24 Thread Zhuangyanying
From: ZhuangYanying When spin_lock_irqsave() deadlock occurs inside the guest, vcpu threads, other than the lock-holding one, would enter into S state because of pvspinlock. Then inject NMI via libvirt API "inject-nmi", the NMI could not be injected into vm. The reason is: 1 It sets nmi_queued t

<    1   2   3