FW: [PATCH kvm-unit-tests RESEND] Restore cr3 after tests on PCID

2012-09-01 Thread Mao, Junjie
The INVPCID enabling test assumes cr3[11:0] is 0. But at present PCID enabling test sets cr3[11:0] to 1 for its own purpose and doesn't restore the register, which leads to a failure when INVPCID test tries to enable PCIDE. This patch restores cr3 after PCID enabling test is done so that PCIDE can

[PATCH] KVM: x86: Check INVPCID feature bit in EBX of leaf 7

2012-09-01 Thread Mao, Junjie
Checks and operations on the INVPCID feature bit should use EBX of CPUID leaf 7 instead of ECX. Signed-off-by: Junjie Mao --- arch/x86/kvm/vmx.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index c00f03d..002b4a5 100644 --- a

[PATCH] Restore cr3 after tests on PCID

2012-09-01 Thread Mao, Junjie
The INVPCID enabling test assumes cr3[11:0] is 0. But at present PCID enabling test sets cr3[11:0] to 1 for its own purpose and doesn't restore the register, which leads to a failure when INVPCID test tries to enable PCIDE. This patch restores cr3 after PCID enabling test is done so that PCIDE can

[PATCH RESEND] Recognize PCID feature

2012-07-20 Thread Mao, Junjie
This patch makes Qemu recognize the PCID feature specified from configuration or command line options. Signed-off-by: Junjie Mao --- target-i386/cpu.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 5521709..efc6ece 100644 --

RE: [PATCH] qemu kvm: Recognize PCID feature

2012-07-18 Thread Mao, Junjie
Hi, Avi Any comments on this patch? :) > -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On > Behalf Of Mao, Junjie > Sent: Friday, July 13, 2012 12:58 PM > To: 'kvm@vger.kernel.org' > Subject: [PATCH] qemu kvm: Reco

[PATCH] qemu kvm: Recognize PCID feature

2012-07-12 Thread Mao, Junjie
This patch makes Qemu recognize the PCID feature specified from configuration or command line options. Signed-off-by: Junjie Mao --- target-i386/cpu.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 5521709..efc6ece 100644 --

[PATCH v5] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-07-01 Thread Mao, Junjie
This patch handles PCID/INVPCID for guests. Process-context identifiers (PCIDs) are a facility by which a logical processor may cache information for multiple linear-address spaces so that the processor may retain cached information when software switches to a different linear address space. Refer

RE: [PATCH v4] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-07-01 Thread Mao, Junjie
> -Original Message- > From: Avi Kivity [mailto:a...@redhat.com] > Sent: Friday, June 29, 2012 10:52 PM > To: Mao, Junjie > Cc: 'kvm@vger.kernel.org' > Subject: Re: [PATCH v4] KVM: x86: Implement PCID/INVPCID for guests with > EPT > > On 0

RE: [PATCH v4] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-06-28 Thread Mao, Junjie
> -Original Message- > From: Avi Kivity [mailto:a...@redhat.com] > Sent: Thursday, June 28, 2012 11:49 PM > To: Mao, Junjie > Cc: 'kvm@vger.kernel.org' > Subject: Re: [PATCH v4] KVM: x86: Implement PCID/INVPCID for guests with > EPT > > On 06/14/2012

