Re: [PATCH v2 uq/master 2/2] x86: cpuid: reconstruct leaf 0Dh data

2013-10-02 Thread Gleb Natapov
On Fri, Sep 13, 2013 at 03:55:58PM +0200, Paolo Bonzini wrote: The data in leaf 0Dh depends on information from other feature bits. Instead of passing it blindly from the host, compute it based on whether these feature bits are enabled. Signed-off-by: Paolo Bonzini pbonz...@redhat.com ---

Re: Experiments using perf support in arm kvm guest

2013-10-02 Thread Gleb Natapov
On Mon, Sep 23, 2013 at 06:06:46PM -0600, David Ahern wrote: [Added Gleb and kvm list] Sorry for the late answer. On 9/23/13 9:53 AM, William Cohen wrote: Hi All, I was curious to see how well (or poorly) perf events work in a virtualizated environment. As a little experiment I have

Re: [PATCH v2 uq/master 2/2] x86: cpuid: reconstruct leaf 0Dh data

2013-10-02 Thread Gleb Natapov
On Wed, Oct 02, 2013 at 05:37:31PM +0200, Paolo Bonzini wrote: Il 02/10/2013 17:21, Gleb Natapov ha scritto: -if (kvm_enabled()) { -KVMState *s = cs-kvm_state; +kvm_mask = +kvm_arch_get_supported_cpuid(s, 0xd, 0, R_EAX) | +((uint64_t

Re: [PATCH v3 uq/master 2/2] x86: cpuid: reconstruct leaf 0Dh data

2013-10-02 Thread Gleb Natapov
On Wed, Oct 02, 2013 at 05:54:57PM +0200, Paolo Bonzini wrote: The data in leaf 0Dh depends on information from other feature bits. Instead of passing it blindly from the host, compute it based on whether these feature bits are enabled. Applied both. Thanks. Signed-off-by: Paolo Bonzini

Re: [GIT PULL] KVM/ARM Fixes for 3.12-rc2

2013-10-02 Thread Gleb Natapov
On Wed, Oct 02, 2013 at 01:14:57PM -0700, Olof Johansson wrote: Paolo, On Wed, Sep 25, 2013 at 2:49 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 24/09/2013 21:49, Christoffer Dall ha scritto: The following changes since commit 62d228b8c676232eca579f91cc0782b060a59097: Merge

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Gleb Natapov
On Thu, Oct 03, 2013 at 08:02:20AM +1000, Benjamin Herrenschmidt wrote: On Wed, 2013-10-02 at 13:02 +0300, Gleb Natapov wrote: Yes, I alluded to it in my email to Paul and Paolo asked also. How this interface is disabled? Also hwrnd is MMIO in a host why guest needs to use hypercall

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Gleb Natapov
On Thu, Oct 03, 2013 at 08:45:42AM +1000, Paul Mackerras wrote: On Wed, Oct 02, 2013 at 04:36:05PM +0200, Alexander Graf wrote: On 02.10.2013, at 16:33, Paolo Bonzini wrote: Il 02/10/2013 16:08, Alexander Graf ha scritto: The hwrng is accessible by host userspace via /dev/mem.

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Gleb Natapov
On Wed, Oct 02, 2013 at 11:50:50AM +0200, Alexander Graf wrote: On 02.10.2013, at 11:11, Alexander Graf wrote: On 02.10.2013, at 11:06, Benjamin Herrenschmidt wrote: On Wed, 2013-10-02 at 10:46 +0200, Paolo Bonzini wrote: Thanks. Any chance you can give some numbers of a

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Gleb Natapov
On Wed, Oct 02, 2013 at 11:57:55PM +1000, Michael Ellerman wrote: On Wed, 2013-10-02 at 13:02 +0300, Gleb Natapov wrote: On Wed, Oct 02, 2013 at 11:50:50AM +0200, Alexander Graf wrote: On 02.10.2013, at 11:11, Alexander Graf wrote: So how do you solve live migration between

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Gleb Natapov
On Wed, Oct 02, 2013 at 04:33:18PM +0200, Paolo Bonzini wrote: Il 02/10/2013 16:08, Alexander Graf ha scritto: The hwrng is accessible by host userspace via /dev/mem. A guest should live on the same permission level as a user space application. If you run QEMU as UID 1000 without access

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Gleb Natapov
On Thu, Oct 03, 2013 at 08:02:20AM +1000, Benjamin Herrenschmidt wrote: On Wed, 2013-10-02 at 13:02 +0300, Gleb Natapov wrote: Yes, I alluded to it in my email to Paul and Paolo asked also. How this interface is disabled? Also hwrnd is MMIO in a host why guest needs to use hypercall

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Gleb Natapov
On Thu, Oct 03, 2013 at 08:45:42AM +1000, Paul Mackerras wrote: On Wed, Oct 02, 2013 at 04:36:05PM +0200, Alexander Graf wrote: On 02.10.2013, at 16:33, Paolo Bonzini wrote: Il 02/10/2013 16:08, Alexander Graf ha scritto: The hwrng is accessible by host userspace via /dev/mem.

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-01 Thread Gleb Natapov
On Tue, Oct 01, 2013 at 06:34:26PM +1000, Michael Ellerman wrote: On Thu, Sep 26, 2013 at 11:06:59AM +0200, Paolo Bonzini wrote: Il 26/09/2013 08:31, Michael Ellerman ha scritto: Some powernv systems include a hwrng. Guests can access it via the H_RANDOM hcall. Is there any reason to

[PULL] KVM fixes for 3.12-rc4

2013-10-01 Thread Gleb Natapov
changes up to bcd1c2949501869631b25fd62d8df5079677a101: KVM: VMX: do not check bit 12 of EPT violation exit qualification when undefined (2013-09-25 11:38:26 +0200) Gleb Natapov (1): KVM: VMX: do not check bit 12 of EPT

Re: [PATCH v3 1/3] tile: support KVM host mode

2013-10-01 Thread Gleb Natapov
On Mon, Sep 30, 2013 at 04:11:18PM -0400, Chris Metcalf wrote: On 9/10/2013 6:53 AM, Gleb Natapov wrote: On Wed, Aug 28, 2013 at 03:45:50PM -0400, Chris Metcalf wrote: This commit enables the host side of KVM support for tilegx. [...] The commit adds a KVM_EXIT_xxx code

[PATCH] Fix NULL dereference in gfn_to_hva_prot()

2013-10-01 Thread Gleb Natapov
gfn_to_memslot() can return NULL or invalid slot. We need to check slot validity before accessing it. Signed-off-by: Gleb Natapov g...@redhat.com diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 979bff4..a9dd682 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1064,10

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-01 Thread Gleb Natapov
On Tue, Oct 01, 2013 at 06:34:26PM +1000, Michael Ellerman wrote: On Thu, Sep 26, 2013 at 11:06:59AM +0200, Paolo Bonzini wrote: Il 26/09/2013 08:31, Michael Ellerman ha scritto: Some powernv systems include a hwrng. Guests can access it via the H_RANDOM hcall. Is there any reason to

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-01 Thread Gleb Natapov
On Tue, Oct 01, 2013 at 07:23:20PM +1000, Paul Mackerras wrote: On Tue, Oct 01, 2013 at 11:39:08AM +0300, Gleb Natapov wrote: On Tue, Oct 01, 2013 at 06:34:26PM +1000, Michael Ellerman wrote: On Thu, Sep 26, 2013 at 11:06:59AM +0200, Paolo Bonzini wrote: Il 26/09/2013 08:31, Michael

Re: [RFC PATCH 3/3] kvm: Add VFIO device for handling IOMMU cache coherency

2013-09-30 Thread Gleb Natapov
On Sun, Sep 29, 2013 at 09:55:59AM -0600, Alex Williamson wrote: On Sun, 2013-09-29 at 17:44 +0300, Gleb Natapov wrote: On Sun, Sep 29, 2013 at 07:52:28AM -0600, Alex Williamson wrote: On Sun, 2013-09-29 at 16:16 +0300, Gleb Natapov wrote: On Thu, Sep 12, 2013 at 03:23:15PM -0600, Alex

Re: [RFC PATCH 09/11] kvm: simplify processor compat check

2013-09-29 Thread Gleb Natapov
On Sat, Sep 28, 2013 at 09:06:47PM +0530, Aneesh Kumar K.V wrote: Paolo Bonzini pbonz...@redhat.com writes: Il 27/09/2013 15:13, Aneesh Kumar K.V ha scritto: Alexander Graf ag...@suse.de writes: On 27.09.2013, at 12:03, Aneesh Kumar K.V wrote: From: Aneesh Kumar K.V

Re: [PATCH 1/2] KVM: Implement default IRQ routing

2013-09-29 Thread Gleb Natapov
On Thu, Sep 26, 2013 at 10:00:59AM +1000, Paul Mackerras wrote: On Mon, Sep 23, 2013 at 09:34:01PM +0300, Gleb Natapov wrote: On Mon, Sep 23, 2013 at 09:24:14PM +1000, Paul Mackerras wrote: On Sun, Sep 22, 2013 at 03:32:53PM +0300, Gleb Natapov wrote: On Tue, Sep 17, 2013 at 07:18:40PM

Re: [PATCH v5] KVM: nVMX: Fully support of nested VMX preemption timer

2013-09-29 Thread Gleb Natapov
On Thu, Sep 26, 2013 at 07:47:33PM +0200, Paolo Bonzini wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 26/09/2013 19:19, Jan Kiszka ha scritto: On 2013-09-26 17:04, Paolo Bonzini wrote: Il 16/09/2013 10:11, Arthur Chunqi Li ha scritto: This patch contains the following two

Re: [RFC PATCH 3/3] kvm: Add VFIO device for handling IOMMU cache coherency

2013-09-29 Thread Gleb Natapov
On Thu, Sep 12, 2013 at 03:23:15PM -0600, Alex Williamson wrote: So far we've succeeded at making KVM and VFIO mostly unaware of each other, but there's any important point where that breaks down. Intel VT-d hardware may or may not support snoop control. When snoop control is available,

Re: [RFC PATCH 3/3] kvm: Add VFIO device for handling IOMMU cache coherency

2013-09-29 Thread Gleb Natapov
On Sun, Sep 29, 2013 at 07:52:28AM -0600, Alex Williamson wrote: On Sun, 2013-09-29 at 16:16 +0300, Gleb Natapov wrote: On Thu, Sep 12, 2013 at 03:23:15PM -0600, Alex Williamson wrote: So far we've succeeded at making KVM and VFIO mostly unaware of each other, but there's any important

Re: [RFC PATCH 09/11] kvm: simplify processor compat check

2013-09-29 Thread Gleb Natapov
On Sun, Sep 29, 2013 at 08:35:16PM +0530, Aneesh Kumar K.V wrote: Gleb Natapov g...@redhat.com writes: On Sat, Sep 28, 2013 at 09:06:47PM +0530, Aneesh Kumar K.V wrote: Paolo Bonzini pbonz...@redhat.com writes: Il 27/09/2013 15:13, Aneesh Kumar K.V ha scritto: Alexander Graf ag

Re: [RFC PATCH 09/11] kvm: simplify processor compat check

2013-09-29 Thread Gleb Natapov
On Sat, Sep 28, 2013 at 09:06:47PM +0530, Aneesh Kumar K.V wrote: Paolo Bonzini pbonz...@redhat.com writes: Il 27/09/2013 15:13, Aneesh Kumar K.V ha scritto: Alexander Graf ag...@suse.de writes: On 27.09.2013, at 12:03, Aneesh Kumar K.V wrote: From: Aneesh Kumar K.V

Re: [PATCH 1/2] KVM: Implement default IRQ routing

2013-09-29 Thread Gleb Natapov
On Thu, Sep 26, 2013 at 10:00:59AM +1000, Paul Mackerras wrote: On Mon, Sep 23, 2013 at 09:34:01PM +0300, Gleb Natapov wrote: On Mon, Sep 23, 2013 at 09:24:14PM +1000, Paul Mackerras wrote: On Sun, Sep 22, 2013 at 03:32:53PM +0300, Gleb Natapov wrote: On Tue, Sep 17, 2013 at 07:18:40PM

Re: [RFC PATCH 09/11] kvm: simplify processor compat check

2013-09-29 Thread Gleb Natapov
On Sun, Sep 29, 2013 at 08:35:16PM +0530, Aneesh Kumar K.V wrote: Gleb Natapov g...@redhat.com writes: On Sat, Sep 28, 2013 at 09:06:47PM +0530, Aneesh Kumar K.V wrote: Paolo Bonzini pbonz...@redhat.com writes: Il 27/09/2013 15:13, Aneesh Kumar K.V ha scritto: Alexander Graf ag

Re: [PATCH] KVM: ARM: enable Cortex A7 hosts

2013-09-25 Thread Gleb Natapov
/guest.c Christoffer Dall christoffer.d...@linaro.org (supporter:KERNEL VIRTUAL MA...) Gleb Natapov g...@redhat.com (supporter:KERNEL VIRTUAL MA...) Paolo Bonzini pbonz...@redhat.com (supporter:KERNEL VIRTUAL MA...) Russell King li...@arm.linux.org.uk (maintainer:ARM PORT) kvm

[PATCH] KVM: VMX: do not check bit 12 of EPT violation exit qualification when undefined

2013-09-25 Thread Gleb Natapov
Bit 12 is undefined in any of the following cases: - If the NMI exiting VM-execution control is 1 and the virtual NMIs VM-execution control is 0. - If the VM exit sets the valid bit in the IDT-vectoring information field Signed-off-by: Gleb Natapov g...@redhat.com diff --git a/arch/x86/kvm

[PATCH 2/4] KVM: nVMX: Do not put exception that caused vmexit to IDT_VECTORING_INFO

2013-09-25 Thread Gleb Natapov
so for nested SVM, so here we just use correct function to requeue exceptions and make sure that reinjected exception is not moved to IDT_VECTORING_INFO during vmexit emulation and not re-checked for interception during delivery. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/vmx.c

[PATCH 3/4] KVM: nVMX: Check all exceptions for intercept during delivery to L2

2013-09-25 Thread Gleb Natapov
All exceptions should be checked for intercept during delivery to L2, but we check only #PF currently. Drop nested_run_pending while we are at it since exception cannot be injected during vmentry anyway. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/vmx.c | 8 +++- 1 file

[PATCH 0/4] Fix shadow-on-shadow nested VMX

2013-09-25 Thread Gleb Natapov
This series fixes shadow-on-shadow nested VMX (at least for me). Gleb Natapov (4): KVM: nVMX: Amend nested_run_pending logic KVM: nVMX: Do not put exception that caused vmexit to IDT_VECTORING_INFO KVM: nVMX: Check all exceptions for intercept during delivery to L2 KVM: nVMX: Do

[PATCH 4/4] KVM: nVMX: Do not generate #DF if #PF happens during exception delivery into L2

2013-09-25 Thread Gleb Natapov
specific function to handle page faults during page table walk that handles this case correctly. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/vmx.c | 20 1 file changed, 20 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 5bfa09d

[PATCH 1/4] KVM: nVMX: Amend nested_run_pending logic

2013-09-25 Thread Gleb Natapov
. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/vmx.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index e6e8fbc..7eb0512 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -6742,20

Re: [PATCH 3/4] KVM: nVMX: Check all exceptions for intercept during delivery to L2

2013-09-25 Thread Gleb Natapov
On Wed, Sep 25, 2013 at 12:38:20PM +0200, Paolo Bonzini wrote: Il 25/09/2013 11:51, Gleb Natapov ha scritto: All exceptions should be checked for intercept during delivery to L2, but we check only #PF currently. Drop nested_run_pending while we are at it since exception cannot be injected

Re: [PATCH 4/4] KVM: nVMX: Do not generate #DF if #PF happens during exception delivery into L2

2013-09-25 Thread Gleb Natapov
On Wed, Sep 25, 2013 at 01:24:49PM +0200, Paolo Bonzini wrote: Il 25/09/2013 11:51, Gleb Natapov ha scritto: If #PF happens during delivery of an exception into L2 and L1 also do not have the page mapped in its shadow page table then L0 needs to generate vmexit to L2 with original event

Re: [PATCH 3/4] KVM: nVMX: Check all exceptions for intercept during delivery to L2

2013-09-25 Thread Gleb Natapov
On Wed, Sep 25, 2013 at 01:25:39PM +0200, Paolo Bonzini wrote: Il 25/09/2013 13:00, Gleb Natapov ha scritto: @@ -1921,8 +1920,7 @@ static void vmx_queue_exception(struct kvm_vcpu *vcpu, unsigned nr, struct vcpu_vmx *vmx = to_vmx(vcpu); u32 intr_info = nr

Re: [PATCH 4/4] KVM: nVMX: Do not generate #DF if #PF happens during exception delivery into L2

2013-09-25 Thread Gleb Natapov
On Wed, Sep 25, 2013 at 02:08:09PM +0200, Paolo Bonzini wrote: Il 25/09/2013 13:51, Gleb Natapov ha scritto: On Wed, Sep 25, 2013 at 01:24:49PM +0200, Paolo Bonzini wrote: Il 25/09/2013 11:51, Gleb Natapov ha scritto: @@ -7773,6 +7787,9 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu

Re: [PATCH 4/4] KVM: nVMX: Do not generate #DF if #PF happens during exception delivery into L2

2013-09-25 Thread Gleb Natapov
On Wed, Sep 25, 2013 at 03:26:56PM +0200, Paolo Bonzini wrote: Il 25/09/2013 14:21, Gleb Natapov ha scritto: On Wed, Sep 25, 2013 at 02:08:09PM +0200, Paolo Bonzini wrote: Il 25/09/2013 13:51, Gleb Natapov ha scritto: On Wed, Sep 25, 2013 at 01:24:49PM +0200, Paolo Bonzini wrote: Il 25/09

Re: [PATCH 3/4] KVM: nVMX: Check all exceptions for intercept during delivery to L2

2013-09-25 Thread Gleb Natapov
On Wed, Sep 25, 2013 at 04:00:16PM +0200, Paolo Bonzini wrote: Il 25/09/2013 11:51, Gleb Natapov ha scritto: All exceptions should be checked for intercept during delivery to L2, but we check only #PF currently. Drop nested_run_pending while we are at it since exception cannot be injected

Re: [PATCH 3/4] KVM: nVMX: Check all exceptions for intercept during delivery to L2

2013-09-25 Thread Gleb Natapov
On Wed, Sep 25, 2013 at 04:22:48PM +0200, Paolo Bonzini wrote: Il 25/09/2013 16:19, Gleb Natapov ha scritto: -static int nested_pf_handled(struct kvm_vcpu *vcpu) +static int nested_ex_handled(struct kvm_vcpu *vcpu, unsigned nr) { struct vmcs12 *vmcs12 = get_vmcs12(vcpu

Re: [PATCH 1/6] kvm: Add KVM_GET_EMULATED_CPUID

2013-09-24 Thread Gleb Natapov
On Tue, Sep 24, 2013 at 11:57:00AM +0200, Borislav Petkov wrote: On Mon, September 23, 2013 6:28 pm, Eduardo Habkost wrote: On Sun, Sep 22, 2013 at 04:44:50PM +0200, Borislav Petkov wrote: From: Borislav Petkov b...@suse.de Add a kvm ioctl which states which system functionality kvm

Re: [PATCH 0/3] KVM: Make kvm_lock non-raw

2013-09-23 Thread Gleb Natapov
On Mon, Sep 23, 2013 at 03:44:21PM +0200, Paolo Bonzini wrote: Il 23/09/2013 15:36, Paul Gortmaker ha scritto: The change is not completely trivial, it splits lock. There is no obvious problem of course, otherwise you wouldn't send it and I would ack it :), but it does not mean that the

Re: [PATCH 1/2] KVM: Implement default IRQ routing

2013-09-23 Thread Gleb Natapov
On Mon, Sep 23, 2013 at 09:24:14PM +1000, Paul Mackerras wrote: On Sun, Sep 22, 2013 at 03:32:53PM +0300, Gleb Natapov wrote: On Tue, Sep 17, 2013 at 07:18:40PM +1000, Paul Mackerras wrote: This implements a simple way to express the case of IRQ routing where there is one in-kernel PIC

Re: [PATCH 1/2] KVM: Implement default IRQ routing

2013-09-23 Thread Gleb Natapov
On Mon, Sep 23, 2013 at 09:24:14PM +1000, Paul Mackerras wrote: On Sun, Sep 22, 2013 at 03:32:53PM +0300, Gleb Natapov wrote: On Tue, Sep 17, 2013 at 07:18:40PM +1000, Paul Mackerras wrote: This implements a simple way to express the case of IRQ routing where there is one in-kernel PIC

Re: [PATCH 0/3] KVM: Make kvm_lock non-raw

2013-09-22 Thread Gleb Natapov
part. Paul, could you please provide your Tested-by? Reviewed-by: Gleb Natapov g...@redhat.com But why should it go to stable? Thanks, Paolo Paolo Bonzini (3): KVM: cleanup (physical) CPU hotplug KVM: protect kvm_usage_count with its own spinlock KVM: Convert kvm_lock back

Re: [PATCH v5] KVM: nVMX: Fully support of nested VMX preemption timer

2013-09-22 Thread Gleb Natapov
VMX-preemption timer value VM-Exit controls to nVMX. With this patch, nested VMX preemption timer features are fully supported. Signed-off-by: Arthur Chunqi Li yzt...@gmail.com Reviewed-by: Gleb Natapov g...@redhat.com One more if() on vmentry path is unfortunate, but I do not see a way

Re: [PATCH 0/3] KVM: Make kvm_lock non-raw

2013-09-22 Thread Gleb Natapov
On Sun, Sep 22, 2013 at 10:53:14AM +0200, Paolo Bonzini wrote: Il 22/09/2013 09:42, Gleb Natapov ha scritto: On Mon, Sep 16, 2013 at 04:06:10PM +0200, Paolo Bonzini wrote: Paul Gortmaker reported a BUG on preempt-rt kernels, due to taking the mmu_lock within the raw kvm_lock

Re: [PATCH 1/2] KVM: Implement default IRQ routing

2013-09-22 Thread Gleb Natapov
On Tue, Sep 17, 2013 at 07:18:40PM +1000, Paul Mackerras wrote: This implements a simple way to express the case of IRQ routing where there is one in-kernel PIC and the system interrupts (GSIs) are routed 1-1 to the corresponding pins of the PIC. This is expressed by having kvm-irq_routing ==

Re: [PATCH 3/3] aarch64: kvm: introduce CONFIG_KVM_MAX_VCPUS

2013-09-18 Thread Gleb Natapov
On Tue, Sep 17, 2013 at 10:34:28PM +0100, Christoffer Dall wrote: On Sat, Sep 14, 2013 at 02:10:56PM +0200, Andrew Jones wrote: Take CONFIG_KVM_MAX_VCPUS from arm32, but set the default to 8. Signed-off-by: Andrew Jones drjo...@redhat.com --- arch/arm64/include/asm/kvm_host.h | 7

Re: [PATCH V3] Documentation/kvm: Update cpuid documentation for steal time and pv eoi

2013-09-18 Thread Gleb Natapov
On Wed, Sep 18, 2013 at 03:22:21PM +0530, Raghavendra K T wrote: On 09/12/2013 01:58 PM, Michael S. Tsirkin wrote: On Thu, Sep 12, 2013 at 01:00:11PM +0530, Raghavendra K T wrote: Thanks Michael S Tsirkin for rewriting the description and suggestions. Signed-off-by: Raghavendra K T

Re: [PATCH] [RFC] x86: kvm: remove KVM_SOFT_MAX_VCPUS

2013-09-17 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 05:22:26PM +0200, Andrew Jones wrote: On Mon, Sep 16, 2013 at 05:41:18PM +0300, Gleb Natapov wrote: On Mon, Sep 16, 2013 at 01:47:26PM +0200, Andrew Jones wrote: On Mon, Sep 16, 2013 at 11:55:17AM +0300, Gleb Natapov wrote: On Mon, Sep 16, 2013 at 10:22:09AM +0200

Re: [PATCH] [RFC] x86: kvm: remove KVM_SOFT_MAX_VCPUS

2013-09-17 Thread Gleb Natapov
On Tue, Sep 17, 2013 at 12:03:09PM +0200, Andrew Jones wrote: On Tue, Sep 17, 2013 at 12:36:19PM +0300, Gleb Natapov wrote: On Mon, Sep 16, 2013 at 05:22:26PM +0200, Andrew Jones wrote: On Mon, Sep 16, 2013 at 05:41:18PM +0300, Gleb Natapov wrote: On Mon, Sep 16, 2013 at 01:47:26PM +0200

[GIT PULL] KVM fixes for 3.12-rc2

2013-09-17 Thread Gleb Natapov
to 0be9c7a89f75072e091cd079d76194aec8d1fb09: KVM: VMX: set blocked by NMI flag if EPT violation happens during IRET from NMI (2013-09-17 19:09:47 +0300) Bruce Rogers (1): KVM: x86 emulator: emulate RETF imm Gleb Natapov (2): KVM: nEPT

Re: [Qemu-devel] [PATCH] linux-headers: update to 3.11

2013-09-17 Thread Gleb Natapov
On Wed, Sep 18, 2013 at 01:04:01PM +1000, Alexey Kardashevskiy wrote: On 09/05/2013 04:07 PM, Paolo Bonzini wrote: Il 05/09/2013 05:16, Alexey Kardashevskiy ha scritto: Sorry for my ignorance, but this is The Kernel, it is already there, broken or not, even if it is broken, qemu cannot

Re: [PATCH v4] KVM: nVMX: Fully support of nested VMX preemption timer

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 01:49:41PM +0800, Arthur Chunqi Li wrote: On Sun, Sep 15, 2013 at 8:31 PM, Gleb Natapov g...@redhat.com wrote: On Fri, Sep 06, 2013 at 10:04:51AM +0800, Arthur Chunqi Li wrote: This patch contains the following two changes: 1. Fix the bug in nested preemption timer

Re: [PATCH v4] KVM: nVMX: Fully support of nested VMX preemption timer

2013-09-16 Thread Gleb Natapov
On Fri, Sep 13, 2013 at 07:15:11PM +0200, Paolo Bonzini wrote: Il 06/09/2013 04:04, Arthur Chunqi Li ha scritto: This patch contains the following two changes: 1. Fix the bug in nested preemption timer support. If vmexit L2-L0 with some reasons not emulated by L1, preemption timer value

Re: KVM Test report, kernel 6b9e4fa0... qemu 2d1fe187...

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 06:59:18AM +, Zhou, Chao wrote: Old issues (7): -- 1. guest panic with parameter -cpu host in qemu command line (about vPMU issue).  

Re: [PATCH 2/3] arm32: kvm: rename CONFIG_KVM_ARM_MAX_VCPUS

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 09:09:27AM +0100, Marc Zyngier wrote: On 15/09/13 10:30, Gleb Natapov wrote: On Sat, Sep 14, 2013 at 02:10:55PM +0200, Andrew Jones wrote: Drop the _ARM_ part of the name. We can then introduce a config option like this to aarch64 and other arches using the same name

Re: [PATCH] x86: kvm: introduce CONFIG_KVM_MAX_VCPUS

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 10:28:20AM +0200, Andrew Jones wrote: On Sun, Sep 15, 2013 at 12:08:38PM +0300, Gleb Natapov wrote: On Sat, Sep 14, 2013 at 02:18:49PM +0200, Andrew Jones wrote: Take CONFIG_KVM_MAX_VCPUS from arm32, but set the default to 255. Signed-off-by: Andrew Jones drjo

Re: [PATCH] [RFC] x86: kvm: remove KVM_SOFT_MAX_VCPUS

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 10:22:09AM +0200, Andrew Jones wrote: [1] Actually, until 972fc544b6034a in uq/master is merged there won't be any warnings either. Signed-off-by: Andrew Jones drjo...@redhat.com --- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/x86.c

Re: [PATCH v4] KVM: nVMX: Fully support of nested VMX preemption timer

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 10:58:12AM +0200, Paolo Bonzini wrote: vmx-__launched = vmx-loaded_vmcs-launched; + if (is_guest_mode(vcpu) !(vmx-nested.nested_vmx_exit)) + nested_adjust_preemption_timer(vcpu); Please leave the assignment to __launched last, since it's already

Re: [PATCH kvm-unit-tests] Test fault during IRET from NMI.

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 11:30:58AM +0200, Paolo Bonzini wrote: Il 15/09/2013 11:56, Gleb Natapov ha scritto: On Sun, Sep 15, 2013 at 11:54:15AM +0200, Paolo Bonzini wrote: Il 15/09/2013 10:17, Gleb Natapov ha scritto: This test checks that NMI window opens only after IRET from NMI

Re: [PATCH v4] KVM: nVMX: Fully support of nested VMX preemption timer

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 11:49:40AM +0200, Paolo Bonzini wrote: Il 16/09/2013 11:09, Gleb Natapov ha scritto: On Mon, Sep 16, 2013 at 10:58:12AM +0200, Paolo Bonzini wrote: vmx-__launched = vmx-loaded_vmcs-launched; + if (is_guest_mode(vcpu) !(vmx-nested.nested_vmx_exit

Re: [PATCH v2 09/15] KVM: MMU: introduce pte-list lockless walker

2013-09-16 Thread Gleb Natapov
On Thu, Sep 05, 2013 at 06:29:12PM +0800, Xiao Guangrong wrote: The basic idea is from nulls list which uses a nulls to indicate whether the desc is moved to different pte-list Note, we should do bottom-up walk in the desc since we always move the bottom entry to the deleted position. A desc

Re: [PATCH] x86: kvm: introduce CONFIG_KVM_MAX_VCPUS

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 02:03:33PM +0200, Andrew Jones wrote: On Mon, Sep 16, 2013 at 11:47:10AM +0300, Gleb Natapov wrote: On Mon, Sep 16, 2013 at 10:28:20AM +0200, Andrew Jones wrote: On Sun, Sep 15, 2013 at 12:08:38PM +0300, Gleb Natapov wrote: On Sat, Sep 14, 2013 at 02:18:49PM +0200

Re: [PATCH v2 09/15] KVM: MMU: introduce pte-list lockless walker

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 09:52:26PM +0800, Xiao Guangrong wrote: Hi Gleb, On 09/16/2013 08:42 PM, Gleb Natapov wrote: static unsigned long *__gfn_to_rmap(gfn_t gfn, int level, struct kvm_memory_slot *slot) { @@ -4651,7 +4700,7 @@ int

Re: [PATCH] [RFC] x86: kvm: remove KVM_SOFT_MAX_VCPUS

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 01:47:26PM +0200, Andrew Jones wrote: On Mon, Sep 16, 2013 at 11:55:17AM +0300, Gleb Natapov wrote: On Mon, Sep 16, 2013 at 10:22:09AM +0200, Andrew Jones wrote: [1] Actually, until 972fc544b6034a in uq/master is merged there won't be any warnings

[PATCH] KVM: VMX: set blocked by NMI flag if EPT violation happens during IRET from NMI

2013-09-15 Thread Gleb Natapov
Set blocked by NMI flag if EPT violation happens during IRET from NMI otherwise NMI can be called recursively causing stack corruption. Signed-off-by: Gleb Natapov g...@redhat.com diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 1f1da43..fa1984c 100644 --- a/arch/x86/kvm/vmx.c +++ b

[PATCH kvm-unit-tests] Test fault during IRET from NMI.

2013-09-15 Thread Gleb Natapov
This test checks that NMI window opens only after IRET from NMI is executed without a fault. Signed-off-by: Gleb Natapov g...@redhat.com diff --git a/lib/x86/processor.h b/lib/x86/processor.h index e46d8d0..de1dc47 100644 --- a/lib/x86/processor.h +++ b/lib/x86/processor.h @@ -62,6 +62,13

Re: [PATCH] [RFC] x86: kvm: remove KVM_SOFT_MAX_VCPUS

2013-09-15 Thread Gleb Natapov
On Sat, Sep 14, 2013 at 02:16:51PM +0200, Andrew Jones wrote: This patch removes KVM_SOFT_MAX_VCPUS and uses num_online_cpus() for KVM_CAP_NR_VCPUS instead, as ARM does. While the API doc simply says KVM_CAP_NR_VCPUS should return the recommended maximum number of vcpus, it has been returning

Re: [PATCH] x86: kvm: introduce CONFIG_KVM_MAX_VCPUS

2013-09-15 Thread Gleb Natapov
On Sat, Sep 14, 2013 at 02:18:49PM +0200, Andrew Jones wrote: Take CONFIG_KVM_MAX_VCPUS from arm32, but set the default to 255. Signed-off-by: Andrew Jones drjo...@redhat.com --- arch/x86/include/asm/kvm_host.h | 5 +++-- arch/x86/kvm/Kconfig| 10 ++ 2 files changed,

Re: [PATCH kvm-unit-tests] Test fault during IRET from NMI.

2013-09-15 Thread Gleb Natapov
On Sun, Sep 15, 2013 at 11:54:15AM +0200, Paolo Bonzini wrote: Il 15/09/2013 10:17, Gleb Natapov ha scritto: This test checks that NMI window opens only after IRET from NMI is executed without a fault. Signed-off-by: Gleb Natapov g...@redhat.com Reviewed-by: Paolo Bonzini pbonz

Re: [PATCH 2/3] arm32: kvm: rename CONFIG_KVM_ARM_MAX_VCPUS

2013-09-15 Thread Gleb Natapov
On Sat, Sep 14, 2013 at 02:10:55PM +0200, Andrew Jones wrote: Drop the _ARM_ part of the name. We can then introduce a config option like this to aarch64 and other arches using the same name - allowing grep to show them all. Also update the help text to describe the option more completely.

Re: [PATCH v2 00/15] KVM: MMU: locklessly wirte-protect

2013-09-15 Thread Gleb Natapov
Marcelo do you feel your comments are addressed in patches 3 and 5 of this series? On Thu, Sep 05, 2013 at 06:29:03PM +0800, Xiao Guangrong wrote: Changelog v2: - the changes from Gleb's review: 1) fix calculating the number of spte in the pte_list_add() 2) set iter-desc to NULL if meet

Re: [PATCH v2 0/2] KVM: s390: add floating irq controller

2013-09-15 Thread Gleb Natapov
On Fri, Sep 06, 2013 at 03:30:38PM +0200, Christian Borntraeger wrote: On 06/09/13 14:19, Jens Freimann wrote: This series adds a kvm_device that acts as a irq controller for floating interrupts. As a first step it implements functionality to retrieve and inject interrupts for the

Re: [PATCH v3 1/6] KVM: nVMX: Replace kvm_set_cr0 with vmx_set_cr0 in load_vmcs12_host_state

2013-09-15 Thread Gleb Natapov
On Tue, Sep 10, 2013 at 09:14:14PM +0800, Arthur Chunqi Li wrote: On Mon, Sep 2, 2013 at 4:21 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Aug 08, 2013 at 04:26:28PM +0200, Jan Kiszka wrote: Likely a typo, but a fatal one as kvm_set_cr0 performs checks on the Not a typo :) That what Avi

Re: [PATCH v4] KVM: nVMX: Fully support of nested VMX preemption timer

2013-09-15 Thread Gleb Natapov
On Fri, Sep 06, 2013 at 10:04:51AM +0800, Arthur Chunqi Li wrote: This patch contains the following two changes: 1. Fix the bug in nested preemption timer support. If vmexit L2-L0 with some reasons not emulated by L1, preemption timer value should be save in such exits. 2. Add support of Save

Re: The state of vmexit/vmenter MSR store/load in nested vmx

2013-09-12 Thread Gleb Natapov
On Fri, Sep 13, 2013 at 10:08:09AM +0800, Arthur Chunqi Li wrote: Hi Jan and maillist, Does nest VMX support vmexit MSR store/load and vmenter MSR load now? I tried to set VM-exit MSR-store address with valid address and set VM-exit MSR-store count to 1, then the vmenter fails. Anything else

Re: How to recreate MOV-SS blocking vmentry fail

2013-09-11 Thread Gleb Natapov
On Wed, Sep 11, 2013 at 08:49:28PM +0800, Arthur Chunqi Li wrote: Hi Gleb, Paolo and related folks, I was trying to recreate MOV-SS blocking vmentry fail (Intel SDM 26.1, 5. a). Here the manual refers to Table 24-3, but later in 26.3.1.5 also describe it. I got confused how this scenario can

Re: How to recreate MOV-SS blocking vmentry fail

2013-09-11 Thread Gleb Natapov
On Wed, Sep 11, 2013 at 08:55:41PM +0800, Arthur Chunqi Li wrote: On Wed, Sep 11, 2013 at 8:53 PM, Gleb Natapov g...@redhat.com wrote: On Wed, Sep 11, 2013 at 08:49:28PM +0800, Arthur Chunqi Li wrote: Hi Gleb, Paolo and related folks, I was trying to recreate MOV-SS blocking vmentry fail

Re: How to recreate MOV-SS blocking vmentry fail

2013-09-11 Thread Gleb Natapov
On Wed, Sep 11, 2013 at 03:01:07PM +0200, Paolo Bonzini wrote: Il 11/09/2013 14:53, Gleb Natapov ha scritto: I was trying to recreate MOV-SS blocking vmentry fail (Intel SDM 26.1, 5. a). Here the manual refers to Table 24-3, but later in 26.3.1.5 also describe it. I got confused how

Re: How to recreate MOV-SS blocking vmentry fail

2013-09-11 Thread Gleb Natapov
On Wed, Sep 11, 2013 at 09:04:26PM +0800, Arthur Chunqi Li wrote: On Wed, Sep 11, 2013 at 9:03 PM, Gleb Natapov g...@redhat.com wrote: On Wed, Sep 11, 2013 at 03:01:07PM +0200, Paolo Bonzini wrote: Il 11/09/2013 14:53, Gleb Natapov ha scritto: I was trying to recreate MOV-SS blocking

Re: Correct way of tracking reads on given gfn ?

2013-09-10 Thread Gleb Natapov
On Tue, Sep 10, 2013 at 09:12:11AM +0800, Arthur Chunqi Li wrote: On Mon, Sep 9, 2013 at 8:29 PM, Gleb Natapov g...@redhat.com wrote: On Mon, Sep 09, 2013 at 12:53:02PM +0200, Paolo Bonzini wrote: Il 09/09/2013 12:22, SPA ha scritto: Thanks Paolo. Is there a way where reads would

Re: [PATCH v2] KVM: x86 emulator: emulate RETF imm

2013-09-10 Thread Gleb Natapov
On Mon, Sep 09, 2013 at 09:40:20AM -0600, Bruce Rogers wrote: Opcode CA This gets used by a DOS based NetWare guest. Signed-off-by: Bruce Rogers brog...@suse.com Reviewed-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c | 14 +- 1 files changed, 13 insertions

Re: [PATCH uq/master 1/2] x86: fix migration from pre-version 12

2013-09-09 Thread Gleb Natapov
On Mon, Sep 09, 2013 at 10:31:15AM +0200, Paolo Bonzini wrote: Il 08/09/2013 13:40, Gleb Natapov ha scritto: On Thu, Sep 05, 2013 at 03:06:21PM +0200, Paolo Bonzini wrote: On KVM, the KVM_SET_XSAVE would be executed with a 0 xstate_bv, and not restore anything. XRSTOR restores FP/SSE

Re: [PATCH uq/master 2/2] KVM: make XSAVE support more robust

2013-09-09 Thread Gleb Natapov
On Mon, Sep 09, 2013 at 10:51:58AM +0200, Paolo Bonzini wrote: Il 08/09/2013 13:52, Gleb Natapov ha scritto: On Thu, Sep 05, 2013 at 03:06:22PM +0200, Paolo Bonzini wrote: QEMU moves state from CPUArchState to struct kvm_xsave and back when it invokes the KVM_*_XSAVE ioctls. Because

Re: [PATCH uq/master 2/2] KVM: make XSAVE support more robust

2013-09-09 Thread Gleb Natapov
On Mon, Sep 09, 2013 at 11:50:03AM +0200, Paolo Bonzini wrote: Il 09/09/2013 11:18, Gleb Natapov ha scritto: On Mon, Sep 09, 2013 at 10:51:58AM +0200, Paolo Bonzini wrote: Il 08/09/2013 13:52, Gleb Natapov ha scritto: On Thu, Sep 05, 2013 at 03:06:22PM +0200, Paolo Bonzini wrote: QEMU

Re: [PATCH uq/master 1/2] x86: fix migration from pre-version 12

2013-09-09 Thread Gleb Natapov
On Mon, Sep 09, 2013 at 11:53:45AM +0200, Paolo Bonzini wrote: Il 09/09/2013 11:03, Gleb Natapov ha scritto: On Mon, Sep 09, 2013 at 10:31:15AM +0200, Paolo Bonzini wrote: Il 08/09/2013 13:40, Gleb Natapov ha scritto: On Thu, Sep 05, 2013 at 03:06:21PM +0200, Paolo Bonzini wrote: On KVM

Re: [PATCH uq/master 1/2] x86: fix migration from pre-version 12

2013-09-09 Thread Gleb Natapov
On Mon, Sep 09, 2013 at 01:54:50PM +0300, Gleb Natapov wrote: On Mon, Sep 09, 2013 at 11:53:45AM +0200, Paolo Bonzini wrote: Il 09/09/2013 11:03, Gleb Natapov ha scritto: On Mon, Sep 09, 2013 at 10:31:15AM +0200, Paolo Bonzini wrote: Il 08/09/2013 13:40, Gleb Natapov ha scritto: On Thu

Re: [PATCH uq/master 1/2] x86: fix migration from pre-version 12

2013-09-09 Thread Gleb Natapov
On Mon, Sep 09, 2013 at 01:07:37PM +0200, Paolo Bonzini wrote: In fact, another bug is that kvm_vcpu_ioctl_x86_set_xsave ignores xstate_bv when XSAVE is not available. Instead, it should reset the FXSAVE data to processor-reset values (except for MXCSR which always comes from XRSTOR

Re: [PATCH uq/master 1/2] x86: fix migration from pre-version 12

2013-09-09 Thread Gleb Natapov
On Mon, Sep 09, 2013 at 01:46:49PM +0200, Paolo Bonzini wrote: Yes. QEMU unmarshals information from the XSAVE region and back, so it cannot support MPX or AVX-512 yet (even if KVM were). Separate bug, though. IMO this is the main issue here, not separate bug. If we gonna let guest

Re: Correct way of tracking reads on given gfn ?

2013-09-09 Thread Gleb Natapov
On Mon, Sep 09, 2013 at 12:53:02PM +0200, Paolo Bonzini wrote: Il 09/09/2013 12:22, SPA ha scritto: Thanks Paolo. Is there a way where reads would trap ? I explored a bit on PM_PRESENT_MASK. Though its not READ bit, but a PRESENT bit, it looks like it should generate traps on

Re: [PATCH] KVM: x86 emulator: emulate RETF imm

2013-09-09 Thread Gleb Natapov
On Mon, Sep 09, 2013 at 07:09:15AM -0600, Bruce Rogers wrote: On 9/8/2013 at 07:13 AM, Gleb Natapov g...@redhat.com wrote: On Tue, Sep 03, 2013 at 01:42:09PM -0600, Bruce Rogers wrote: Opcode CA This gets used by a DOS based NetWare guest. Signed-off-by: Bruce Rogers brog

Re: [PATCH] KVM: x86: prevent setting unsupported XSAVE states

2013-09-09 Thread Gleb Natapov
On Mon, Sep 09, 2013 at 04:09:47PM +0200, Paolo Bonzini wrote: Il 08/09/2013 11:54, Gleb Natapov ha scritto: On Thu, Sep 05, 2013 at 02:21:54PM +0200, Paolo Bonzini wrote: A guest can still attempt to save and restore XSAVE states even if they have been masked in CPUID leaf 0Dh

Re: [PATCH 0/2] kvm: fix a bug and remove a redundancy in async_pf

2013-09-08 Thread Gleb Natapov
On Wed, Sep 04, 2013 at 10:32:22PM +0200, Radim Krčmář wrote: I did not reproduce the bug fixed in [1/2], but there are not that many reasons why we could not unload a module, so the spot is quite obvious. Reviewed-by: Gleb Natapov g...@redhat.com Radim Krčmář (2): kvm: free resources

Re: [PATCH v4] KVM: nVMX: Replace kvm_set_cr0 with vmx_set_cr0 in load_vmcs12_host_state

2013-09-08 Thread Gleb Natapov
-host_cr0); /* * If we did fpu_activate()/fpu_deactivate() during L2's run, we need * to apply the same changes to L1's vmcs. We just set cr0 correctly, For this one and 2,4,6 of the series: Reviewed-by: Gleb Natapov g...@redhat.com -- Gleb

Re: [PATCH v2] KVM: mmu: allow page tables to be in read-only slots

2013-09-08 Thread Gleb Natapov
and dirty bits. Note that this scenario is not supported by NPT at all, as explained by comments in the code. Cc: sta...@vger.kernel.org Cc: kvm@vger.kernel.org Cc: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Cc: Gleb Natapov g...@redhat.com Signed-off-by: Paolo Bonzini pbonz

Re: [PATCH] KVM: x86: prevent setting unsupported XSAVE states

2013-09-08 Thread Gleb Natapov
. Cc: kvm@vger.kernel.org Cc: Gleb Natapov g...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/kvm/cpuid.c | 2 +- arch/x86/kvm/x86.c | 10 -- arch/x86/kvm/x86.h | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm

<    1   2   3   4   5   6   7   8   9   10   >