Re: [PATCH v4 28/33] nvdimm acpi: support DSM_FUN_IMPLEMENTED function

2015-10-21 Thread Xiao Guangrong
On 10/21/2015 06:49 PM, Stefan Hajnoczi wrote: On Wed, Oct 21, 2015 at 12:26:35AM +0800, Xiao Guangrong wrote: On 10/20/2015 11:51 PM, Stefan Hajnoczi wrote: On Mon, Oct 19, 2015 at 08:54:14AM +0800, Xiao Guangrong wrote: +exit: +/* Write our output result to dsm memory. */ +

Re: [GIT PULL 3/6] KVM: arm: use GIC support unconditionally

2015-10-21 Thread Arnd Bergmann
On Tuesday 20 October 2015 15:51:05 Paolo Bonzini wrote: > Should this be "select" or "depends on"? Not a blocker, can always be fixed > in 4.4. We have lots of 'select ARM_GIC' in the tree for platforms that use one, using 'depends on' will limit KVM support to being available only if at least

Re: [GIT PULL 3/6] KVM: arm: use GIC support unconditionally

2015-10-21 Thread Christoffer Dall
On Wed, Oct 21, 2015 at 03:45:20PM +0200, Arnd Bergmann wrote: > On Tuesday 20 October 2015 15:51:05 Paolo Bonzini wrote: > > Should this be "select" or "depends on"? Not a blocker, can always be fixed > > in 4.4. > > We have lots of 'select ARM_GIC' in the tree for platforms that use one, using

RE: [GIT PULL 3/6] KVM: arm: use GIC support unconditionally

2015-10-21 Thread Pavel Fedin
Hello! > The only platform I can think of that uses ARMv7ve without actually having > a GIC is BCM2836 (Raspberry Pi 2). Can we actually run KVM on a platform > like that? We can, with two limitations: 1. GIC has to be emulated in software. I have recently fixed support for this. The only

[PATCH net-next RFC 2/2] vhost_net: basic polling support

2015-10-21 Thread Jason Wang
This patch tries to poll for new added tx buffer for a while at the end of tx processing. The maximum time spent on polling were limited through a module parameter. To avoid block rx, the loop will end it there's new other works queued on vhost so in fact socket receive queue is also be polled.

[PATCH net-next RFC 1/2] vhost: introduce vhost_has_work()

2015-10-21 Thread Jason Wang
This path introduces a helper which can give a hint for whether or not there's a work queued in the work list. Signed-off-by: Jason Wang --- drivers/vhost/vhost.c | 6 ++ drivers/vhost/vhost.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/vhost/vhost.c

[RFC Patch 11/12] IXGBEVF: Migrate VF statistic data

2015-10-21 Thread Lan Tianyu
VF statistic regs are read-only and can't be migrated via writing back directly. Currently, statistic data returned to user space by the driver is not equal to value of statistic regs. VF driver records value of statistic regs as base data when net interface is up or open, calculate increased

[RFC Patch 01/12] PCI: Add virtfn_index for struct pci_device

2015-10-21 Thread Lan Tianyu
Add "virtfn_index" member in the struct pci_device to record VF sequence of PF. This will be used in the VF sysfs node handle. Signed-off-by: Lan Tianyu --- drivers/pci/iov.c | 1 + include/linux/pci.h | 1 + 2 files changed, 2 insertions(+) diff --git

Re: [GIT PULL 0/6] A handful of fixes for KVM/ARM for v4.3-rc7

2015-10-21 Thread Paolo Bonzini
On 20/10/2015 18:19, Christoffer Dall wrote: > Hi Paolo, > > The following changes since commit 920552b213e3dc832a874b4e7ba29ecddbab31bc: > > KVM: disable halt_poll_ns as default for s390x (2015-09-25 10:31:30 +0200) > > are available in the git repository at: > >

[RFC Patch 00/12] IXGBE: Add live migration support for SRIOV NIC

2015-10-21 Thread Lan Tianyu
This patchset is to propose a new solution to add live migration support for 82599 SRIOV network card. Im our solution, we prefer to put all device specific operation into VF and PF driver and make code in the Qemu more general. VF status migration

[RFC Patch 08/12] IXGBEVF: Rework code of finding the end transmit desc of package

2015-10-21 Thread Lan Tianyu
When transmit a package, the end transmit desc of package indicates whether package is sent already. Current code records the end desc's pointer in the next_to_watch of struct tx buffer. This code will be broken if shifting desc ring after migration. The pointer will be invalid. This patch is to

