Re: [PATCH v4 18/21] KVM: ARM64: Add PMU overflow interrupt routing

2015-12-02 Thread Christoffer Dall
On Wed, Dec 02, 2015 at 10:22:04AM +, Marc Zyngier wrote: > On 02/12/15 09:49, Shannon Zhao wrote: > > > > > > On 2015/12/2 16:45, Marc Zyngier wrote: > >> On 02/12/15 02:40, Shannon Zhao wrote: > > > On 2015/12/2 0:57, Marc Zyngier wrote: > >> On 01/12/15 16:26, Shannon

Re: [PATCH v2 19/21] arm64: KVM: Turn system register numbers to an enum

2015-12-02 Thread Marc Zyngier
On 02/12/15 11:51, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:50:13PM +, Marc Zyngier wrote: >> Having the system register numbers as #defines has been a pain >> since day one, as the ordering is pretty fragile, and moving >> things around leads to renumbering and epic conflict

Re: [PATCH v2 10/21] arm64: KVM: Add patchable function selector

2015-12-02 Thread Christoffer Dall
On Wed, Dec 02, 2015 at 01:19:22PM +, Marc Zyngier wrote: > On 02/12/15 11:53, Christoffer Dall wrote: > > On Wed, Dec 02, 2015 at 09:47:43AM +, Marc Zyngier wrote: > >> On 02/12/15 09:27, Christoffer Dall wrote: > >>> On Tue, Dec 01, 2015 at 06:51:00PM +, Marc Zyngier wrote: > On

Re: [PATCH v2 16/21] arm64: KVM: Add compatibility aliases

2015-12-02 Thread Marc Zyngier
On 02/12/15 11:49, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:50:10PM +, Marc Zyngier wrote: >> So far, we've implemented the new world switch with a completely >> different namespace, so that we could have both implementation >> compiled in. >> >> Let's take things one step further

Re: [PATCH v2 12/21] arm64: KVM: Implement fpsimd save/restore

2015-12-02 Thread Marc Zyngier
On 02/12/15 11:53, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:50:06PM +, Marc Zyngier wrote: >> Implement the fpsimd save restore, keeping the lazy part in >> assembler (as returning to C would be overkill). >> >> Signed-off-by: Marc Zyngier >> --- >>

Re: [PATCH v2 21/21] arm64: KVM: Remove weak attributes

2015-12-02 Thread Marc Zyngier
On 02/12/15 11:47, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:50:15PM +, Marc Zyngier wrote: >> As we've now switched to the new world switch implementation, >> remove the weak attributes, as nobody is supposed to override >> it anymore. > > Why not remove the aliases and change the

Re: [PATCH v2 21/21] arm64: KVM: Remove weak attributes

2015-12-02 Thread Christoffer Dall
On Wed, Dec 02, 2015 at 03:21:49PM +, Marc Zyngier wrote: > On 02/12/15 11:47, Christoffer Dall wrote: > > On Fri, Nov 27, 2015 at 06:50:15PM +, Marc Zyngier wrote: > >> As we've now switched to the new world switch implementation, > >> remove the weak attributes, as nobody is supposed to

Re: [PATCH v2 12/21] arm64: KVM: Implement fpsimd save/restore

2015-12-02 Thread Christoffer Dall
On Wed, Dec 02, 2015 at 03:29:50PM +, Marc Zyngier wrote: > On 02/12/15 11:53, Christoffer Dall wrote: > > On Fri, Nov 27, 2015 at 06:50:06PM +, Marc Zyngier wrote: > >> Implement the fpsimd save restore, keeping the lazy part in > >> assembler (as returning to C would be overkill). > >> >

