Re: [PATCH 1/2] KVM: MMU: fix SMAP virtualization

2015-06-10 Thread Davidlohr Bueso
On Wed, 2015-05-27 at 10:53 +0800, Xiao Guangrong wrote: > > On 05/26/2015 10:48 PM, Paolo Bonzini wrote: > > > > > > On 26/05/2015 16:45, Edward Cree wrote: > This breaks older compilers that can't initialize anon structures. > > How old ? Even gcc 3.1 says you can use unnamed stru

Re: [PATCH] x86 spinlock: Fix memory corruption on completing completions

2015-02-06 Thread Davidlohr Bueso
On Fri, 2015-02-06 at 16:15 -0500, Sasha Levin wrote: > On 02/06/2015 02:42 PM, Davidlohr Bueso wrote: > > On Fri, 2015-02-06 at 08:25 -0800, Linus Torvalds wrote: > >> On Fri, Feb 6, 2015 at 6:49 AM, Raghavendra K T > >> wrote: > >>> Paravirt spinlock

Re: [PATCH] x86 spinlock: Fix memory corruption on completing completions

2015-02-06 Thread Davidlohr Bueso
On Fri, 2015-02-06 at 08:25 -0800, Linus Torvalds wrote: > On Fri, Feb 6, 2015 at 6:49 AM, Raghavendra K T > wrote: > > Paravirt spinlock clears slowpath flag after doing unlock. > [ fix edited out ] > > So I'm not going to be applying this for 3.19, because it's much too > late and the patch is

Re: [PATCH 1/2] KVM: nVMX: Fix nested vmexit ack intr before load vmcs01