[RFC Patch 09/12] IXGBEVF: Add live migration support for VF driver

2015-10-21 Thread Lan Tianyu
To let VF driver in the guest to know migration status, Qemu will fake PCI configure reg 0xF0 and 0xF1 to show migrate status and get ack from VF driver. When migration starts, Qemu will set reg "0xF0" to 1, notify VF driver via triggering mail box msg and wait for VF driver to tell it's ready

[RFC Patch 04/12] IXGBE: Add ixgbe_ping_vf() to notify a specified VF via mailbox msg.

2015-10-21 Thread Lan Tianyu
This patch is to add ixgbe_ping_vf() to notify a specified VF. When migration status is changed, it's necessary to notify VF the change. VF driver will check the migrate status when it gets mailbox msg. Signed-off-by: Lan Tianyu ---

[RFC Patch 07/12] IXGBEVF: Add new mail box event for migration

2015-10-21 Thread Lan Tianyu
VF status in the PF driver needs to be restored after migration and reset VF hardware. This patch is to add a new event for VF driver to notify PF driver to restore status. Signed-off-by: Lan Tianyu --- drivers/net/ethernet/intel/ixgbevf/mbx.h | 3 +++

[RFC PATCH 1/3] Qemu: Add pci-assign.h to share functions and struct definition with new file

2015-10-21 Thread Lan Tianyu
Signed-off-by: Lan Tianyu --- hw/i386/kvm/pci-assign.c | 111 ++- hw/i386/kvm/pci-assign.h | 109 ++ 2 files changed, 112 insertions(+), 108 deletions(-) create mode 100644

[RFC PATCH 0/3] Qemu/IXGBE: Add live migration support for SRIOV NIC

2015-10-21 Thread Lan Tianyu
This patchset is Qemu part for live migration support for SRIOV NIC. kernel part patch information is in the following link. http://marc.info/?l=kvm=144544635330193=2 Lan Tianyu (3): Qemu: Add pci-assign.h to share functions and struct definition with new file Qemu: Add post_load_state()

[RFC Patch 06/12] IXGBEVF: Add self emulation layer

2015-10-21 Thread Lan Tianyu
In order to restore VF function after migration, add self emulation layer to record regs' values during accessing regs. Signed-off-by: Lan Tianyu --- drivers/net/ethernet/intel/ixgbevf/Makefile| 3 ++- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +-

[RFC PATCH 2/3] Qemu: Add post_load_state() to run after restoring CPU state

2015-10-21 Thread Lan Tianyu
After migration, Qemu needs to trigger mailbox irq to notify VF driver in the guest about status change. The irq delivery restarts to work after restoring CPU state. This patch is to add new callback to run after restoring CPU state and provide a way to trigger mailbox irq later. Signed-off-by:

[RFC Patch 10/12] IXGBEVF: Add lock to protect tx/rx ring operation

2015-10-21 Thread Lan Tianyu
Ring shifting during restoring VF function maybe race with original ring operation(transmit/receive package). This patch is to add tx/rx lock to protect ring related data. Signed-off-by: Lan Tianyu --- drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 2 ++

[RFC Patch 12/12] IXGBEVF: Track dma dirty pages

2015-10-21 Thread Lan Tianyu
Migration relies on tracking dirty page to migrate memory. Hardware can't automatically mark a page as dirty after DMA memory access. VF descriptor rings and data buffers are modified by hardware when receive and transmit data. To track such dirty memory manually, do dummy writes(read a byte and

[RFC Patch 02/12] IXGBE: Add new mail box event to restore VF status in the PF driver

2015-10-21 Thread Lan Tianyu
This patch is to restore VF status in the PF driver when get event from VF. Signed-off-by: Lan Tianyu --- drivers/net/ethernet/intel/ixgbe/ixgbe.h | 1 + drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h | 1 + drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 40

[RFC Patch 03/12] IXGBE: Add sysfs interface for Qemu to migrate VF status in the PF driver

2015-10-21 Thread Lan Tianyu
This patch is to add sysfs interface state_in_pf under sysfs directory of VF PCI device for Qemu to get and put VF status in the PF driver during migration. Signed-off-by: Lan Tianyu --- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 156 - 1 file

Re: [GIT PULL 3/6] KVM: arm: use GIC support unconditionally

