From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: VMX: Add PAT support for EPT Date: Tue, 09 Sep 2008 17:33:35 +0300 Message-ID: <48C6893F.6010508@qumranet.com> References: <12208741471819-git-send-email-sheng.yang@intel.com> <12208741473403-git-send-email-sheng.yang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Sheng Yang Return-path: Received: from il.qumranet.com ([212.179.150.194]:53412 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753762AbYIIOdh (ORCPT ); Tue, 9 Sep 2008 10:33:37 -0400 In-Reply-To: <12208741473403-git-send-email-sheng.yang@intel.com> Sender: kvm-owner@vger.kernel.org List-ID: Sheng Yang wrote: (some text wanted here) > diff --git a/arch/x86/kvm/vmx.h b/arch/x86/kvm/vmx.h > index 0c22e5f..16b3cfb 100644 > --- a/arch/x86/kvm/vmx.h > +++ b/arch/x86/kvm/vmx.h > @@ -62,11 +62,14 @@ > #define PIN_BASED_VIRTUAL_NMIS 0x00000020 > > #define VM_EXIT_HOST_ADDR_SPACE_SIZE 0x00000200 > +#define VM_EXIT_LOAD_GUEST_PAT 0x00004000 > #define VM_EXIT_ACK_INTR_ON_EXIT 0x00008000 > > #define VM_ENTRY_IA32E_MODE 0x00000200 > #define VM_ENTRY_SMM 0x00000400 > #define VM_ENTRY_DEACT_DUAL_MONITOR 0x00000800 > +#define VM_ENTRY_SAVE_GUEST_PAT 0x00040000 > +#define VM_ENTRY_LOAD_HOST_PAT 0x00080000 > > /* VMCS Encodings */ > enum vmcs_field { > @@ -112,6 +115,8 @@ enum vmcs_field { > VMCS_LINK_POINTER_HIGH = 0x00002801, > GUEST_IA32_DEBUGCTL = 0x00002802, > GUEST_IA32_DEBUGCTL_HIGH = 0x00002803, > + GUEST_PAT = 0x00002804, > + GUEST_PAT_HIGH = 0x00002805, > GUEST_PDPTR0 = 0x0000280a, > GUEST_PDPTR0_HIGH = 0x0000280b, > GUEST_PDPTR1 = 0x0000280c, > @@ -120,6 +125,8 @@ enum vmcs_field { > GUEST_PDPTR2_HIGH = 0x0000280f, > GUEST_PDPTR3 = 0x00002810, > GUEST_PDPTR3_HIGH = 0x00002811, > + HOST_PAT = 0x00002c00, > + HOST_PAT_HIGH = 0x00002c01, > PIN_BASED_VM_EXEC_CONTROL = 0x00004000, > CPU_BASED_VM_EXEC_CONTROL = 0x00004002, > EXCEPTION_BITMAP = 0x00004004, > This appears to be a new feature? My documentation (a bit old) doesn't show it. If so, we need a check to see that it is available. An alternative to switching PAT is to translate a guest PAT index into a host PAT index. But I guess that doesn't work with EPT? -- error compiling committee.c: too many arguments to function