WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] EPT: fix handling of super page level lim

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] EPT: fix handling of super page level limit
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 06 May 2010 04:10:41 -0700
Delivery-date: Thu, 06 May 2010 04:15:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1273140997 -3600
# Node ID 8aff748807cbb340d2fd961f66ec60fe512d72c0
# Parent  1c9f7df0d2d6a6871059e8df0fc0571f7b35e591
EPT: fix handling of super page level limit

Just like for other global VMX controls, the maximum super page level
used must be globally consistent (and not change post-init).

Additionally, the original patch yet again introduced a message
printed on each CPU, which this patch moves to a place where it gets
issued just once.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmcs.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff -r 1c9f7df0d2d6 -r 8aff748807cb xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c       Thu May 06 11:14:17 2010 +0100
+++ b/xen/arch/x86/hvm/vmx/vmcs.c       Thu May 06 11:16:37 2010 +0100
@@ -91,6 +91,10 @@ static void __init vmx_display_features(
 
     if ( !printed )
         printk(" - none\n");
+
+    if ( vmx_ept_super_page_level_limit )
+        printk("EPT supports %s super page.\n",
+               vmx_ept_super_page_level_limit > 1 ? "1G" : "2M");
 }
 
 static u32 adjust_vmx_controls(u32 ctl_min, u32 ctl_opt, u32 msr)
@@ -114,6 +118,7 @@ static void vmx_init_vmcs_config(void)
     u32 _vmx_pin_based_exec_control;
     u32 _vmx_cpu_based_exec_control;
     u32 _vmx_secondary_exec_control = 0;
+    u8 ept_super_page_level_limit = 0;
     u32 _vmx_vmexit_control;
     u32 _vmx_vmentry_control;
 
@@ -189,15 +194,9 @@ static void vmx_init_vmcs_config(void)
             uint64_t cap;
             rdmsrl(MSR_IA32_VMX_EPT_VPID_CAP, cap);
             if ( cap & VMX_EPT_SUPER_PAGE_1G )
-            {
-                vmx_ept_super_page_level_limit = 2;
-                printk("EPT support 1G super page.\n");
-            }
+                ept_super_page_level_limit = 2;
             else if ( cap & VMX_EPT_SUPER_PAGE_2M )
-            {
-                vmx_ept_super_page_level_limit = 1; 
-                printk("EPT support 2M super page.\n");
-            }
+                ept_super_page_level_limit = 1;
         }
     }
 
@@ -235,6 +234,7 @@ static void vmx_init_vmcs_config(void)
         vmx_pin_based_exec_control = _vmx_pin_based_exec_control;
         vmx_cpu_based_exec_control = _vmx_cpu_based_exec_control;
         vmx_secondary_exec_control = _vmx_secondary_exec_control;
+        vmx_ept_super_page_level_limit = ept_super_page_level_limit;
         vmx_vmexit_control         = _vmx_vmexit_control;
         vmx_vmentry_control        = _vmx_vmentry_control;
         cpu_has_vmx_ins_outs_instr_info = !!(vmx_basic_msr_high & (1U<<22));
@@ -247,6 +247,7 @@ static void vmx_init_vmcs_config(void)
         BUG_ON(vmx_pin_based_exec_control != _vmx_pin_based_exec_control);
         BUG_ON(vmx_cpu_based_exec_control != _vmx_cpu_based_exec_control);
         BUG_ON(vmx_secondary_exec_control != _vmx_secondary_exec_control);
+        BUG_ON(vmx_ept_super_page_level_limit > ept_super_page_level_limit);
         BUG_ON(vmx_vmexit_control != _vmx_vmexit_control);
         BUG_ON(vmx_vmentry_control != _vmx_vmentry_control);
         BUG_ON(cpu_has_vmx_ins_outs_instr_info !=

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] EPT: fix handling of super page level limit, Xen patchbot-unstable <=