From: Avi K. <av...@qu...> - 2008-04-27 09:47:15
|
Yang, Sheng wrote: > From 592b7855a88266fa19505f0d51fe12ec0eadfa62 Mon Sep 17 00:00:00 2001 > From: Sheng Yang <she...@in...> > Date: Fri, 25 Apr 2008 22:14:06 +0800 > Subject: [PATCH 8/8] KVM: VMX: Enable EPT feature for KVM > > > > Scratch my earlier __direct_map comment. > diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c > index 3dbedf1..7a8640a 100644 > --- a/arch/x86/kvm/mmu.c > +++ b/arch/x86/kvm/mmu.c > @@ -1177,8 +1177,15 @@ static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, > int write, > return -ENOMEM; > } > > - table[index] = __pa(new_table->spt) | PT_PRESENT_MASK > - | PT_WRITABLE_MASK | shadow_user_mask; > + if (shadow_user_mask) > + table[index] = __pa(new_table->spt) > + | PT_PRESENT_MASK | PT_WRITABLE_MASK > + | shadow_user_mask; > + else > + table[index] = __pa(new_table->spt) > + | PT_PRESENT_MASK | PT_WRITABLE_MASK > + | shadow_x_mask; > Why not do, unconditionally: + table[index] = __pa(new_table->spt) | PT_PRESENT_MASK + | PT_WRITABLE_MASK | shadow_user_mask | shadow_x_mask; ? -- error compiling committee.c: too many arguments to function |