RE: [PATCH v4] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-06-19 Thread Mao, Junjie
Hi, Avi Any comments for the patch? Best Regards Junjie Mao > -Original Message- > From: Marcelo Tosatti [mailto:mtosa...@redhat.com] > Sent: Saturday, June 16, 2012 10:32 AM > To: Mao, Junjie > Cc: 'kvm@vger.kernel.org'; Avi Kivity > Subject: Re: [PATCH

[PATCH v4] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-06-13 Thread Mao, Junjie
This patch handles PCID/INVPCID for guests. Process-context identifiers (PCIDs) are a facility by which a logical processor may cache information for multiple linear-address spaces so that the processor may retain cached information when software switches to a different linear address space. Refer

RE: [PATCH v3] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-06-13 Thread Mao, Junjie
Terribly sorry for the late reply. I'm out of work for some unexpected issues the last few weeks. > >> > So i think that checking whether EPT _and_ VPID are supported > >> > should be a precondition to enable PCID support for guests. > >> > > >> > >> Should this check be carried out on L0 too? If

RE: [PATCH v3] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-22 Thread Mao, Junjie
> > > > The previous patch regards PCID and INVPCID as a whole because qemu > doesn't support cpuid leaf 7 configuration at present. This is not the case > in this > version. > > > The problem with cpu_has_hypervisor check is that its Linux specific. > > > Any solution should also take into accoun

RE: [PATCH v3] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-21 Thread Mao, Junjie
> > > @@ > > > > -1711,6 +1717,22 @@ static bool vmx_rdtscp_supported(void) > > > > return cpu_has_vmx_rdtscp(); > > > > } > > > > > > > > +static bool vmx_pcid_supported(void) { > > > > + /* > > > > +* This function is only for determining whether to expose PCID > > > > bit

RE: [PATCH v3] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-20 Thread Mao, Junjie
> -Original Message- > From: Marcelo Tosatti [mailto:mtosa...@redhat.com] > Sent: Saturday, May 19, 2012 5:51 AM > To: Mao, Junjie > Cc: n...@math.technion.ac.il; 'kvm@vger.kernel.org' > Subject: Re: [PATCH v3] KVM: x86: Implement PCID/INVPCID for guests wi

[PATCH v2] Add PCID/INVPCID test

2012-05-17 Thread Mao, Junjie
Add unit test for basic functionality of PCID/INVPCID feature exposing in kvm. Changes from v1: Hard code 'invpcid' instruction Signed-off-by: Junjie Mao --- config-x86-common.mak |2 + config-x86_64.mak |3 +- x86/README|1 + x86/pcid.c| 185 +++

[PATCH v3] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-17 Thread Mao, Junjie
This patch handles PCID/INVPCID for guests. Process-context identifiers (PCIDs) are a facility by which a logical processor may cache information for multiple linear-address spaces so that the processor may retain cached information when software switches to a different linear address space. Refer

RE: [PATCH v2] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-16 Thread Mao, Junjie
> -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On > Behalf Of Mao, Junjie > Sent: Thursday, May 17, 2012 9:22 AM > To: Marcelo Tosatti > Cc: 'kvm@vger.kernel.org' > Subject: RE: [PATCH v2] KVM: x86: Implement PCI

RE: [PATCH v2] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-16 Thread Mao, Junjie
> -Original Message- > From: Marcelo Tosatti [mailto:mtosa...@redhat.com] > Sent: Tuesday, May 15, 2012 10:42 AM > To: Mao, Junjie > Cc: 'kvm@vger.kernel.org' > Subject: Re: [PATCH v2] KVM: x86: Implement PCID/INVPCID for guests with > EPT > > On Mon,

RE: [PATCH] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-14 Thread Mao, Junjie
> -Original Message- > From: Marcelo Tosatti [mailto:mtosa...@redhat.com] > Sent: Tuesday, May 15, 2012 10:20 AM > To: Mao, Junjie > Cc: Eric Northup; kvm@vger.kernel.org > Subject: Re: [PATCH] KVM: x86: Implement PCID/INVPCID for guests with EPT > > On Mon, Ma

RE: [PATCH] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-14 Thread Mao, Junjie
Best Regards Junjie Mao > -Original Message- > From: Avi Kivity [mailto:a...@redhat.com] > Sent: Sunday, May 13, 2012 6:03 PM > To: Mao, Junjie > Cc: 'kvm@vger.kernel.org' > Subject: Re: [PATCH] KVM: x86: Implement PCID/INVPCID for guests with EPT >

RE: [PATCH] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-14 Thread Mao, Junjie
> On Wed, May 9, 2012 at 5:32 PM, Mao, Junjie wrote: > > This patch handles PCID/INVPCID for guests. > > > > Process-context identifiers (PCIDs) are a facility by which a logical > > processor may cache information for multiple linear-address spaces so that > >

[PATCH kvm-unit-tests] Add PCID/INVPCID test

2012-05-13 Thread Mao, Junjie
Add unit test for basic functionality of PCID/INVPCID feature exposing in kvm. Signed-off-by: Junjie Mao --- config-x86-common.mak |2 + config-x86_64.mak |3 +- x86/README|1 + x86/pcid.c| 185 + x86/unitte

[PATCH v2] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-13 Thread Mao, Junjie
This patch handles PCID/INVPCID for guests. Process-context identifiers (PCIDs) are a facility by which a logical processor may cache information for multiple linear-address spaces so that the processor may retain cached information when software switches to a different linear address space. Refer

RE: [PATCH] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-10 Thread Mao, Junjie
> On 05/10/2012 03:32 AM, Mao, Junjie wrote: > > This patch handles PCID/INVPCID for guests. > > > > Process-context identifiers (PCIDs) are a facility by which a logical > > processor > may cache information for multiple linear-address spaces so that the processor &

qemu kvm: Accept PCID feature

2012-05-09 Thread Mao, Junjie
This patch makes Qemu accept the PCID feature specified from configuration or command line options. Signed-off-by: Mao, Junjie --- target-i386/cpuid.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index b9bfeaf..bc061b0

[PATCH] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-09 Thread Mao, Junjie
. Refer to section 4.10.1 in IA32 Intel Software Developer's Manual Volume 3A for details. For guests with EPT, the PCID feature is enabled and INVPCID behaves as running natively. For guests without EPT, the PCID feature is disabled and INVPCID triggers #UD. Signed-off-by: Mao, Junjie ---