From: Nitin A Kamble Subject: [Patch] [HVM] Limit MTRR virtualization for VMX guests to 8 registers Date: Thu, 16 Apr 2009 15:32:36 -0700 Message-ID: <1239921156.29349.7.camel@mukti.sc.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1282468040==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: keir.fraser@eu.citrix.com List-Id: xen-devel@lists.xenproject.org --===============1282468040== Content-Type: multipart/alternative; boundary="=-KxkJhjzpjWV88D6EPpnO" --=-KxkJhjzpjWV88D6EPpnO Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi Keir, Bellow is the patch for xen-unstable tree which limits MTRR virtualization for VMX guests to 8 registers. Please comment/Apply. Thanks & Regards, Nitin # HG changeset patch # User Nitin A Kamble # Date 1239916751 25200 # Branch mtrrcap_fix_for_guest # Node ID 276c1008200895845f47fe61dd9e42e47dbbc772 # Parent 120d3c67951bac0f4c31b0b828500ee6ac23b0b4 Limit MTRR virtualization to 8 registers for VMX guests. Signed-off-by: Nitin A Kamble diff -r 120d3c67951b -r 276c10082008 xen/arch/x86/cpu/mtrr/generic.c --- a/xen/arch/x86/cpu/mtrr/generic.c Fri Apr 10 06:58:04 2009 +0100 +++ b/xen/arch/x86/cpu/mtrr/generic.c Thu Apr 16 14:19:11 2009 -0700 @@ -55,6 +55,7 @@ void mtrr_save_fixed_ranges(void *info) } /* Grab all of the MTRR state for this CPU into *state */ +/* This function is called only for Intel processors */ void __init get_mtrr_state(void) { unsigned int i; @@ -83,6 +84,10 @@ void __init get_mtrr_state(void) /* Store mtrr_cap for HVM MTRR virtualisation. */ rdmsrl(MTRRcap_MSR, mtrr_state.mtrr_cap); + + /* Virtualization of max 8 MTRRs is supported */ + if ((mtrr_state.mtrr_cap & 0xff) > 8) + mtrr_state.mtrr_cap = (mtrr_state.mtrr_cap & ~0xff) | 0x8; } --=-KxkJhjzpjWV88D6EPpnO Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit Hi Keir,
  Bellow is the patch for xen-unstable tree which limits MTRR virtualization for VMX guests to 8 registers. Please comment/Apply.

Thanks & Regards,
Nitin

# HG changeset patch
# User Nitin A Kamble <nitin.a.kamble@intel.com>
# Date 1239916751 25200
# Branch mtrrcap_fix_for_guest
# Node ID 276c1008200895845f47fe61dd9e42e47dbbc772
# Parent  120d3c67951bac0f4c31b0b828500ee6ac23b0b4
Limit MTRR virtualization to 8 registers for VMX guests.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>

diff -r 120d3c67951b -r 276c10082008 xen/arch/x86/cpu/mtrr/generic.c
--- a/xen/arch/x86/cpu/mtrr/generic.c Fri Apr 10 06:58:04 2009 +0100
+++ b/xen/arch/x86/cpu/mtrr/generic.c Thu Apr 16 14:19:11 2009 -0700
@@ -55,6 +55,7 @@ void mtrr_save_fixed_ranges(void *info)
}

/*  Grab all of the MTRR state for this CPU into *state  */
+/* This function is called only for Intel processors */
void __init get_mtrr_state(void)
{
unsigned int i;
@@ -83,6 +84,10 @@ void __init get_mtrr_state(void)

/* Store mtrr_cap for HVM MTRR virtualisation. */
rdmsrl(MTRRcap_MSR, mtrr_state.mtrr_cap);
+
+ /* Virtualization of max 8 MTRRs is supported */
+ if ((mtrr_state.mtrr_cap & 0xff) > 8)
+ mtrr_state.mtrr_cap = (mtrr_state.mtrr_cap & ~0xff) | 0x8;
}


--=-KxkJhjzpjWV88D6EPpnO-- --===============1282468040== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1282468040==--