Re: [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC

2015-12-02 Thread Michael S. Tsirkin
On Wed, Dec 02, 2015 at 10:08:25PM +0800, Lan, Tianyu wrote: > On 12/1/2015 11:02 PM, Michael S. Tsirkin wrote: > >>But > >>it requires guest OS to do specific configurations inside and rely on > >>bonding driver which blocks it work on Windows. > >> From performance side, > >>putting VF and

Re: [PATCH v2 21/21] arm64: KVM: Remove weak attributes

2015-12-02 Thread Marc Zyngier
On 02/12/15 16:21, Christoffer Dall wrote: > On Wed, Dec 02, 2015 at 03:21:49PM +, Marc Zyngier wrote: >> On 02/12/15 11:47, Christoffer Dall wrote: >>> On Fri, Nov 27, 2015 at 06:50:15PM +, Marc Zyngier wrote: As we've now switched to the new world switch implementation, remove

Re: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-02 Thread Ard Biesheuvel
Hi Pavel, Thanks for getting to the bottom of this. On 1 December 2015 at 14:03, Pavel Fedin wrote: > This function takes stage-II physical addresses (A.K.A. IPA), on input, not > real physical addresses. This causes kvm_is_device_pfn() to return wrong > values, depending

Re: [PATCH] KVM: arm/arm64: vgic: make vgic_io_ops static

2015-12-02 Thread Christoffer Dall
On Thu, Nov 12, 2015 at 07:59:14PM +0800, Jisheng Zhang wrote: > vgic_io_ops is only referenced within vgic.c, so it can be declared > static. > > Signed-off-by: Jisheng Zhang Applied to queue, -Christoffer -- To unsubscribe from this list: send the line "unsubscribe kvm"

Re: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-02 Thread Ard Biesheuvel
On 2 December 2015 at 19:50, Christoffer Dall wrote: > On Tue, Dec 01, 2015 at 04:03:52PM +0300, Pavel Fedin wrote: >> This function takes stage-II physical addresses (A.K.A. IPA), on input, not >> real physical addresses. This causes kvm_is_device_pfn() to return

Re: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-02 Thread Christoffer Dall
On Wed, Dec 02, 2015 at 08:04:42PM +0100, Ard Biesheuvel wrote: > On 2 December 2015 at 19:50, Christoffer Dall > wrote: > > On Tue, Dec 01, 2015 at 04:03:52PM +0300, Pavel Fedin wrote: > >> This function takes stage-II physical addresses (A.K.A. IPA), on input, not >

Re: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-02 Thread Christoffer Dall
On Tue, Dec 01, 2015 at 04:03:52PM +0300, Pavel Fedin wrote: > This function takes stage-II physical addresses (A.K.A. IPA), on input, not > real physical addresses. This causes kvm_is_device_pfn() to return wrong > values, depending on how much guest and host memory maps match. This > results in

Re: [PATCH v4 18/21] KVM: ARM64: Add PMU overflow interrupt routing

2015-12-02 Thread Marc Zyngier
On 02/12/15 02:40, Shannon Zhao wrote: > > > On 2015/12/2 0:57, Marc Zyngier wrote: >> On 01/12/15 16:26, Shannon Zhao wrote: >>> >>> >>> On 2015/12/1 23:41, Marc Zyngier wrote: > The reason is that when guest clear the overflow register, it will trap >> to kvm and call

Re: [PATCH v2 10/21] arm64: KVM: Add patchable function selector

2015-12-02 Thread Christoffer Dall
On Tue, Dec 01, 2015 at 06:51:00PM +, Marc Zyngier wrote: > On 01/12/15 15:39, Christoffer Dall wrote: > > On Fri, Nov 27, 2015 at 06:50:04PM +, Marc Zyngier wrote: > >> KVM so far relies on code patching, and is likely to use it more > >> in the future. The main issue is that our

RE: BUG ALERT: ARM32 KVM does not work in 4.4-rc3

2015-12-02 Thread Pavel Fedin
Hello! > > My project involves ARM64, but from time to time i also test ARM32 > > KVM. I have discovered that it stopped working in 4.4-rc3. The same > > virtual machine works perfectly under current kvmarm/next, but gets > > stuck at random point under 4.4-rc3 from linux-stable. I'm not sure >

Re: [PATCH v2 10/21] arm64: KVM: Add patchable function selector

2015-12-02 Thread Andrew Jones
On Fri, Nov 27, 2015 at 06:50:04PM +, Marc Zyngier wrote: > KVM so far relies on code patching, and is likely to use it more > in the future. The main issue is that our alternative system works > at the instruction level, while we'd like to have alternatives at > the function level. How about

Re: [RFC PATCH V2 02/10] Qemu/VFIO: Add new VFIO_GET_PCI_CAP_INFO ioctl cmd definition

2015-12-02 Thread Alex Williamson
On Tue, 2015-11-24 at 21:35 +0800, Lan Tianyu wrote: > Signed-off-by: Lan Tianyu > --- > linux-headers/linux/vfio.h | 16 > 1 file changed, 16 insertions(+) > > diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h > index 0508d0b..732b0bd

Re: [PATCH v2 0/3] Introduce MSI hardware mapping for VFIO

2015-12-02 Thread Alex Williamson
On Tue, 2015-11-24 at 16:50 +0300, Pavel Fedin wrote: > On some architectures (e.g. ARM64) if the device is behind an IOMMU, and > is being mapped by VFIO, it is necessary to also add mappings for MSI > translation register for interrupts to work. This series implements the > necessary API to do

Re: [RFC PATCH V2 09/10] Qemu/VFIO: Add SRIOV VF migration support

2015-12-02 Thread Alex Williamson
On Tue, 2015-11-24 at 21:35 +0800, Lan Tianyu wrote: > This patch is to add SRIOV VF migration support. > Create new device type "vfio-sriov" and add faked PCI migration capability > to the type device. > > The purpose of the new capability > 1) sync migration status with VF driver in the VM > 2)

