kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] KVM: VMX: clean up declaration of VPID/EPT invalidation types
@ 2016-10-18 22:45 Jan Dakinevich
  2016-10-18 22:45 ` [PATCH 2/2] KVM: nVMX: invvpid handling improvements Jan Dakinevich
  2016-10-21 19:40 ` [PATCH 1/2] KVM: VMX: clean up declaration of VPID/EPT invalidation types Radim Krčmář
  0 siblings, 2 replies; 9+ messages in thread
From: Jan Dakinevich @ 2016-10-18 22:45 UTC (permalink / raw)
  To: kvm; +Cc: pbonzini, rkrcmar, kernellwp, Jan Dakinevich

 - Remove VMX_EPT_EXTENT_INDIVIDUAL_ADDR, since there is no such type of
   EPT invalidation

 - Rename VMX_VPID_EXTENT_ALL_CONTEXT to VMX_VPID_EXTENT_GLOBAL_CONTEXT
   for consitency: all-context VPID invalidation is referenced  by
   "global" keyword in all other places of code

 - Add missing VPID types names

Signed-off-by: Jan Dakinevich <jan.dakinevich@gmail.com>
---
 arch/x86/include/asm/vmx.h | 7 +++++--
 arch/x86/kvm/vmx.c         | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h
index a002b07..785390f 100644
--- a/arch/x86/include/asm/vmx.h
+++ b/arch/x86/include/asm/vmx.h
@@ -399,10 +399,11 @@ enum vmcs_field {
 #define IDENTITY_PAGETABLE_PRIVATE_MEMSLOT	(KVM_USER_MEM_SLOTS + 2)
 
 #define VMX_NR_VPIDS				(1 << 16)
+#define VMX_VPID_EXTENT_INDIVIDUAL_ADDR		0
 #define VMX_VPID_EXTENT_SINGLE_CONTEXT		1
-#define VMX_VPID_EXTENT_ALL_CONTEXT		2
+#define VMX_VPID_EXTENT_GLOBAL_CONTEXT		2
+#define VMX_VPID_EXTENT_SINGLE_CONTEXT_RETAINING_GLOBALS 3
 
-#define VMX_EPT_EXTENT_INDIVIDUAL_ADDR		0
 #define VMX_EPT_EXTENT_CONTEXT			1
 #define VMX_EPT_EXTENT_GLOBAL			2
 #define VMX_EPT_EXTENT_SHIFT			24
@@ -419,8 +420,10 @@ enum vmcs_field {
 #define VMX_EPT_EXTENT_GLOBAL_BIT		(1ull << 26)
 
 #define VMX_VPID_INVVPID_BIT                    (1ull << 0) /* (32 - 32) */
+#define VMX_VPID_EXTENT_INDIVIDUAL_ADDR_BIT     (1ull << 8) /* (40 - 32) */
 #define VMX_VPID_EXTENT_SINGLE_CONTEXT_BIT      (1ull << 9) /* (41 - 32) */
 #define VMX_VPID_EXTENT_GLOBAL_CONTEXT_BIT      (1ull << 10) /* (42 - 32) */
+#define VMX_VPID_EXTENT_SINGLE_CONTEXT_RETAINING_GLOBALS_BIT (1ull << 11) /* (43 - 32) */
 
 #define VMX_EPT_DEFAULT_GAW			3
 #define VMX_EPT_MAX_GAW				0x4
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index af1168e8..b727028 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1521,7 +1521,7 @@ static inline void vpid_sync_vcpu_single(int vpid)
 static inline void vpid_sync_vcpu_global(void)
 {
 	if (cpu_has_vmx_invvpid_global())
-		__invvpid(VMX_VPID_EXTENT_ALL_CONTEXT, 0, 0);
+		__invvpid(VMX_VPID_EXTENT_GLOBAL_CONTEXT, 0, 0);
 }
 
 static inline void vpid_sync_context(int vpid)
@@ -7747,7 +7747,7 @@ static int handle_invvpid(struct kvm_vcpu *vcpu)
 		 * Old versions of KVM use the single-context version so we
 		 * have to support it; just treat it the same as all-context.
 		 */
-	case VMX_VPID_EXTENT_ALL_CONTEXT:
+	case VMX_VPID_EXTENT_GLOBAL_CONTEXT:
 		__vmx_flush_tlb(vcpu, to_vmx(vcpu)->nested.vpid02);
 		nested_vmx_succeed(vcpu);
 		break;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-10-25 13:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-18 22:45 [PATCH 1/2] KVM: VMX: clean up declaration of VPID/EPT invalidation types Jan Dakinevich
2016-10-18 22:45 ` [PATCH 2/2] KVM: nVMX: invvpid handling improvements Jan Dakinevich
2016-10-21 20:02   ` Radim Krčmář
2016-10-25  8:08     ` Ladi Prosek
2016-10-25 13:40       ` Radim Krčmář
2016-10-25 13:57         ` Ladi Prosek
2016-10-25 13:58           ` Paolo Bonzini
2016-10-25 13:36     ` Paolo Bonzini
2016-10-21 19:40 ` [PATCH 1/2] KVM: VMX: clean up declaration of VPID/EPT invalidation types Radim Krčmář

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).