2015-10-21 Thread Arnd Bergmann
On Wednesday 21 October 2015 15:58:44 Christoffer Dall wrote: > On Wed, Oct 21, 2015 at 03:45:20PM +0200, Arnd Bergmann wrote: > > On Tuesday 20 October 2015 15:51:05 Paolo Bonzini wrote: > > > Should this be "select" or "depends on"? Not a blocker, can always be > > > fixed in 4.4. > > > > We

Re: sanitizing kvmtool

2015-10-21 Thread Sasha Levin
On 10/19/2015 11:15 AM, Dmitry Vyukov wrote: > On Mon, Oct 19, 2015 at 5:08 PM, Sasha Levin wrote: >> > On 10/19/2015 10:47 AM, Dmitry Vyukov wrote: >>> Right, the memory areas that are accessed both by the hypervisor and >>> the guest > >>> > should be

Re: Difference between vcpu_load and kvm_sched_in ?

2015-10-21 Thread Yacine HEBBAL
Paolo Bonzini redhat.com> writes: > > > On 21/10/2015 12:17, Hebbal Yacine wrote: > > Thanks for the explanation, it's very clear. > > I tired that but I didn't succeed to send the ioctl from "run_on_cpu" > > function, I didn't find how to set the right CPUStat > > I've tried "current_cpu" >

Re: [RFC Patch 01/12] PCI: Add virtfn_index for struct pci_device

2015-10-21 Thread Alexander Duyck
On 10/21/2015 09:37 AM, Lan Tianyu wrote: Add "virtfn_index" member in the struct pci_device to record VF sequence of PF. This will be used in the VF sysfs node handle. Signed-off-by: Lan Tianyu --- drivers/pci/iov.c | 1 + include/linux/pci.h | 1 + 2 files

Re: [RFC PATCH 0/3] Qemu/IXGBE: Add live migration support for SRIOV NIC

2015-10-21 Thread Alex Williamson
On Thu, 2015-10-22 at 00:52 +0800, Lan Tianyu wrote: > This patchset is Qemu part for live migration support for SRIOV NIC. > kernel part patch information is in the following link. > http://marc.info/?l=kvm=144544635330193=2 > > > Lan Tianyu (3): > Qemu: Add pci-assign.h to share functions

Re: [RFC Patch 00/12] IXGBE: Add live migration support for SRIOV NIC

2015-10-21 Thread Or Gerlitz
On Wed, Oct 21, 2015 at 7:37 PM, Lan Tianyu wrote: > This patchset is to propose a new solution to add live migration support > for 82599 SRIOV network card. > In our solution, we prefer to put all device specific operation into VF and > PF driver and make code in the Qemu

Re: [RFC Patch 00/12] IXGBE: Add live migration support for SRIOV NIC

2015-10-21 Thread Alex Williamson
On Wed, 2015-10-21 at 21:45 +0300, Or Gerlitz wrote: > On Wed, Oct 21, 2015 at 7:37 PM, Lan Tianyu wrote: > > This patchset is to propose a new solution to add live migration support > > for 82599 SRIOV network card. > > > In our solution, we prefer to put all device

Re: [RFC Patch 03/12] IXGBE: Add sysfs interface for Qemu to migrate VF status in the PF driver

2015-10-21 Thread Alexander Duyck
On 10/21/2015 09:37 AM, Lan Tianyu wrote: This patch is to add sysfs interface state_in_pf under sysfs directory of VF PCI device for Qemu to get and put VF status in the PF driver during migration. Signed-off-by: Lan Tianyu ---

Re: [RFC Patch 05/12] IXGBE: Add new sysfs interface of "notify_vf"

2015-10-21 Thread Alexander Duyck
On 10/21/2015 09:37 AM, Lan Tianyu wrote: This patch is to add new sysfs interface of "notify_vf" under sysfs directory of VF PCI device for Qemu to notify VF when migration status is changed. Signed-off-by: Lan Tianyu --- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c

Re: [RFC Patch 06/12] IXGBEVF: Add self emulation layer

2015-10-21 Thread Alexander Duyck
On 10/21/2015 09:37 AM, Lan Tianyu wrote: In order to restore VF function after migration, add self emulation layer to record regs' values during accessing regs. Signed-off-by: Lan Tianyu --- drivers/net/ethernet/intel/ixgbevf/Makefile| 3 ++-

Re: [RFC Patch 02/12] IXGBE: Add new mail box event to restore VF status in the PF driver