Re: [RFC PATCH V2 06/10] Qemu/PCI: Add macros for faked PCI migration capability

2015-12-02 Thread Alex Williamson
On Tue, 2015-11-24 at 21:35 +0800, Lan Tianyu wrote: > This patch is to extend PCI CAP id for migration cap and > add reg macros. The CAP ID is trial and we may find better one if the > solution is feasible. > > *PCI_VF_MIGRATION_CAP > For VF driver to control that triggers mailbox irq or not

[PATCH v5 07/21] KVM: ARM64: PMU: Add perf event map and introduce perf event creating function

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao When we use tools like perf on host, perf passes the event type and the id of this event type category to kernel, then kernel will map them to hardware event number and write this number to PMU PMEVTYPER_EL0 register. When getting the event number in

[PATCH v5 20/21] KVM: ARM64: Free perf event of PMU when destroying vcpu

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao When KVM frees VCPU, it needs to free the perf_event of PMU. Signed-off-by: Shannon Zhao --- arch/arm/kvm/arm.c| 1 + include/kvm/arm_pmu.h | 2 ++ virt/kvm/arm/pmu.c| 21 + 3 files changed, 24

[PATCH v5 06/21] KVM: ARM64: Add reset and access handlers for PMCEID0 and PMCEID1 register

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao Add reset handler which gets host value of PMCEID0 or PMCEID1. Since write action to PMCEID0 or PMCEID1 is ignored, add a new case for this. Signed-off-by: Shannon Zhao --- arch/arm64/kvm/sys_regs.c | 29

[PATCH v5 15/21] KVM: ARM64: Add reset and access handlers for PMSWINC register

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao Add access handler which emulates writing and reading PMSWINC register and add support for creating software increment event. Signed-off-by: Shannon Zhao --- arch/arm64/kvm/sys_regs.c | 18 +-

[PATCH v5 17/21] KVM: ARM64: Add helper to handle PMCR register bits

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao According to ARMv8 spec, when writing 1 to PMCR.E, all counters are enabled by PMCNTENSET, while writing 0 to PMCR.E, all counters are disabled. When writing 1 to PMCR.P, reset all event counters, not including PMCCNTR, to zero. When writing 1 to

[PATCH v5 02/21] KVM: ARM64: Define PMU data structure for each vcpu

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao Here we plan to support virtual PMU for guest by full software emulation, so define some basic structs and functions preparing for futher steps. Define struct kvm_pmc for performance monitor counter and struct kvm_pmu for performance monitor unit for

[PATCH v5 13/21] KVM: ARM64: Add reset and access handlers for PMOVSSET and PMOVSCLR register

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao Since the reset value of PMOVSSET and PMOVSCLR is UNKNOWN, use reset_unknown for its reset handler. Add a new case to emulate writing PMOVSSET or PMOVSCLR register. When writing non-zero value to PMOVSSET, pend PMU interrupt. When the value writing to

[PATCH v5 18/21] KVM: ARM64: Add PMU overflow interrupt routing

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao When calling perf_event_create_kernel_counter to create perf_event, assign a overflow handler. Then when perf event overflows, call kvm_vcpu_kick() to sync the interrupt. Signed-off-by: Shannon Zhao --- arch/arm/kvm/arm.c

[PATCH v5 21/21] KVM: ARM64: Add a new kvm ARM PMU device

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao Add a new kvm device type KVM_DEV_TYPE_ARM_PMU_V3 for ARM PMU. Implement the kvm_device_ops for it. Signed-off-by: Shannon Zhao --- Documentation/virtual/kvm/devices/arm-pmu.txt | 16 + arch/arm64/include/uapi/asm/kvm.h

[PATCH v5 16/21] KVM: ARM64: Add access handlers for PMEVCNTRn and PMEVTYPERn register

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao Add access handler which emulates writing and reading PMEVCNTRn and PMEVTYPERn. Signed-off-by: Shannon Zhao --- arch/arm64/kvm/sys_regs.c | 164 ++ 1 file changed, 164

