[PATCH 2/9] KVM: MMU: move FNAME(is_rsvd_bits_set) to mmu.c

2015-08-04 Thread Xiao Guangrong
FNAME(is_rsvd_bits_set) does not depend on guest mmu mode, move it to mmu.c to stop being compiled multiple times Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- arch/x86/kvm/mmu.c | 8 arch/x86/kvm/paging_tmpl.h | 13 ++--- 2 files changed, 10

Re: [PATCH 0/9] KVM: MMU: fix and improve validation of mmio page fault

2015-08-04 Thread Xiao Guangrong
CCed Pavel Shirshov ru.pc...@gmail.com Sorry, git tool missed to CC mail to the person tagged with Reported-by and Tested-by. :( On 08/04/2015 06:59 PM, Xiao Guangrong wrote: Current code validating mmio #PF is buggy, it was spotted by Pavel Shirshov, the bug is that qemu complained with KVM:

[PATCH 1/9] KVM: MMU: fix validation of mmio page fault

2015-08-04 Thread Xiao Guangrong
We got the bug that qemu complained with KVM: unknown exit, hardware reason 31 and KVM shown these info: [84245.284948] EPT: Misconfiguration. [84245.285056] EPT: GPA: 0xfeda848 [84245.285154] ept_misconfig_inspect_spte: spte 0x5eaef50107 level 4 [84245.285344] ept_misconfig_inspect_spte: spte

[PATCH 8/9] KVM: MMU: fully check reserved bits for sptes

2015-08-04 Thread Xiao Guangrong
The #PF with PFEC.RSV = 1 is designed to speed MMIO emulation, however, it is possible that the RSV #PF is caused by real BUG by mis-configure shadow page table entries This patch enables full check for the reserved bits on shadow page table entries and dump the shadow page table hierarchy is the

[PATCH 7/9] KVM: MMU: introduce is_shadow_rsvd_bits_set()

2015-08-04 Thread Xiao Guangrong
We have the same data struct to check reserved bits on guest page tables and shadow page tables, split is_rsvd_bits_set() so that the logic can be shared between these two paths Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- arch/x86/kvm/mmu.c | 28 +++-

[PATCH 9/9] KVM: VMX: drop ept misconfig check

2015-08-04 Thread Xiao Guangrong
The logic used to check ept misconfig is completely contained in common reserved bits check for sptes, so it can be removed Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- arch/x86/kvm/mmu.c | 22 arch/x86/kvm/mmu.h | 1 - arch/x86/kvm/vmx.c | 74

[PATCH 0/9] KVM: MMU: fix and improve validation of mmio page fault

2015-08-04 Thread Xiao Guangrong
Current code validating mmio #PF is buggy, it was spotted by Pavel Shirshov, the bug is that qemu complained with KVM: unknown exit, hardware reason 31 and KVM shown these info: [84245.284948] EPT: Misconfiguration. [84245.285056] EPT: GPA: 0xfeda848 [84245.285154] ept_misconfig_inspect_spte: spte

[PATCH 3/9] KVM: MMU: introduce rsvd_bits_validate

2015-08-04 Thread Xiao Guangrong
These two fields, rsvd_bits_mask and bad_mt_xwr, in struct kvm_mmu are used to check if reserved bits set on guest ptes, move them to a data struct so that the approach can be applied to check reserved bits on host shadow page table entries Signed-off-by: Xiao Guangrong

[PATCH 4/9] KVM: MMU: split reset_rsvds_bits_mask

2015-08-04 Thread Xiao Guangrong
Since softmmu AMD nested shadow page tables and guest page tables have the same format, split reset_rsvds_bits_mask so that the logic can be reused by later patches which check reserved bits on sptes Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- arch/x86/kvm/mmu.c | 26

[PATCH 5/9] KVM: MMU: split reset_rsvds_bits_mask_ept

2015-08-04 Thread Xiao Guangrong
Since shdow ept page tables and intel nested guest page tables have the same format, split reset_rsvds_bits_mask_ept so that the logic can be reused by later patches which check reserved bits on sptes Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- arch/x86/kvm/mmu.c | 14

[PATCH 6/9] KVM: MMU: introduce the framework to check reserved bits on sptes

2015-08-04 Thread Xiao Guangrong
We have abstracted the data struct and functions which are used to check reserved bit on guest page tables, now we extend the logic to check reserved bits on shadow page tables Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- arch/x86/include/asm/kvm_host.h | 1 +

Re: A vulnerability of WindowsGuestDrivers

2015-08-04 Thread Petr Matousek
Hi Aliyun, On Tue, Aug 04, 2015 at 03:05:50PM +0800, security wrote: One of our whitehats has just reported an vulnerability to us. It is an integer overflow problem of KVM WindowsGuestDrivers of VirtIO (Path: kvm-guest-drivers-windows/NetKVM/DebugTools/VirtioConsoleSimulation/). We

Re: [PATCH v3 10/11] KVM: arm/arm64: timer: Allow the timer to control the active state

2015-08-04 Thread Christoffer Dall
On Fri, Jul 24, 2015 at 04:55:08PM +0100, Marc Zyngier wrote: In order to remove the crude hack where we sneak the masked bit into the timer's control register, make use of the phys_irq_map API control the active state of the interrupt. This causes some limited changes to allow for potential

Re: [PATCH 1/2] KVM: x86: set TMR when the interrupt is accepted

2015-08-04 Thread Paolo Bonzini
On 04/08/2015 02:46, Zhang, Yang Z wrote: It is a problem for split irqchip, where the EOI exit bitmap can be inferred from the IOAPIC routes but the TMR cannot. The hardware behavior on the other hand can be implemented purely within the LAPIC. So updating the TMR within LAPIC is the

Re: [kvm-unit-tests PATCH 10/14] powerpc/ppc64: relocate linker VMAs

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 01:53:24PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 04:41:27PM +0200, Andrew Jones wrote: QEMU loads the unit test, but due to the way it translates the unit test's linker VMA to the LMA, we can't just link such that VMA == LMA. Thus, we link with VMA ==

Re: [kvm-unit-tests PATCH 10/14] powerpc/ppc64: relocate linker VMAs

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 01:53:24PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 04:41:27PM +0200, Andrew Jones wrote: QEMU loads the unit test, but due to the way it translates the unit test's linker VMA to the LMA, we can't just link such that VMA == LMA. Thus, we link with VMA ==

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 02:09:52PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones

A vulnerability of WindowsGuestDrivers

2015-08-04 Thread security
Hi team, One of our whitehats has just reported an vulnerability to us. It is an integer overflow problem of KVM WindowsGuestDrivers of VirtIO (Path: kvm-guest-drivers-windows/NetKVM/DebugTools/VirtioConsoleSimulation/). We don't know where to report this vulnerability to, so could you tell

Re: [kvm-unit-tests PATCH v5 11/11] new: arm/barrier-test for memory barriers

2015-08-04 Thread Alex Bennée
alvise rigo a.r...@virtualopensystems.com writes: On Mon, Aug 3, 2015 at 6:06 PM, Alex Bennée alex.ben...@linaro.org wrote: alvise rigo a.r...@virtualopensystems.com writes: On Mon, Aug 3, 2015 at 12:30 PM, Alex Bennée alex.ben...@linaro.org wrote: alvise rigo

RE: [RFC 0/2] VFIO: Add virtual MSI doorbell support.

2015-08-04 Thread Bhushan Bharat
-Original Message- From: Pranavkumar Sawargaonkar [mailto:pranavku...@linaro.org] Sent: Tuesday, August 04, 2015 11:18 AM To: Bhushan Bharat-R65777 Cc: kvm@vger.kernel.org; Alex Williamson; kvm...@lists.cs.columbia.edu; linux-arm-ker...@lists.infradead.org;

Re: [kvm-unit-tests PATCH 3/3] arm/run: use ACCEL to choose between kvm and tcg

2015-08-04 Thread Andrew Jones
On Mon, Aug 03, 2015 at 07:51:51PM +0200, Andrew Jones wrote: Inspired by a patch by Alex Bennée. This version uses a new unittests.cfg variable and includes support for DRYRUN. Signed-off-by: Andrew Jones drjo...@redhat.com --- Another difference with Alex's patch is we no longer output

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 02:09:52PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones

[kvm-unit-tests PATCH 0/3] tcg is becoming a first class citizen

2015-08-04 Thread Andrew Jones
At least on the ARM side of things we're making sure unit tests can be used for [MT]TCG, as well as for KVM. This series adds support to unittests.cfg to allow us to specify kvm vs. tcg, as not all tests will be able (should/need) to run on both. The first patch is a repost of one of Alex's

[kvm-unit-tests PATCH 2/3] run_tests: pass test name to run script

2015-08-04 Thread Andrew Jones
With this $TEST_DIR/run can output test specific error messages. Signed-off-by: Andrew Jones drjo...@redhat.com --- run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_tests.sh b/run_tests.sh index ebb7e9fe6fdfc..80b87823c3358 100755 --- a/run_tests.sh +++

[kvm-unit-tests PATCH 3/3] arm/run: use ACCEL to choose between kvm and tcg

2015-08-04 Thread Andrew Jones
Inspired by a patch by Alex Bennée. This version uses a new unittests.cfg variable and includes support for mkstandalone. Signed-off-by: Andrew Jones drjo...@redhat.com --- arm/run | 43 +-- arm/unittests.cfg | 4 +++- run_tests.sh

[kvm-unit-tests PATCH 1/3] configure: emit HOST=$host to config.mak

2015-08-04 Thread Andrew Jones
From: Alex Bennée alex.ben...@linaro.org This is useful information for the run scripts to know, especially if they want to drop to using TCG. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: Andrew Jones drjo...@redhat.com --- configure | 2 ++ 1 file changed, 2 insertions(+)

RE: [PATCH v2 14/15] KVM: arm64: implement MSI injection in ITS emulation

2015-08-04 Thread Pavel Fedin
Hello! I think this flag should be kept, as it really indicates what is valid in the MSI structure. It also has other benefits such as making obvious what userspace expects, which can then be checked against the kernel's own expectations. I'm OK with the flag despite it's indeed a small

RE: [PATCH 1/2] KVM: x86: set TMR when the interrupt is accepted

2015-08-04 Thread Zhang, Yang Z
Paolo Bonzini wrote on 2015-08-04: On 04/08/2015 02:46, Zhang, Yang Z wrote: It is a problem for split irqchip, where the EOI exit bitmap can be inferred from the IOAPIC routes but the TMR cannot. The hardware behavior on the other hand can be implemented purely within the LAPIC. So

Re: [kvm-unit-tests PATCH 08/14] powerpc/ppc64: add HV putchar

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 01:50:39PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 04:41:25PM +0200, Andrew Jones wrote: Add the hvcall for putchar and use it in puts. That, along with a couple more lines in start to prepare for C code, and a branch to main(), gets us hello world. Run

Re: [kvm-unit-tests PATCH 08/14] powerpc/ppc64: add HV putchar

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 01:50:39PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 04:41:25PM +0200, Andrew Jones wrote: Add the hvcall for putchar and use it in puts. That, along with a couple more lines in start to prepare for C code, and a branch to main(), gets us hello world. Run

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 02:03:24PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 02:11:30PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27

Re: A vulnerability of WindowsGuestDrivers

2015-08-04 Thread Yan Vugenfirer
Hi, Thank you for reaching out. Please send the report to me. But to be clear on the indicated path - kvm-guest-drivers-windows/NetKVM/DebugTools/VirtioConsoleSimulation/ - this is not part of the actual production code or part of the code that runs in kernel. It is a legacy simulator that

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread Paolo Bonzini
On 04/08/2015 09:47, Andrew Jones wrote: In early development we did have a hypercall mediated virtio model, but it was abandoned once we got PCI working. So I think by yours and Alex's responses, if we want testdev support then we should target using pci to expose it. I'm ok with that,

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread Paolo Bonzini
On 04/08/2015 09:47, Andrew Jones wrote: In early development we did have a hypercall mediated virtio model, but it was abandoned once we got PCI working. So I think by yours and Alex's responses, if we want testdev support then we should target using pci to expose it. I'm ok with that,

Re: [PATCH 6/9] KVM: MMU: introduce the framework to check reserved bits on sptes

2015-08-04 Thread Xiao Guangrong
On 08/04/2015 09:23 PM, Paolo Bonzini wrote: On 04/08/2015 15:10, Xiao Guangrong wrote: This should be cpu_has_nx, I think. cpu_has_nx() checks the feature on host CPU, however, this is the shadow page table which completely follow guest's features. E.g, if guest does not

Re: [PATCH v3 09/11] KVM: arm/arm64: vgic: Prevent userspace injection of a mapped interrupt

2015-08-04 Thread Christoffer Dall
On Fri, Jul 24, 2015 at 04:55:07PM +0100, Marc Zyngier wrote: Virtual interrupts mapped to a HW interrupt should only be triggered from inside the kernel. Otherwise, you could end up confusing the kernel (and the GIC's) state machine. Rearrange the injection path so that kvm_vgic_inject_irq

Re: [PATCH v3 11/11] KVM: arm/arm64: vgic: Allow HW interrupts for non-shared devices

2015-08-04 Thread Christoffer Dall
On Fri, Jul 24, 2015 at 04:55:09PM +0100, Marc Zyngier wrote: So far, the only use of the HW interrupt facility is the timer, implying that the active state is context-switched for each vcpu, as the device is is shared across all vcpus. This does not work for a device that has been assigned

Re: [PATCH v3 04/11] KVM: arm/arm64: vgic: Allow HW irq to be encoded in LR

2015-08-04 Thread Christoffer Dall
On Fri, Jul 24, 2015 at 04:55:02PM +0100, Marc Zyngier wrote: Now that struct vgic_lr supports the LR_HW bit and carries a hwirq field, we can encode that information into the list registers. This patch provides implementations for both GICv2 and GICv3. Signed-off-by: Marc Zyngier

Re: [PATCH v3 07/11] KVM: arm/arm64: vgic: Allow HW interrupts to be queued to a guest

2015-08-04 Thread Christoffer Dall
On Fri, Jul 24, 2015 at 04:55:05PM +0100, Marc Zyngier wrote: To allow a HW interrupt to be injected into a guest, we lookup the guest virtual interrupt in the irq_phys_map list, and if we have a match, encode both interrupts in the LR. We also mark the interrupt as active at the host

Re: [kvm-unit-tests PATCH 0/3] tcg is becoming a first class citizen

2015-08-04 Thread Andrew Jones
Crap. Forgot -v2 on my format-patch command line... Paolo, should I repost? drew On Tue, Aug 04, 2015 at 09:25:52AM +0200, Andrew Jones wrote: At least on the ARM side of things we're making sure unit tests can be used for [MT]TCG, as well as for KVM. This series adds support to

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 02:11:30PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 02:03:24PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27

Re: [PATCH v3 06/11] KVM: arm/arm64: vgic: Allow dynamic mapping of physical/virtual interrupts

2015-08-04 Thread Christoffer Dall
On Fri, Jul 24, 2015 at 04:55:04PM +0100, Marc Zyngier wrote: In order to be able to feed physical interrupts to a guest, we need to be able to establish the virtual-physical mapping between the two worlds. The mappings are kept in a set of RCU lists, indexed by virtual interrupts.

Re: [PATCH 6/9] KVM: MMU: introduce the framework to check reserved bits on sptes

2015-08-04 Thread Xiao Guangrong
On 08/04/2015 08:14 PM, Paolo Bonzini wrote: On 04/08/2015 12:59, Xiao Guangrong wrote: +/* + * the page table on host is the shadow page table for the page + * table in guest or amd nested guest, its mmu features completely + * follow the features in guest. + */ +void

Re: [PATCH 6/9] KVM: MMU: introduce the framework to check reserved bits on sptes

2015-08-04 Thread Paolo Bonzini
On 04/08/2015 12:59, Xiao Guangrong wrote: +/* + * the page table on host is the shadow page table for the page + * table in guest or amd nested guest, its mmu features completely + * follow the features in guest. + */ +void +reset_shadow_rsvds_bits_mask(struct kvm_vcpu *vcpu, struct

Re: [PATCH v2 04/10] KVM: arm/arm64: vgic: Allow HW irq to be encoded in LR

2015-08-04 Thread Christoffer Dall
On Tue, Jul 21, 2015 at 05:38:52PM +0100, Marc Zyngier wrote: On 17/07/15 20:50, Christoffer Dall wrote: On Wed, Jul 08, 2015 at 06:56:36PM +0100, Marc Zyngier wrote: Now that struct vgic_lr supports the LR_HW bit and carries a hwirq field, we can encode that information into the list

Re: [PATCH v2 10/10] KVM: arm/arm64: vgic: Allow non-shared device HW interrupts

2015-08-04 Thread Christoffer Dall
On Tue, Jul 21, 2015 at 07:01:13PM +0100, Marc Zyngier wrote: On 17/07/15 23:15, Christoffer Dall wrote: On Wed, Jul 08, 2015 at 06:56:42PM +0100, Marc Zyngier wrote: So far, the only use of the HW interrupt facility is the timer, implying that the active state is context-switched for each

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 03:15:25PM +0200, Paolo Bonzini wrote: On 04/08/2015 09:47, Andrew Jones wrote: In early development we did have a hypercall mediated virtio model, but it was abandoned once we got PCI working. So I think by yours and Alex's responses, if we want testdev

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread Andrew Jones
On Tue, Aug 04, 2015 at 03:15:25PM +0200, Paolo Bonzini wrote: On 04/08/2015 09:47, Andrew Jones wrote: In early development we did have a hypercall mediated virtio model, but it was abandoned once we got PCI working. So I think by yours and Alex's responses, if we want testdev

Re: [PATCH 6/9] KVM: MMU: introduce the framework to check reserved bits on sptes

2015-08-04 Thread Paolo Bonzini
On 04/08/2015 15:10, Xiao Guangrong wrote: This should be cpu_has_nx, I think. cpu_has_nx() checks the feature on host CPU, however, this is the shadow page table which completely follow guest's features. E.g, if guest does not execution-protect the physical page, then KVM does not do

Re: [PATCH v3 06/11] KVM: arm/arm64: vgic: Allow dynamic mapping of physical/virtual interrupts

2015-08-04 Thread Marc Zyngier
On 04/08/15 14:04, Christoffer Dall wrote: On Fri, Jul 24, 2015 at 04:55:04PM +0100, Marc Zyngier wrote: In order to be able to feed physical interrupts to a guest, we need to be able to establish the virtual-physical mapping between the two worlds. The mappings are kept in a set of RCU

[Bug 102301] New: Shutting down a Windowvs 10 virtual machine (with VGA passthrough) causes a hard crash, every time

2015-08-04 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=102301 Bug ID: 102301 Summary: Shutting down a Windowvs 10 virtual machine (with VGA passthrough) causes a hard crash, every time Product: Virtualization Version: unspecified Kernel

Re: [PATCH] KVM: MTRR: Use default type for non-MTRR-covered gfn before WARN_ON

2015-08-04 Thread Xiao Guangrong
On 08/05/2015 12:58 AM, Alex Williamson wrote: The patch was munged on commit to re-order these tests resulting in excessive warnings when trying to do device assignment. Return to original ordering: https://lkml.org/lkml/2015/7/15/769 Reviewed-by: Xiao Guangrong

[PATCH v2 0/9] KVM: MMU: fix and improve validation of mmio page fault

2015-08-04 Thread Xiao Guangrong
Changelog in v2: - rename reset_*_rsvds_bits_mask() to reset_*_zero_bits_mask() and is_shadow_rsvd_bits_set() to is_shadow_zero_bits_set() to better match what we are checking. Thanks for Paolo's suggestion. Current code validating mmio #PF is buggy, it was spotted by Pavel Shirshov, the bug

[PATCHv4 kvmtool] kvmtool: Introduce downscript option for virtio-net

2015-08-04 Thread Fan Du
To detach tap device automatically from bridge when exiting, just like what the reverse of script does. Signed-off-by: Fan Du fan...@intel.com --- include/kvm/virtio-net.h | 1 + virtio/net.c | 49 2 files changed, 38 insertions(+),

[PATCH] KVM: MTRR: Use default type for non-MTRR-covered gfn before WARN_ON

2015-08-04 Thread Alex Williamson
The patch was munged on commit to re-order these tests resulting in excessive warnings when trying to do device assignment. Return to original ordering: https://lkml.org/lkml/2015/7/15/769 Fixes: 3e5d2fdceda1 (KVM: MTRR: simplify kvm_mtrr_get_guest_memory_type) Signed-off-by: Alex Williamson

Re: [PATCH v3 06/11] KVM: arm/arm64: vgic: Allow dynamic mapping of physical/virtual interrupts

2015-08-04 Thread Christoffer Dall
On Tue, Aug 04, 2015 at 04:27:03PM +0100, Marc Zyngier wrote: On 04/08/15 14:04, Christoffer Dall wrote: On Fri, Jul 24, 2015 at 04:55:04PM +0100, Marc Zyngier wrote: In order to be able to feed physical interrupts to a guest, we need to be able to establish the virtual-physical mapping

Re: [PATCH v3 09/11] KVM: arm/arm64: vgic: Prevent userspace injection of a mapped interrupt

2015-08-04 Thread Christoffer Dall
On Tue, Aug 04, 2015 at 05:02:41PM +0100, Marc Zyngier wrote: On 04/08/15 14:45, Christoffer Dall wrote: On Fri, Jul 24, 2015 at 04:55:07PM +0100, Marc Zyngier wrote: Virtual interrupts mapped to a HW interrupt should only be triggered from inside the kernel. Otherwise, you could end up

Re: [PATCH v3 06/11] KVM: arm/arm64: vgic: Allow dynamic mapping of physical/virtual interrupts

2015-08-04 Thread Marc Zyngier
On 04/08/15 18:36, Christoffer Dall wrote: On Tue, Aug 04, 2015 at 04:27:03PM +0100, Marc Zyngier wrote: On 04/08/15 14:04, Christoffer Dall wrote: On Fri, Jul 24, 2015 at 04:55:04PM +0100, Marc Zyngier wrote: In order to be able to feed physical interrupts to a guest, we need to be able to

Re: [PATCH v3 09/11] KVM: arm/arm64: vgic: Prevent userspace injection of a mapped interrupt

2015-08-04 Thread Marc Zyngier
On 04/08/15 17:21, Eric Auger wrote: Hi Marc, On 07/24/2015 05:55 PM, Marc Zyngier wrote: Virtual interrupts mapped to a HW interrupt should only be triggered from inside the kernel. Otherwise, you could end up confusing the kernel (and the GIC's) state machine. Rearrange the injection path

Re: [PATCH v3 10/11] KVM: arm/arm64: timer: Allow the timer to control the active state

2015-08-04 Thread Christoffer Dall
On Tue, Aug 04, 2015 at 05:14:53PM +0100, Marc Zyngier wrote: On 04/08/15 14:56, Christoffer Dall wrote: On Fri, Jul 24, 2015 at 04:55:08PM +0100, Marc Zyngier wrote: In order to remove the crude hack where we sneak the masked bit into the timer's control register, make use of the

Re: [PATCH v3 11/11] KVM: arm/arm64: vgic: Allow HW interrupts for non-shared devices

2015-08-04 Thread Christoffer Dall
On Tue, Aug 04, 2015 at 06:08:53PM +0100, Marc Zyngier wrote: On 04/08/15 15:32, Christoffer Dall wrote: On Fri, Jul 24, 2015 at 04:55:09PM +0100, Marc Zyngier wrote: So far, the only use of the HW interrupt facility is the timer, implying that the active state is context-switched for each

Re: [PATCH v3 10/11] KVM: arm/arm64: timer: Allow the timer to control the active state

2015-08-04 Thread Marc Zyngier
On 04/08/15 14:56, Christoffer Dall wrote: On Fri, Jul 24, 2015 at 04:55:08PM +0100, Marc Zyngier wrote: In order to remove the crude hack where we sneak the masked bit into the timer's control register, make use of the phys_irq_map API control the active state of the interrupt. This causes

Re: [PATCH v3 09/11] KVM: arm/arm64: vgic: Prevent userspace injection of a mapped interrupt

2015-08-04 Thread Eric Auger
Hi Marc, On 07/24/2015 05:55 PM, Marc Zyngier wrote: Virtual interrupts mapped to a HW interrupt should only be triggered from inside the kernel. Otherwise, you could end up confusing the kernel (and the GIC's) state machine. Rearrange the injection path so that kvm_vgic_inject_irq is used

Re: [PATCH v3 11/11] KVM: arm/arm64: vgic: Allow HW interrupts for non-shared devices

2015-08-04 Thread Marc Zyngier
On 04/08/15 15:32, Christoffer Dall wrote: On Fri, Jul 24, 2015 at 04:55:09PM +0100, Marc Zyngier wrote: So far, the only use of the HW interrupt facility is the timer, implying that the active state is context-switched for each vcpu, as the device is is shared across all vcpus. This does

Re: [PATCH v3 09/11] KVM: arm/arm64: vgic: Prevent userspace injection of a mapped interrupt

2015-08-04 Thread Marc Zyngier
On 04/08/15 14:45, Christoffer Dall wrote: On Fri, Jul 24, 2015 at 04:55:07PM +0100, Marc Zyngier wrote: Virtual interrupts mapped to a HW interrupt should only be triggered from inside the kernel. Otherwise, you could end up confusing the kernel (and the GIC's) state machine. Rearrange the

[PATCH v2 3/9] KVM: MMU: introduce rsvd_bits_validate

2015-08-04 Thread Xiao Guangrong
These two fields, rsvd_bits_mask and bad_mt_xwr, in struct kvm_mmu are used to check if reserved bits set on guest ptes, move them to a data struct so that the approach can be applied to check host shadow page table entries as well Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com ---

[PATCH v2 1/9] KVM: MMU: fix validation of mmio page fault

2015-08-04 Thread Xiao Guangrong
We got the bug that qemu complained with KVM: unknown exit, hardware reason 31 and KVM shown these info: [84245.284948] EPT: Misconfiguration. [84245.285056] EPT: GPA: 0xfeda848 [84245.285154] ept_misconfig_inspect_spte: spte 0x5eaef50107 level 4 [84245.285344] ept_misconfig_inspect_spte: spte

[PATCH v2 2/9] KVM: MMU: move FNAME(is_rsvd_bits_set) to mmu.c

2015-08-04 Thread Xiao Guangrong
FNAME(is_rsvd_bits_set) does not depend on guest mmu mode, move it to mmu.c to stop being compiled multiple times Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- arch/x86/kvm/mmu.c | 8 arch/x86/kvm/paging_tmpl.h | 13 ++--- 2 files changed, 10

[PATCH v2 5/9] KVM: MMU: split reset_rsvds_bits_mask_ept

2015-08-04 Thread Xiao Guangrong
Since shdow ept page tables and intel nested guest page tables have the same format, split reset_rsvds_bits_mask_ept so that the logic can be reused by later patches which check zero bits on sptes Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- arch/x86/kvm/mmu.c | 14

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread David Gibson
On Tue, Aug 04, 2015 at 09:54:44AM +0200, Andrew Jones wrote: On Tue, Aug 04, 2015 at 02:11:30PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread David Gibson
On Tue, Aug 04, 2015 at 09:47:59AM +0200, Andrew Jones wrote: On Tue, Aug 04, 2015 at 02:09:52PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread David Gibson
On Tue, Aug 04, 2015 at 09:47:59AM +0200, Andrew Jones wrote: On Tue, Aug 04, 2015 at 02:09:52PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-04 Thread David Gibson
On Tue, Aug 04, 2015 at 09:54:44AM +0200, Andrew Jones wrote: On Tue, Aug 04, 2015 at 02:11:30PM +1000, David Gibson wrote: On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew

RE: [PATCHv3 2/2] kvmtool: Restrict virtio queue number to 1 when vhost on

2015-08-04 Thread Du, Fan
-Original Message- From: Andre Przywara [mailto:andre.przyw...@arm.com] Sent: Tuesday, July 21, 2015 5:45 PM To: Du, Fan; Will Deacon Cc: kvm@vger.kernel.org; Marc Zyngier Subject: Re: [PATCHv3 2/2] kvmtool: Restrict virtio queue number to 1 when vhost on Hi, On 21/07/15 07:18, Fan Du

[PATCH v2 7/9] KVM: MMU: introduce is_shadow_zero_bits_set()

2015-08-04 Thread Xiao Guangrong
We have the same data struct to check reserved bits on guest page tables and shadow page tables, split is_rsvd_bits_set() so that the logic can be shared between these two paths Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- arch/x86/kvm/mmu.c | 28 +++-

[PATCH v2 8/9] KVM: MMU: fully check zero bits for sptes

2015-08-04 Thread Xiao Guangrong
The #PF with PFEC.RSV = 1 is designed to speed MMIO emulation, however, it is possible that the RSV #PF is caused by real BUG by mis-configure shadow page table entries This patch enables full check for the zero bits on shadow page table entries which include not only the reserved bit on hardware

[PATCH v2 4/9] KVM: MMU: split reset_rsvds_bits_mask

2015-08-04 Thread Xiao Guangrong
Since softmmu AMD nested shadow page tables and guest page tables have the same format, split reset_rsvds_bits_mask so that the logic can be reused by later patches which check zero bits on sptes Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- arch/x86/kvm/mmu.c | 26

[PATCH v2 9/9] KVM: VMX: drop ept misconfig check

2015-08-04 Thread Xiao Guangrong
The logic used to check ept misconfig is completely contained in common reserved bits check for sptes, so it can be removed Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- arch/x86/kvm/mmu.c | 22 arch/x86/kvm/mmu.h | 1 - arch/x86/kvm/vmx.c | 74

[PATCH v2 6/9] KVM: MMU: introduce the framework to check zero bits on sptes

2015-08-04 Thread Xiao Guangrong
We have abstracted the data struct and functions which are used to check reserved bit on guest page tables, now we extend the logic to check zero bits on shadow page tables The zero bits on sptes include not only reserved bits on hardware but also the bits sptes nerve used Signed-off-by: Xiao