direct-io.hg

changeset 14695:e9986e48ebe1

hvm svm: Clear FS/GS base MSR intercepts.
Signed-off-by: Mats Petersson <mats.petersson@amd.com>
author kfraser@localhost.localdomain
date Mon Apr 02 16:51:52 2007 +0100 (2007-04-02)
parents d05a3220ea05
children 8cf85d3f4f5f
files xen/arch/x86/hvm/svm/vmcb.c
line diff
     1.1 --- a/xen/arch/x86/hvm/svm/vmcb.c	Mon Apr 02 16:46:52 2007 +0100
     1.2 +++ b/xen/arch/x86/hvm/svm/vmcb.c	Mon Apr 02 16:51:52 2007 +0100
     1.3 @@ -79,6 +79,30 @@ struct host_save_area *alloc_host_save_a
     1.4      return hsa;
     1.5  }
     1.6  
     1.7 +static void disable_intercept_for_msr(char *msr_bitmap, u32 msr)
     1.8 +{
     1.9 +    /*
    1.10 +     * See AMD64 Programmers Manual, Vol 2, Section 15.10 (MSR-Bitmap Address).
    1.11 +     */
    1.12 +    if ( msr <= 0x1fff )
    1.13 +    {
    1.14 +        __clear_bit(msr*2, msr_bitmap + 0x000); 
    1.15 +        __clear_bit(msr*2+1, msr_bitmap + 0x000); 
    1.16 +    }
    1.17 +    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
    1.18 +    {
    1.19 +        msr &= 0x1fff;
    1.20 +        __clear_bit(msr*2, msr_bitmap + 0x800);
    1.21 +        __clear_bit(msr*2+1, msr_bitmap + 0x800);
    1.22 +    } 
    1.23 +    else if ( (msr >= 0xc001000) && (msr <= 0xc0011fff) )
    1.24 +    {
    1.25 +        msr &= 0x1fff;
    1.26 +        __clear_bit(msr*2, msr_bitmap + 0x1000);
    1.27 +        __clear_bit(msr*2+1, msr_bitmap + 0x1000);
    1.28 +    }
    1.29 +}
    1.30 +
    1.31  static int construct_vmcb(struct vcpu *v)
    1.32  {
    1.33      struct arch_svm_struct *arch_svm = &v->arch.hvm_svm;
    1.34 @@ -114,6 +138,10 @@ static int construct_vmcb(struct vcpu *v
    1.35      if ( arch_svm->msrpm == NULL )
    1.36          return -ENOMEM;
    1.37      memset(arch_svm->msrpm, 0xff, MSRPM_SIZE);
    1.38 +
    1.39 +    disable_intercept_for_msr((char *)arch_svm->msrpm, MSR_FS_BASE);
    1.40 +    disable_intercept_for_msr((char *)arch_svm->msrpm, MSR_GS_BASE);
    1.41 +
    1.42      vmcb->msrpm_base_pa = (u64)virt_to_maddr(arch_svm->msrpm);
    1.43      vmcb->iopm_base_pa  = (u64)virt_to_maddr(hvm_io_bitmap);
    1.44