[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] hvm svm: Clear FS/GS base MSR intercepts.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1175529112 -3600
# Node ID e9986e48ebe1af8fda2a41858e2ea4b59478c4b3
# Parent  d05a3220ea050b13ac02ef109c6d01cf378199cc
hvm svm: Clear FS/GS base MSR intercepts.
Signed-off-by: Mats Petersson <mats.petersson@xxxxxxx>
---
 xen/arch/x86/hvm/svm/vmcb.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+)

diff -r d05a3220ea05 -r e9986e48ebe1 xen/arch/x86/hvm/svm/vmcb.c
--- a/xen/arch/x86/hvm/svm/vmcb.c       Mon Apr 02 16:46:52 2007 +0100
+++ b/xen/arch/x86/hvm/svm/vmcb.c       Mon Apr 02 16:51:52 2007 +0100
@@ -79,6 +79,30 @@ struct host_save_area *alloc_host_save_a
     return hsa;
 }
 
+static void disable_intercept_for_msr(char *msr_bitmap, u32 msr)
+{
+    /*
+     * See AMD64 Programmers Manual, Vol 2, Section 15.10 (MSR-Bitmap Address).
+     */
+    if ( msr <= 0x1fff )
+    {
+        __clear_bit(msr*2, msr_bitmap + 0x000); 
+        __clear_bit(msr*2+1, msr_bitmap + 0x000); 
+    }
+    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    {
+        msr &= 0x1fff;
+        __clear_bit(msr*2, msr_bitmap + 0x800);
+        __clear_bit(msr*2+1, msr_bitmap + 0x800);
+    } 
+    else if ( (msr >= 0xc001000) && (msr <= 0xc0011fff) )
+    {
+        msr &= 0x1fff;
+        __clear_bit(msr*2, msr_bitmap + 0x1000);
+        __clear_bit(msr*2+1, msr_bitmap + 0x1000);
+    }
+}
+
 static int construct_vmcb(struct vcpu *v)
 {
     struct arch_svm_struct *arch_svm = &v->arch.hvm_svm;
@@ -114,6 +138,10 @@ static int construct_vmcb(struct vcpu *v
     if ( arch_svm->msrpm == NULL )
         return -ENOMEM;
     memset(arch_svm->msrpm, 0xff, MSRPM_SIZE);
+
+    disable_intercept_for_msr((char *)arch_svm->msrpm, MSR_FS_BASE);
+    disable_intercept_for_msr((char *)arch_svm->msrpm, MSR_GS_BASE);
+
     vmcb->msrpm_base_pa = (u64)virt_to_maddr(arch_svm->msrpm);
     vmcb->iopm_base_pa  = (u64)virt_to_maddr(hvm_io_bitmap);
 

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.