2014-08-04 Thread Davidlohr Bueso
On Fri, 2014-08-01 at 16:12 +0800, Wanpeng Li wrote: > External interrupt will cause L1 vmexit w/ reason external interrupt when L2 > is > running. Then L1 will pick up the interrupt through vmcs12 if L1 set the ack > interrupt bit. Commit 77b0f5d (KVM: nVMX: Ack and write vector info to > intr

Re: [PATCH] KVM: VMX: invalidate vpid for invlpg instruction

2012-09-05 Thread Davidlohr Bueso
On Mon, 2012-09-03 at 12:11 +0300, Avi Kivity wrote: > On 09/03/2012 02:27 AM, Davidlohr Bueso wrote: > > On Fri, 2012-08-31 at 14:37 -0300, Marcelo Tosatti wrote: > >> On Fri, Aug 31, 2012 at 06:10:48PM +0200, Davidlohr Bueso wrote: > >> > For processors that supp

Re: [PATCH] KVM: VMX: invalidate vpid for invlpg instruction

2012-09-02 Thread Davidlohr Bueso
On Fri, 2012-08-31 at 14:37 -0300, Marcelo Tosatti wrote: > On Fri, Aug 31, 2012 at 06:10:48PM +0200, Davidlohr Bueso wrote: > > For processors that support VPIDs we should invalidate the page table entry > > specified by the lineal address. For this purpose add support for individ

[PATCH] KVM: VMX: invalidate vpid for invlpg instruction

2012-08-31 Thread Davidlohr Bueso
For processors that support VPIDs we should invalidate the page table entry specified by the lineal address. For this purpose add support for individual address invalidations. Signed-off-by: Davidlohr Bueso --- arch/x86/include/asm/vmx.h |6 -- arch/x86/kvm/vmx.c | 15

Re: KVM: MMU: Tracking guest writes through EPT entries ?

2012-08-30 Thread Davidlohr Bueso
On Tue, 2012-07-31 at 14:53 -0400, Sunil Agham wrote: > On Mon, Jul 30, 2012 at 10:49 PM, Xiao Guangrong > wrote: > > On 07/31/2012 01:18 AM, Sunil wrote: > >> Hello List, > >> > >> I am a KVM newbie and studying KVM mmu code. > >> > >> On the existing guest, I am trying to track all guest writes

Re: [PATCH] x86, amd: rename vmmu support capability

2012-07-14 Thread Davidlohr Bueso
On Sat, 2012-07-14 at 15:38 +0200, H. Peter Anvin wrote: > Yep, NAK on this one. Ok, we could at least add a comment when defining X86_FEATURE_NPT. Thanks, Davidlohr > > Borislav Petkov wrote: > > >On Fri, Jul 13, 2012 at 08:02:55PM +0200, Davidlohr Bueso wrote: > >

Re: [PATCH] x86, amd: rename vmmu support capability

2012-07-14 Thread Davidlohr Bueso
On Sat, 2012-07-14 at 12:19 +0200, Borislav Petkov wrote: > On Fri, Jul 13, 2012 at 08:02:55PM +0200, Davidlohr Bueso wrote: > > From: Davidlohr Bueso > > > > AMD has renamed nested page table technology to rapid virtualization > > indexing, > >

[PATCH] x86, amd: rename vmmu support capability

2012-07-13 Thread Davidlohr Bueso
From: Davidlohr Bueso AMD has renamed nested page table technology to rapid virtualization indexing, reflect this change in the kernel. Signed-off-by: Davidlohr Bueso --- arch/x86/include/asm/cpufeature.h |2 +- arch/x86/kernel/cpu/scattered.c |2 +- arch/x86/kvm/svm.c

Re: [PATCH] kvm_para_available() should check hypervisor bit before accessing hypervisor cpuid leaf.

2012-04-30 Thread Davidlohr Bueso
On Mon, 2012-04-30 at 14:45 +0300, Gleb Natapov wrote: > This couid range does not exist on real HW and Intel spec says that > "Information returned for highest basic information leaf" will be > returned. Not very well defined. > > Signed-off-by: Gleb Natapov > diff --git a/arch/x86/include/asm/

[PATCH] KVM: MMU: use page table level macro

2012-04-18 Thread Davidlohr Bueso
From: Davidlohr Bueso Its much cleaner to use PT_PAGE_TABLE_LEVEL than its numeric value. Signed-off-by: Davidlohr Bueso --- arch/x86/kvm/mmu.c |2 +- arch/x86/kvm/paging_tmpl.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86

Re: [PATCH v2] KVM: x86: add paging gcc optimization

2012-03-24 Thread Davidlohr Bueso
On Mon, 2012-03-12 at 14:12 +0200, Avi Kivity wrote: > On 03/08/2012 05:47 PM, Christian Borntraeger wrote: > > On 08/03/12 12:45, Davidlohr Bueso wrote: > > > From: Davidlohr Bueso > > > > > > Since most guests will have paging enabled for memory manageme

[PATCH] KVM: VMX: call invvpid only when EPT is disabled

2012-03-14 Thread Davidlohr Bueso
From: Davidlohr Bueso With EPT enabled it is not required to explicitly run invvpid to invalidate tagged TLB entries, as KVM does not force vm-exits for cr3 writes and invlpg. Run invvpid only when these instructions are emulated and shadow pages are used. Signed-off-by: Davidlohr Bueso

Re: [PATCH] KVM: VMX: add tracepoint for vpids

2012-03-13 Thread Davidlohr Bueso
On Mon, 2012-03-12 at 12:34 +0200, Avi Kivity wrote: > On 03/12/2012 01:29 PM, Davidlohr Bueso wrote: > > On Mon, 2012-03-12 at 10:22 +0200, Avi Kivity wrote: > > > On 03/11/2012 05:57 PM, Davidlohr Bueso wrote: > > > > From: Davidlohr Bueso > > >

Re: [PATCH] KVM: VMX: add tracepoint for vpids

2012-03-12 Thread Davidlohr Bueso
On Mon, 2012-03-12 at 10:22 +0200, Avi Kivity wrote: > On 03/11/2012 05:57 PM, Davidlohr Bueso wrote: > > From: Davidlohr Bueso > > > > Add a new tracepoint for vpid allocation and freeing associated to all > > vCPUs. > > > > Why? > We have been using

[PATCH] KVM: VMX: add tracepoint for vpids

2012-03-11 Thread Davidlohr Bueso
From: Davidlohr Bueso Add a new tracepoint for vpid allocation and freeing associated to all vCPUs. Signed-off-by: Davidlohr Bueso --- arch/x86/kvm/trace.h | 23 +++ arch/x86/kvm/vmx.c |5 - arch/x86/kvm/x86.c |1 + 3 files changed, 28 insertions(+), 1

Re: [PATCH v2] KVM: x86: add paging gcc optimization

2012-03-08 Thread Davidlohr Bueso
On Thu, 2012-03-08 at 16:47 +0100, Christian Borntraeger wrote: > On 08/03/12 12:45, Davidlohr Bueso wrote: > > From: Davidlohr Bueso > > > > Since most guests will have paging enabled for memory management, add > > likely() optimization > > around CR0.PG

Re: [PATCH] KVM: x86: add paging gcc optimization

2012-03-08 Thread Davidlohr Bueso
On Thu, 2012-03-08 at 11:45 +0200, Avi Kivity wrote: > On 03/07/2012 10:02 PM, Davidlohr Bueso wrote: > > From: Davidlohr Bueso > > > > Since most guests will have paging enabled for memory management, add > > likely() and unlikely() > > optimizations around i

[PATCH v2] KVM: x86: add paging gcc optimization

2012-03-08 Thread Davidlohr Bueso
From: Davidlohr Bueso Since most guests will have paging enabled for memory management, add likely() optimization around CR0.PG checks. Signed-off-by: Davidlohr Bueso --- arch/x86/kvm/x86.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86.h b/arch

[PATCH] KVM: x86: add paging gcc optimization

2012-03-07 Thread Davidlohr Bueso
From: Davidlohr Bueso Since most guests will have paging enabled for memory management, add likely() and unlikely() optimizations around is_paging() checks. Signed-off-by: Davidlohr Bueso --- arch/x86/kvm/mmu.c |6 +++--- arch/x86/kvm/svm.c |6 +++--- arch/x86/kvm/vmx.c | 16

[PATCH] kvm: mmu: make use of ->root_level in reset_rsvds_bits_mask

2012-03-05 Thread Davidlohr Bueso
From: Davidlohr Bueso The reset_rsvds_bits_mask() function can use the guest walker's root level number instead of using a separate 'level' variable. Signed-off-by: Davidlohr Bueso --- arch/x86/kvm/mmu.c | 31 +++ 1 files changed, 15 insertions(+

tracing get_pages

2012-02-17 Thread Davidlohr Bueso
Hi, I'm trying to trace some guest physical pages by running: cmd-trace record -e kvmmmu:kvm_mmu_get_page However, when reporting I'm running into error messages like the following: ... failed to read event print fmt for kvm_emulate_insn Error: expected type 4 but read 7 Error: expected ty

[PATCH v2] KVM: SVM: comment nested paging and virtualization module parameters

2012-01-17 Thread Davidlohr Bueso
From: Davidlohr Bueso Also use true instead of 1 for enabling by default. Signed-off-by: Davidlohr Bueso --- arch/x86/kvm/svm.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index fce3ba0..7bbd17c 100644 --- a/arch/x86

[PATCH] KVM: SVM: comment nested paging and virtualization module parameters

2012-01-13 Thread Davidlohr Bueso
From: Davidlohr Bueso Also use true instead of 1 for enabling by default. Signed-off-by: Davidlohr Bueso --- arch/x86/kvm/svm.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 5fa553b..3c9b0dc 100644 --- a/arch/x86

Re: [PATCH] KVM: MMU: increment stats after event occurrence

2012-01-13 Thread Davidlohr Bueso
On Fri, 2012-01-13 at 10:24 +0900, Takuya Yoshikawa wrote: > (2012/01/13 10:08), Davidlohr Bueso wrote: > > From: Davidlohr Bueso > > > > It makes more sense to actually increment statistics for tlb flushes and > > page table entry updates after such _events_ occur,

[PATCH] KVM: MMU: increment stats after event occurrence

2012-01-12 Thread Davidlohr Bueso
From: Davidlohr Bueso It makes more sense to actually increment statistics for tlb flushes and page table entry updates after such _events_ occur, instead of before. Signed-off-by: Davidlohr Bueso --- arch/x86/kvm/mmu.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff

Re: [PATCH] KVM: MMU: unnecessary NX state assignment

2012-01-10 Thread Davidlohr Bueso
ping On Fri, 2012-01-06 at 15:06 +0100, Davidlohr Bueso wrote: > From: Davidlohr Bueso > > We can remove the first ->nx state assignment since it is assigned afterwards > anyways. > > Signed-off-by: Davidlohr Bueso > --- > arch/x86/kvm/mmu.c |1 - > 1 fil

[PATCH] KVM: MMU: unnecessary NX state assignment

2012-01-06 Thread Davidlohr Bueso
From: Davidlohr Bueso We can remove the first ->nx state assignment since it is assigned afterwards anyways. Signed-off-by: Davidlohr Bueso --- arch/x86/kvm/mmu.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index f1b3