2015-10-21 Thread Alexander Duyck
On 10/21/2015 09:37 AM, Lan Tianyu wrote: This patch is to restore VF status in the PF driver when get event from VF. Signed-off-by: Lan Tianyu --- drivers/net/ethernet/intel/ixgbe/ixgbe.h | 1 + drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h | 1 +

[GIT PULL 0/5] perf/core improvements and fixes

2015-10-21 Thread Arnaldo Carvalho de Melo
Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 43e41adc9e8c36545888d78fed2ef8d102a938dc: perf record: Add ability to sample call branches (2015-10-20 10:30:55 +0200) are available in the git repository at:

[PATCH 2/5] tools lib traceevent: update KVM plugin

2015-10-21 Thread Arnaldo Carvalho de Melo
From: Paolo Bonzini The format of the role word has changed through the years and the plugin was never updated; some VMX exit reasons were missing too. Signed-off-by: Paolo Bonzini Acked-by: Steven Rostedt Cc: David Ahern

Re: [RFC Patch 08/12] IXGBEVF: Rework code of finding the end transmit desc of package

2015-10-21 Thread Alexander Duyck
On 10/21/2015 09:37 AM, Lan Tianyu wrote: When transmit a package, the end transmit desc of package indicates whether package is sent already. Current code records the end desc's pointer in the next_to_watch of struct tx buffer. This code will be broken if shifting desc ring after migration. The

Re: [RFC Patch 09/12] IXGBEVF: Add live migration support for VF driver

2015-10-21 Thread Alexander Duyck
On 10/21/2015 09:37 AM, Lan Tianyu wrote: To let VF driver in the guest to know migration status, Qemu will fake PCI configure reg 0xF0 and 0xF1 to show migrate status and get ack from VF driver. When migration starts, Qemu will set reg "0xF0" to 1, notify VF driver via triggering mail box msg

Re: [RFC Patch 10/12] IXGBEVF: Add lock to protect tx/rx ring operation

2015-10-21 Thread Alexander Duyck
On 10/21/2015 09:37 AM, Lan Tianyu wrote: Ring shifting during restoring VF function maybe race with original ring operation(transmit/receive package). This patch is to add tx/rx lock to protect ring related data. Signed-off-by: Lan Tianyu ---

Re: [RFC Patch 00/12] IXGBE: Add live migration support for SRIOV NIC

2015-10-21 Thread Alexander Duyck
On 10/21/2015 12:20 PM, Alex Williamson wrote: On Wed, 2015-10-21 at 21:45 +0300, Or Gerlitz wrote: On Wed, Oct 21, 2015 at 7:37 PM, Lan Tianyu wrote: This patchset is to propose a new solution to add live migration support for 82599 SRIOV network card. In our

Clarification on KVM + vhost-net

2015-10-21 Thread Roland Dreier
Hi, I would like to invoke QEMU and KVM so that the guest sees a virtio NIC, and that NIC goes through a SR-IOV VF of a host NIC as directly and efficiently as possible. But I don't actually want to pass the VF through to the guest. I've found a bunch of discussion and confusing examples on the

Re: [GIT PULL 3/6] KVM: arm: use GIC support unconditionally

2015-10-21 Thread Christoffer Dall
On Tue, Oct 20, 2015 at 03:51:05PM -0400, Paolo Bonzini wrote: > Should this be "select" or "depends on"? Not a blocker, can always be fixed > in 4.4. > Hmm, I don't know actually. I trusted Arnd to make the right call and given Marc's ack as well, I didn't pay too much attention to that

Re: [PATCH v3 07/20] KVM: ARM64: PMU: Add perf event map and introduce perf event creating function

