Skip to contentSkip to conversation

KVM: nVMX: Advertise IA32_PAT in VM exit control

PATCH Superseded Arthur Chunqi Li 3 participants 8 messages Aug 5, 2013

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: nVMX: Advertise IA32_PAT in VM exit control

Advertise VM_EXIT_SAVE_IA32_PAT and VM_EXIT_LOAD_IA32_PAT.

---
 arch/x86/kvm/vmx.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kvm/vmx.c +2 -1
index 45fd70c..240f0db 100644
@@ -2198,7 +2198,8 @@ static __init void nested_vmx_setup_ctls_msrs(void)
 #else
 	nested_vmx_exit_ctls_high = 0;
 #endif
-	nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR;
+	nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR |
+		VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT;
 
 	/* entry controls */
 	rdmsr(MSR_IA32_VMX_ENTRY_CTLS,
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 12 lines · Arthur Chunqi Li

Advertise VM_EXIT_SAVE_IA32_PAT and VM_EXIT_LOAD_IA32_PAT.

---
 arch/x86/kvm/vmx.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kvm/vmx.c +0 -0
index 45fd70c..240f0db 100644

arch/x86/kvm/vmx.c static __init void nested_vmx_setup_ctls_msrs(void) · line 2203

Quoted 7 lines
arch/x86/kvm/vmx.c +2 -1
@@ -2198,7 +2198,8 @@ static __init void nested_vmx_setup_ctls_msrs(void)
 #else
 	nested_vmx_exit_ctls_high = 0;
 #endif
-	nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR;
+	nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR |
+		VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT;
 

You should not set those if host does not support them, otherwise GUEST_IA32_PAT may not be available.

--
Gleb.

author
#2 lore raw
Quoted 10 lines · Arthur Chunqi Li
Quoted 7 lines

Advertise VM_EXIT_SAVE_IA32_PAT and VM_EXIT_LOAD_IA32_PAT.

---
arch/x86/kvm/vmx.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 14 lines

arch/x86/kvm/vmx.c static __init void nested_vmx_setup_ctls_msrs(void) · line 2203

Quoted 12 lines
arch/x86/kvm/vmx.c +2 -1
index 45fd70c..240f0db 100644
@@ -2198,7 +2198,8 @@ static __init void nested_vmx_setup_ctls_msrs(void)
 #else
   nested_vmx_exit_ctls_high = 0;
 #endif
-    nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR;
+    nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR |
+        VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT;
 

You should not set those if host does not support them, otherwise GUEST_IA32_PAT may not be available

To Jan,
Is this different from IA32_EFER?

Arthur

Quoted 3 lines

--
Gleb.

#3 lore raw
Quoted 24 lines · Gmail
Quoted 10 lines · Arthur Chunqi Li
Quoted 7 lines

Advertise VM_EXIT_SAVE_IA32_PAT and VM_EXIT_LOAD_IA32_PAT.

---
arch/x86/kvm/vmx.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 14 lines

arch/x86/kvm/vmx.c static __init void nested_vmx_setup_ctls_msrs(void) · line 2203

Quoted 12 lines
arch/x86/kvm/vmx.c +2 -1
index 45fd70c..240f0db 100644
@@ -2198,7 +2198,8 @@ static __init void nested_vmx_setup_ctls_msrs(void)
 #else
   nested_vmx_exit_ctls_high = 0;
 #endif
-    nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR;
+    nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR |
+        VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT;
 

You should not set those if host does not support them, otherwise GUEST_IA32_PAT may not be available

Quoted 2 lines

To Jan,
Is this different from IA32_EFER?

As we use a real VMCS to keep GUEST/HOST_IA32_EFER, we actually do depend on the existence of the host feature. So my patch requires an update as you noted.

Jan

#4 lore raw
Quoted 25 lines · Jan Kiszka
Quoted 24 lines · Gmail
Quoted 24 lines · Arthur Chunqi Li
Quoted 12 lines

Advertise VM_EXIT_SAVE_IA32_PAT and VM_EXIT_LOAD_IA32_PAT.

---
arch/x86/kvm/vmx.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kvm/vmx.c +0 -0
index 45fd70c..240f0db 100644

arch/x86/kvm/vmx.c static __init void nested_vmx_setup_ctls_msrs(void) · line 2203

Quoted 7 lines
arch/x86/kvm/vmx.c +2 -1
@@ -2198,7 +2198,8 @@ static __init void nested_vmx_setup_ctls_msrs(void)
 #else
   nested_vmx_exit_ctls_high = 0;
 #endif
-    nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR;
+    nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR |
+        VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT;
 

You should not set those if host does not support them, otherwise GUEST_IA32_PAT may not be available

Quoted 7 lines
Quoted 2 lines

To Jan,
Is this different from IA32_EFER?

As we use a real VMCS to keep GUEST/HOST_IA32_EFER, we actually do depend on the existence of the host feature. So my patch requires an update as you noted.

Your patch didn't add new users of GUEST_IA32_PAT and VM_ENTRY_LOAD_IA32_PAT is enabled by nested only if host has it, so I am not sure why you are saying that patch should be updated.

--
Gleb.

#5 lore raw
Quoted 29 lines · Gleb Natapov
Quoted 28 lines · Jan Kiszka
Quoted 26 lines · Gmail
Quoted 10 lines · Arthur Chunqi Li
Quoted 7 lines

Advertise VM_EXIT_SAVE_IA32_PAT and VM_EXIT_LOAD_IA32_PAT.

---
arch/x86/kvm/vmx.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 14 lines

arch/x86/kvm/vmx.c static __init void nested_vmx_setup_ctls_msrs(void) · line 2203

Quoted 12 lines
arch/x86/kvm/vmx.c +2 -1
index 45fd70c..240f0db 100644
@@ -2198,7 +2198,8 @@ static __init void nested_vmx_setup_ctls_msrs(void)
 #else
   nested_vmx_exit_ctls_high = 0;
 #endif
-    nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR;
+    nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR |
+        VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT;
 

You should not set those if host does not support them, otherwise GUEST_IA32_PAT may not be available

To Jan,
Is this different from IA32_EFER?

Quoted 7 lines
Quoted 4 lines

As we use a real VMCS to keep GUEST/HOST_IA32_EFER, we actually do depend on the existence of the host feature. So my patch requires an update as you noted.

Your patch didn't add new users of GUEST_IA32_PAT and VM_ENTRY_LOAD_IA32_PAT is enabled by nested only if host has it, so I am not sure why you are saying that patch should be updated.

I think Jan points [1] and you refer to another.

[1] http://www.mail-archive.com/[email protected]/msg94188.html

Arthur

Quoted 4 lines

--
Gleb.

#6 lore raw
Quoted 34 lines · Arthur Chunqi Li
Quoted 33 lines · Gleb Natapov
Quoted 32 lines · Jan Kiszka
Quoted 24 lines · Gmail
Quoted 10 lines · Arthur Chunqi Li
Quoted 7 lines

Advertise VM_EXIT_SAVE_IA32_PAT and VM_EXIT_LOAD_IA32_PAT.

---
arch/x86/kvm/vmx.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 14 lines

arch/x86/kvm/vmx.c static __init void nested_vmx_setup_ctls_msrs(void) · line 2203

Quoted 12 lines
arch/x86/kvm/vmx.c +2 -1
index 45fd70c..240f0db 100644
@@ -2198,7 +2198,8 @@ static __init void nested_vmx_setup_ctls_msrs(void)
 #else
   nested_vmx_exit_ctls_high = 0;
 #endif
-    nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR;
+    nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR |
+        VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT;
 

You should not set those if host does not support them, otherwise GUEST_IA32_PAT may not be available

Quoted 2 lines

To Jan,
Is this different from IA32_EFER?

As we use a real VMCS to keep GUEST/HOST_IA32_EFER, we actually do depend on the existence of the host feature. So my patch requires an update as you noted.

Quoted 6 lines
Quoted 3 lines

Your patch didn't add new users of GUEST_IA32_PAT and VM_ENTRY_LOAD_IA32_PAT is enabled by nested only if host has it, so I am not sure why you are saying that patch should be updated.

I think Jan points [1] and you refer to another.

[1] http://www.mail-archive.com/[email protected]/msg94188.html

Yep, that's what I was referring to.

Jan

#7 lore raw
Quoted 35 lines · Jan Kiszka
Quoted 34 lines · Arthur Chunqi Li
Quoted 33 lines · Gleb Natapov
Quoted 32 lines · Jan Kiszka
Quoted 24 lines · Gmail
Quoted 10 lines · Arthur Chunqi Li
Quoted 7 lines

Advertise VM_EXIT_SAVE_IA32_PAT and VM_EXIT_LOAD_IA32_PAT.

---
arch/x86/kvm/vmx.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 14 lines

arch/x86/kvm/vmx.c static __init void nested_vmx_setup_ctls_msrs(void) · line 2203

Quoted 12 lines
arch/x86/kvm/vmx.c +2 -1
index 45fd70c..240f0db 100644
@@ -2198,7 +2198,8 @@ static __init void nested_vmx_setup_ctls_msrs(void)
 #else
   nested_vmx_exit_ctls_high = 0;
 #endif
-    nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR;
+    nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR |
+        VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT;
 

You should not set those if host does not support them, otherwise GUEST_IA32_PAT may not be available

Quoted 2 lines

To Jan,
Is this different from IA32_EFER?

As we use a real VMCS to keep GUEST/HOST_IA32_EFER, we actually do depend on the existence of the host feature. So my patch requires an update as you noted.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

Your patch didn't add new users of GUEST_IA32_PAT and VM_ENTRY_LOAD_IA32_PAT is enabled by nested only if host has it, so I am not sure why you are saying that patch should be updated.

I think Jan points [1] and you refer to another.

[1] http://www.mail-archive.com/[email protected]/msg94188.html

Yep, that's what I was referring to.

Ah, too many patches :)

--
Gleb.