RE: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-02 Thread Pavel Fedin
Hello! > > diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c > > index 7dace90..51ad98f 100644 > > --- a/arch/arm/kvm/mmu.c > > +++ b/arch/arm/kvm/mmu.c > > @@ -310,7 +310,8 @@ static void stage2_flush_ptes(struct kvm *kvm, pmd_t > > *pmd, > > > > pte = pte_offset_kernel(pmd, addr);

[PATCH v5 05/21] KVM: ARM64: Add reset and access handlers for PMSELR register

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao Since the reset value of PMSELR_EL0 is UNKNOWN, use reset_unknown for its reset handler. As it doesn't need to deal with the accessing action specially, it uses default case to emulate writing and reading PMSELR register. Signed-off-by: Shannon Zhao

[PATCH v5 00/21] KVM: ARM64: Add guest PMU support

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao This patchset adds guest PMU support for KVM on ARM64. It takes trap-and-emulate approach. When guest wants to monitor one event, it will be trapped by KVM and KVM will call perf_event API to create a perf event and call relevant perf_event APIs to get

[PATCH v5 09/21] KVM: ARM64: Add reset and access handlers for PMXEVCNTR register

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao Since the reset value of PMXEVCNTR is UNKNOWN, use reset_unknown for its reset handler. Add access handler which emulates writing and reading PMXEVCNTR register. When reading PMXEVCNTR, call perf_event_read_value to get the count value of the perf

[PATCH v5 19/21] KVM: ARM64: Reset PMU state when resetting vcpu

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao When resetting vcpu, it needs to reset the PMU state to initial status. Signed-off-by: Shannon Zhao --- arch/arm64/kvm/reset.c | 3 +++ include/kvm/arm_pmu.h | 2 ++ virt/kvm/arm/pmu.c | 18 ++ 3 files

[PATCH v5 03/21] KVM: ARM64: Add offset defines for PMU registers

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao We are about to trap and emulate acccesses to each PMU register individually. This adds the context offsets for the AArch64 PMU registers and their AArch32 counterparts. Signed-off-by: Shannon Zhao ---

[PATCH] KVM: VMX: fix the writing POSTED_INTR_NV

2015-12-02 Thread roy . qing . li
From: Li RongQing POSTED_INTR_NV is 16bit, should not use 64bit write function [ 5311.676074] vmwrite error: reg 3 value 0 (err 12) [ 5311.680001] CPU: 49 PID: 4240 Comm: qemu-system-i38 Tainted: G I 4.1.13-WR8.0.0.0_standard #1 [ 5311.689343] Hardware name: Intel

[PATCH v5 14/21] KVM: ARM64: Add reset and access handlers for PMUSERENR register

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao The reset value of PMUSERENR_EL0 is UNKNOWN, use reset_unknown. Signed-off-by: Shannon Zhao --- arch/arm64/kvm/sys_regs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/sys_regs.c

[PATCH v5 11/21] KVM: ARM64: Add reset and access handlers for PMCNTENSET and PMCNTENCLR register

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao Since the reset value of PMCNTENSET and PMCNTENCLR is UNKNOWN, use reset_unknown for its reset handler. Add a new case to emulate writing PMCNTENSET or PMCNTENCLR register. When writing to PMCNTENSET, call perf_event_enable to enable the perf event.

[PATCH v5 12/21] KVM: ARM64: Add reset and access handlers for PMINTENSET and PMINTENCLR register

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao Since the reset value of PMINTENSET and PMINTENCLR is UNKNOWN, use reset_unknown for its reset handler. Add a new case to emulate writing PMINTENSET or PMINTENCLR register. Signed-off-by: Shannon Zhao ---

[PATCH v5 01/21] ARM64: Move PMU register related defines to asm/pmu.h

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao To use the ARMv8 PMU related register defines from the KVM code, we move the relevant definitions to asm/pmu.h header file. Signed-off-by: Anup Patel Signed-off-by: Shannon Zhao ---

[PATCH v5 08/21] KVM: ARM64: Add reset and access handlers for PMXEVTYPER register

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao Since the reset value of PMXEVTYPER is UNKNOWN, use reset_unknown or reset_unknown_cp15 for its reset handler. Add access handler which emulates writing and reading PMXEVTYPER register. When writing to PMXEVTYPER, call kvm_pmu_set_counter_event_type to

[PATCH v5 10/21] KVM: ARM64: Add reset and access handlers for PMCCNTR register

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao Since the reset value of PMCCNTR is UNKNOWN, use reset_unknown for its reset handler. Add a new case to emulate reading and writing to PMCCNTR register. Signed-off-by: Shannon Zhao --- arch/arm64/kvm/sys_regs.c | 31

[PATCH v5 04/21] KVM: ARM64: Add reset and access handlers for PMCR_EL0 register

2015-12-02 Thread Shannon Zhao
From: Shannon Zhao Add reset handler which gets host value of PMCR_EL0 and make writable bits architecturally UNKNOWN except PMCR.E to zero. Add a common access handler for PMU registers which emulates writing and reading register and add emulation for PMCR.

Re: [PATCH v4 18/21] KVM: ARM64: Add PMU overflow interrupt routing

2015-12-02 Thread Shannon Zhao
On 2015/12/2 16:45, Marc Zyngier wrote: > On 02/12/15 02:40, Shannon Zhao wrote: >> > >> > >> > On 2015/12/2 0:57, Marc Zyngier wrote: >>> >> On 01/12/15 16:26, Shannon Zhao wrote: >>> >>> >>> On 2015/12/1 23:41, Marc Zyngier wrote: >> > The reason is that when guest

[GIT PULL 02/23] KVM: use heuristic for fast VCPU lookup by id

2015-12-02 Thread Christian Borntraeger
From: David Hildenbrand Usually, VCPU ids match the array index. So let's try a fast lookup first before falling back to the slow iteration. Suggested-by: Christian Borntraeger Reviewed-by: Dominik Dingel Reviewed-by:

[GIT PULL 14/23] KVM: s390: we always have a SCA

2015-12-02 Thread Christian Borntraeger
From: David Hildenbrand Having no sca can never happen, even when something goes wrong when switching to ESCA. Otherwise we would have a serious bug. Let's remove this superfluous check. Acked-by: Dominik Dingel Signed-off-by: David

Re: [PATCH v2 10/21] arm64: KVM: Add patchable function selector

2015-12-02 Thread Marc Zyngier
On 02/12/15 09:27, Christoffer Dall wrote: > On Tue, Dec 01, 2015 at 06:51:00PM +, Marc Zyngier wrote: >> On 01/12/15 15:39, Christoffer Dall wrote: >>> On Fri, Nov 27, 2015 at 06:50:04PM +, Marc Zyngier wrote: KVM so far relies on code patching, and is likely to use it more in

Re: [PATCH v4 18/21] KVM: ARM64: Add PMU overflow interrupt routing

2015-12-02 Thread Marc Zyngier
On 02/12/15 09:49, Shannon Zhao wrote: > > > On 2015/12/2 16:45, Marc Zyngier wrote: >> On 02/12/15 02:40, Shannon Zhao wrote: On 2015/12/2 0:57, Marc Zyngier wrote: >> On 01/12/15 16:26, Shannon Zhao wrote: On 2015/12/1 23:41, Marc Zyngier wrote:

[GIT PULL 01/23] KVM: Use common function for VCPU lookup by id

2015-12-02 Thread Christian Borntraeger
From: David Hildenbrand Let's reuse the new common function for VPCU lookup by id. Reviewed-by: Christian Borntraeger Reviewed-by: Dominik Dingel Signed-off-by: David Hildenbrand

[GIT PULL 10/23] KVM: s390: Make provisions for ESCA utilization

2015-12-02 Thread Christian Borntraeger
From: "Eugene (jno) Dvurechenski" This patch updates the routines (sca_*) to provide transparent access to and manipulation on the data for both Basic and Extended SCA in use. The kvm.arch.sca is generalized to (void *) to handle BSCA/ESCA cases. Also the

[GIT PULL 17/23] KVM: s390: cleanup sca_add_vcpu

2015-12-02 Thread Christian Borntraeger
From: David Hildenbrand Now that we already have kvm and the VCPU id set for the VCPU, we can convert sda_add_vcpu to look much more like sda_del_vcpu. Signed-off-by: David Hildenbrand Signed-off-by: Christian Borntraeger

[GIT PULL 19/23] s390/sclp: introduce check for SIE

2015-12-02 Thread Christian Borntraeger
From: David Hildenbrand This patch adds a way to check if the SIE with zArchitecture support is available. Acked-by: Martin Schwidefsky Acked-by: Cornelia Huck Signed-off-by: David Hildenbrand

[GIT PULL 23/23] KVM: s390: remove redudant assigment of error code

2015-12-02 Thread Christian Borntraeger
rc already contains -ENOMEM, no need to assign it twice. Signed-off-by: Christian Borntraeger Acked-by: Cornelia Huck Reviewed-by: David Hildenbrand --- arch/s390/kvm/kvm-s390.c | 4 +--- 1 file changed, 1

[GIT PULL 08/23] KVM: s390: Provide SCA-aware helpers for VCPU add/del

2015-12-02 Thread Christian Borntraeger
From: "Eugene (jno) Dvurechenski" This patch provides SCA-aware helpers to create/delete a VCPU. This is to prepare for upcoming introduction of Extended SCA support. Signed-off-by: Eugene (jno) Dvurechenski Reviewed-by: David Hildenbrand

[GIT PULL 05/23] s390/sclp: introduce checks for ESCA and HVS

2015-12-02 Thread Christian Borntraeger
From: "Eugene (jno) Dvurechenski" Introduce sclp.has_hvs and sclp.has_esca to provide a way for kvm to check whether the extended-SCA and the home-virtual-SCA facilities are available. Signed-off-by: Eugene (jno) Dvurechenski Reviewed-by: David

[GIT PULL 11/23] KVM: s390: Introduce switching code

2015-12-02 Thread Christian Borntraeger
From: "Eugene (jno) Dvurechenski" This patch adds code that performs transparent switch to Extended SCA on addition of 65th VCPU in a VM. Disposal of ESCA is added too. The entier ESCA functionality, however, is still not enabled. The enablement will be provided in a

[GIT PULL 15/23] KVM: s390: fix SCA related races and double use

2015-12-02 Thread Christian Borntraeger
From: David Hildenbrand If something goes wrong in kvm_arch_vcpu_create, the VCPU has already been added to the sca but will never be removed. Trying to create VCPUs with duplicate ids (e.g. after a failed attempt) is problematic. Also, when creating multiple VCPUs in

[GIT PULL 21/23] KVM: s390: don't load kvm without virtualization support

2015-12-02 Thread Christian Borntraeger
From: David Hildenbrand If we don't have support for virtualization (SIE), e.g. when running under a hypervisor not supporting execution of the SIE instruction, we should immediately abort loading the kvm module, as the SIE instruction cannot be enabled dynamically.

[GIT PULL 12/23] KVM: s390: Enable up to 248 VCPUs per VM

2015-12-02 Thread Christian Borntraeger
From: "Eugene (jno) Dvurechenski" This patch allows s390 to have more than 64 VCPUs for a guest (up to 248 for memory usage considerations), if supported by the underlaying hardware (sclp.has_esca). Signed-off-by: Eugene (jno) Dvurechenski

[GIT PULL 03/23] KVM: Remove unnecessary debugfs dentry references

2015-12-02 Thread Christian Borntraeger
From: Janosch Frank KVM creates debugfs files to export VM statistics to userland. To be able to remove them on kvm exit it tracks the files' dentries. Since their parent directory is also tracked and since each parent direntry knows its children we can easily remove

[GIT PULL 06/23] KVM: s390: Generalize access to IPTE controls

2015-12-02 Thread Christian Borntraeger
From: "Eugene (jno) Dvurechenski" This patch generalizes access to the IPTE controls, which is a part of SCA. This is to prepare for upcoming introduction of Extended SCA support. Signed-off-by: Eugene (jno) Dvurechenski Signed-off-by:

[GIT PULL 16/23] KVM: s390: always set/clear the SCA sda field

2015-12-02 Thread Christian Borntraeger
From: David Hildenbrand Let's always set and clear the sda when enabling/disabling a VCPU. Dealing with sda being set to something else makes no sense anymore as we enable a VCPU in the SCA now after it has been registered at the VM. Signed-off-by: David Hildenbrand

[GIT PULL 09/23] KVM: s390: Introduce new structures

2015-12-02 Thread Christian Borntraeger
From: "Eugene (jno) Dvurechenski" This patch adds new structures and updates some existing ones to provide the base for Extended SCA functionality. The old sca_* structures were renamed to bsca_* to keep things uniform. The access to fields of SIGP controls were turned

[GIT PULL 18/23] KVM: s390: don't switch to ESCA for ucontrol

2015-12-02 Thread Christian Borntraeger
From: David Hildenbrand sca_add_vpcu is not called for ucontrol guests. We must also not apply the sca checking for sca_can_add_vcpu as ucontrol guests do not have to follow the sca limits. As common code already checks that id < KVM_MAX_VCPUS all other data structures

[GIT PULL 04/23] KVM: s390: rewrite vcpu_post_run and drop out early

2015-12-02 Thread Christian Borntraeger
From: David Hildenbrand Let's rewrite this function to better reflect how we actually handle exit_code. By dropping out early we can save a few cycles. This especially speeds up sie exits caused by host irqs. Also, let's move the special -EOPNOTSUPP for intercepts to

[GIT PULL 07/23] KVM: s390: Generalize access to SIGP controls

2015-12-02 Thread Christian Borntraeger
From: "Eugene (jno) Dvurechenski" This patch generalizes access to the SIGP controls, which is a part of SCA. This is to prepare for upcoming introduction of Extended SCA support. Signed-off-by: Eugene (jno) Dvurechenski Signed-off-by:

[GIT PULL 00/23] KVM: s390 features, kvm_get_vcpu_by_id and stat for 4.5

2015-12-02 Thread Christian Borntraeger
Paolo, here is the first s390 pull request for 4.5. It also contains the remaining vcpu lookup changes and an improved cleanup of the kvm_stat exit path. I have deferred the kvm_stat per VM patches. The s390 changes are: - ESCA support (up to 248 CPUs) - detection if KVM works (e.g. for nested

[GIT PULL 22/23] KVM: s390: remove pointless test_facility(2) check

2015-12-02 Thread Christian Borntraeger
From: Heiko Carstens This evaluates always to 'true'. Signed-off-by: Heiko Carstens Reviewed-by: David Hildenbrand Signed-off-by: Christian Borntraeger --- arch/s390/kvm/kvm-s390.c | 2 +-

[GIT PULL 13/23] KVM: s390: fast path for sca_ext_call_pending

2015-12-02 Thread Christian Borntraeger
From: David Hildenbrand If CPUSTAT_ECALL_PEND isn't set, we can't have an external call pending, so we can directly avoid taking the lock. Acked-by: Christian Borntraeger Signed-off-by: David Hildenbrand Signed-off-by:

[GIT PULL 20/23] s390: show virtualization support in /proc/cpuinfo

2015-12-02 Thread Christian Borntraeger
From: David Hildenbrand This patch exposes the SIE capability (aka virtualization support) via /proc/cpuinfo -> "features" as "sie". As we don't want to expose this hwcap via elf, let's add a second, "internal"/non-elf capability list. The content is simply concatenated

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

2015-12-02 Thread Michael S. Tsirkin
On Tue, Dec 01, 2015 at 10:36:33AM -0800, Alexander Duyck wrote: > On Tue, Dec 1, 2015 at 9:37 AM, Michael S. Tsirkin wrote: > > On Tue, Dec 01, 2015 at 09:04:32AM -0800, Alexander Duyck wrote: > >> On Tue, Dec 1, 2015 at 7:28 AM, Michael S. Tsirkin wrote: > >

Re: [PATCH v2 16/21] arm64: KVM: Add compatibility aliases

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:10PM +, Marc Zyngier wrote: > So far, we've implemented the new world switch with a completely > different namespace, so that we could have both implementation > compiled in. > > Let's take things one step further by adding weak aliases that > have the same names

Re: [PATCH v2 12/21] arm64: KVM: Implement fpsimd save/restore

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:06PM +, Marc Zyngier wrote: > Implement the fpsimd save restore, keeping the lazy part in > assembler (as returning to C would be overkill). > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hyp/Makefile| 1 + >

Re: [PATCH v2 13/21] arm64: KVM: Implement TLB handling

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:07PM +, Marc Zyngier wrote: > Implement the TLB handling as a direct translation of the assembly > code version. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hyp/Makefile | 1 + > arch/arm64/kvm/hyp/tlb.c| 72 >

Re: [PATCH v2 15/21] arm64: KVM: Add panic handling

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:09PM +, Marc Zyngier wrote: > Add the panic handler, together with the small bits of assembly > code to call the kernel's panic implementation. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hyp/hyp-entry.S | 11 ++- >

Re: [PATCH v2 10/21] arm64: KVM: Add patchable function selector

2015-12-02 Thread Christoffer Dall
On Wed, Dec 02, 2015 at 09:47:43AM +, Marc Zyngier wrote: > On 02/12/15 09:27, Christoffer Dall wrote: > > On Tue, Dec 01, 2015 at 06:51:00PM +, Marc Zyngier wrote: > >> On 01/12/15 15:39, Christoffer Dall wrote: > >>> On Fri, Nov 27, 2015 at 06:50:04PM +, Marc Zyngier wrote: >

Re: [PATCH v2 14/21] arm64: KVM: HYP mode entry points

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:08PM +, Marc Zyngier wrote: > Add the entry points for HYP mode (both for hypercalls and > exception handling). > > Signed-off-by: Marc Zyngier Reviewed-by: Christoffer Dall -- To unsubscribe from this list:

Re: [PATCH net-next 3/3] vhost_net: basic polling support

2015-12-02 Thread Michael S. Tsirkin
On Wed, Dec 02, 2015 at 01:04:03PM +0800, Jason Wang wrote: > > > On 12/01/2015 10:43 PM, Michael S. Tsirkin wrote: > > On Tue, Dec 01, 2015 at 01:17:49PM +0800, Jason Wang wrote: > >> > >> On 11/30/2015 06:44 PM, Michael S. Tsirkin wrote: > >>> On Wed, Nov 25, 2015 at 03:11:29PM +0800, Jason

Re: [PATCH v2 21/21] arm64: KVM: Remove weak attributes

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:15PM +, Marc Zyngier wrote: > As we've now switched to the new world switch implementation, > remove the weak attributes, as nobody is supposed to override > it anymore. Why not remove the aliases and change the callers? -Christoffer > > Signed-off-by: Marc

Re: [PATCH v2 20/21] arm64: KVM: Cleanup asm-offset.c

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:14PM +, Marc Zyngier wrote: > As we've now rewritten most of our code-base in C, most of the > KVM-specific code in asm-offset.c is useless. Delete-time again! > > Signed-off-by: Marc Zyngier Acked-by: Christoffer Dall

Re: [PATCH v2 19/21] arm64: KVM: Turn system register numbers to an enum

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:13PM +, Marc Zyngier wrote: > Having the system register numbers as #defines has been a pain > since day one, as the ordering is pretty fragile, and moving > things around leads to renumbering and epic conflict resolutions. > > Now that we're mostly acessing the

Re: [PATCH v2 18/21] arm64: KVM: Move away from the assembly version of the world switch

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:12PM +, Marc Zyngier wrote: > This is it. We remove all of the code that has now been rewritten. > > Signed-off-by: Marc Zyngier Acked-by: Christoffer Dall -- To unsubscribe from this list: send the line

Re: [PATCH v2 17/21] arm64: KVM: Map the kernel RO section into HYP

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:11PM +, Marc Zyngier wrote: > In order to run C code in HYP, we must make sure that the kernel's > RO section in mapped into HYP (otherwise things break badly). > > Signed-off-by: Marc Zyngier Acked-by: Christoffer Dall

Re: [GIT PULL 04/23] KVM: s390: rewrite vcpu_post_run and drop out early

2015-12-02 Thread Paolo Bonzini
On 02/12/2015 12:06, Christian Borntraeger wrote: > + memcpy(>run->s.regs.gprs[14], >arch.sie_block->gg14, 16); This is preexisting but... boy it's ugly. :) Do you gain much over the simpler vcpu->run->s.regs.gprs[14] = vcpu->arch.sie_block->gg14;

Re: [PATCH v2 1/9] drivers/hv: replace enum hv_message_type by u32

2015-12-02 Thread Paolo Bonzini
On 30/11/2015 17:22, Andrey Smetanin wrote: > enum hv_message_type inside struct hv_message, hv_post_message > is not size portable. Replace enum by u32. It's only non-portable inside structs. Okay to apply just these: @@ -172,7 +174,7 @@ union hv_message_flags { /* Define synthetic

Re: [GIT PULL 04/23] KVM: s390: rewrite vcpu_post_run and drop out early

2015-12-02 Thread Christian Borntraeger
On 12/02/2015 01:20 PM, Paolo Bonzini wrote: > > > On 02/12/2015 12:06, Christian Borntraeger wrote: >> +memcpy(>run->s.regs.gprs[14], >arch.sie_block->gg14, 16); > > This is preexisting but... boy it's ugly. :) > > Do you gain much over the simpler > > vcpu->run->s.regs.gprs[14] =

Re: [GIT PULL 00/23] KVM: s390 features, kvm_get_vcpu_by_id and stat for 4.5

2015-12-02 Thread Paolo Bonzini
On 02/12/2015 12:06, Christian Borntraeger wrote: > Paolo, > > here is the first s390 pull request for 4.5. It also contains the > remaining vcpu lookup changes and an improved cleanup of the kvm_stat > exit path. > I have deferred the kvm_stat per VM patches. > > The s390 changes are: > -

Re: [GIT PULL 04/23] KVM: s390: rewrite vcpu_post_run and drop out early

2015-12-02 Thread Paolo Bonzini
On 02/12/2015 14:04, Christian Borntraeger wrote: >> > Do you gain much over the simpler >> > >> >vcpu->run->s.regs.gprs[14] = vcpu->arch.sie_block->gg14; >> >vcpu->run->s.regs.gprs[15] = vcpu->arch.sie_block->gg15; >> > > Its just legacy code from the old days. > There is a

Re: [PATCH v2 10/21] arm64: KVM: Add patchable function selector

2015-12-02 Thread Marc Zyngier
On 02/12/15 11:53, Christoffer Dall wrote: > On Wed, Dec 02, 2015 at 09:47:43AM +, Marc Zyngier wrote: >> On 02/12/15 09:27, Christoffer Dall wrote: >>> On Tue, Dec 01, 2015 at 06:51:00PM +, Marc Zyngier wrote: On 01/12/15 15:39, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at

Re: [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC

2015-12-02 Thread Lan, Tianyu
On 12/1/2015 11:02 PM, Michael S. Tsirkin wrote: But it requires guest OS to do specific configurations inside and rely on bonding driver which blocks it work on Windows. From performance side, putting VF and virtio NIC under bonded interface will affect their performance even when not do

[PATCH kvm-unit-tests] x86: use asm volatile for flags and segment register read/writes

2015-12-02 Thread Paolo Bonzini
The effects of a move from or to these registers is not entirely described by the asm's operands. Therefore, it may happen that the compiler moves the asm around in ways that break tests. In one case, the compiler marked read_ss() as pure and thus subjected it to common subexpression

Re: [GIT PULL 04/23] KVM: s390: rewrite vcpu_post_run and drop out early

2015-12-02 Thread Christian Borntraeger
On 12/02/2015 02:05 PM, Paolo Bonzini wrote: > > > On 02/12/2015 14:04, Christian Borntraeger wrote: Do you gain much over the simpler vcpu->run->s.regs.gprs[14] = vcpu->arch.sie_block->gg14; vcpu->run->s.regs.gprs[15] = vcpu->arch.sie_block->gg15; >> Its just