2015-10-21 Thread Shannon Zhao
On 2015/10/16 14:08, Wei Huang wrote: >> +/** >> > + * kvm_pmu_get_counter_value - get PMU counter value >> > + * @vcpu: The vcpu pointer >> > + * @select_idx: The counter index >> > + */ >> > +unsigned long kvm_pmu_get_counter_value(struct kvm_vcpu *vcpu, u32 >> > select_idx) >> > +{ >> > +

Re: Difference between vcpu_load and kvm_sched_in ?

2015-10-21 Thread Paolo Bonzini
On 21/10/2015 00:57, Wanpeng Li wrote: >> kvm_sched_out and kvm_sched_in are part of KVM's preemption hooks. The >> hooks are registered only between vcpu_load and vcpu_put, therefore they >> know that the mutex is taken. The sequence will go like this: >> >> vcpu_load >>

Re: [PATCH v3 10/20] KVM: ARM64: Add reset and access handlers for PMCCNTR register

2015-10-21 Thread Shannon Zhao
On 2015/10/16 23:06, Wei Huang wrote: > > > On 09/24/2015 05:31 PM, Shannon Zhao wrote: >> Since the reset value of PMCCNTR is UNKNOWN, use reset_unknown for its >> reset handler. Add a new case to emulate reading to PMCCNTR register. >> >> Signed-off-by: Shannon Zhao

Re: [PATCH v3 15/20] KVM: ARM64: Add reset and access handlers for PMSWINC register

2015-10-21 Thread Shannon Zhao
On 2015/10/16 23:25, Wei Huang wrote: >> /** >> > + * kvm_pmu_software_increment - do software increment >> > + * @vcpu: The vcpu pointer >> > + * @val: the value guest writes to PMSWINC register >> > + */ >> > +void kvm_pmu_software_increment(struct kvm_vcpu *vcpu, u32 val) >> > +{ >> > + int

Re: Difference between vcpu_load and kvm_sched_in ?

2015-10-21 Thread Yacine HEBBAL
Paolo Bonzini redhat.com> writes: > > > On 21/10/2015 00:57, Wanpeng Li wrote: > >> kvm_sched_out and kvm_sched_in are part of KVM's preemption hooks. The > >> hooks are registered only between vcpu_load and vcpu_put, therefore they > >> know that the mutex is taken. The sequence will go

Re: Difference between vcpu_load and kvm_sched_in ?

2015-10-21 Thread Paolo Bonzini
On 21/10/2015 12:17, Hebbal Yacine wrote: > Thanks for the explanation, it's very clear. > I tired that but I didn't succeed to send the ioctl from "run_on_cpu" > function, I didn't find how to set the right CPUStat > I've tried "current_cpu" Current_cpu is always NULL outside the VCPU thread.

Re: [PATCH v4 28/33] nvdimm acpi: support DSM_FUN_IMPLEMENTED function

2015-10-21 Thread Stefan Hajnoczi
On Wed, Oct 21, 2015 at 12:26:35AM +0800, Xiao Guangrong wrote: > > > On 10/20/2015 11:51 PM, Stefan Hajnoczi wrote: > >On Mon, Oct 19, 2015 at 08:54:14AM +0800, Xiao Guangrong wrote: > >>+exit: > >>+/* Write our output result to dsm memory. */ > >>+((dsm_out *)dsm_ram_addr)->len =

RE: [PATCH v3 13/16] KVM: arm64: sync LPI configuration and pending tables

2015-10-21 Thread Pavel Fedin
Hello! > -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf > Of Andre Przywara > Sent: Wednesday, October 07, 2015 5:55 PM > To: marc.zyng...@arm.com; christoffer.d...@linaro.org > Cc: eric.au...@linaro.org; p.fe...@samsung.com;

[PATCH] KVM: x86: fix eflags state following processor init/reset

2015-10-21 Thread Wanpeng Li
Reference SDM 3.4.3: Following initialization of the processor (either by asserting the RESET pin or the INIT pin), the state of the EFLAGS register is 0002H. However, the eflags fixed bit is not set and other bits are also not cleared during the init/reset in kvm. This patch fix it by

Re: [PATCH v3 04/20] KVM: ARM64: Add reset and access handlers for PMCR_EL0 register

2015-10-21 Thread Shannon Zhao
On 2015/10/16 13:35, Wei Huang wrote: > > On 09/24/2015 05:31 PM, Shannon Zhao wrote: >> > Add reset handler which gets host value of PMCR_EL0 and make writable >> > bits architecturally UNKNOWN. Add a common access handler for PMU >> > registers which emulates writing and reading register and

Re: [PATCH v3 00/20] KVM: ARM64: Add guest PMU support

2015-10-21 Thread Shannon Zhao
On 2015/10/17 1:01, Christopher Covington wrote: > On 10/16/2015 12:55 AM, Wei Huang wrote: >> > >> > >> > On 09/24/2015 05:31 PM, Shannon Zhao wrote: >>> >> This patchset adds guest PMU support for KVM on ARM64. It takes >>> >> trap-and-emulate approach. When guest wants to monitor one event,