|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] [PATCH] add SMEP support to HVM guest
>>> "Li, Xin" <xin.li@xxxxxxxxx> 06/05/11 2:12 AM >>> >--- a/xen/arch/x86/hvm/hvm.c Fri Jun 03 21:39:00 2011 +0100 >+++ b/xen/arch/x86/hvm/hvm.c Sun Jun 05 08:07:48 2011 +0800 >@@ -1664,7 +1664,8 @@ int hvm_set_cr4(unsigned long value) >hvm_update_guest_cr(v, 4); > >/* Modifying CR4.{PSE,PAE,PGE} invalidates all TLB entries, inc. Global. */ >- if ( (old_cr ^ value) & (X86_CR4_PSE | X86_CR4_PGE | X86_CR4_PAE) ) { >+ if ( (old_cr ^ value) & (X86_CR4_PSE | X86_CR4_PGE | >+ X86_CR4_PAE | X86_CR4_SMEP) ) {
Not having access to the specification - why?
>if ( !nestedhvm_vmswitch_in_progress(v) && nestedhvm_vcpu_in_guestmode(v) ) >paging_update_nestedmode(v); >else >@@ -2312,7 +2313,8 @@ enum hvm_copy_result hvm_copy_from_guest >enum hvm_copy_result hvm_fetch_from_guest_virt( >void *buf, unsigned long vaddr, int size, uint32_t pfec) >{ >- if ( hvm_nx_enabled(current) ) >+ if ( hvm_nx_enabled(current) || >+ (!(pfec | PFEC_user_mode) && hvm_smep_enabled(current)) )
Perhaps rather "!(pfec & PFEC_user_mode)"?
>pfec |= PFEC_insn_fetch; >return __hvm_copy(buf, vaddr, size, >HVMCOPY_from_guest | HVMCOPY_fault | HVMCOPY_virt, >@@ -2338,7 +2340,8 @@ enum hvm_copy_result hvm_copy_from_guest >enum hvm_copy_result hvm_fetch_from_guest_virt_nofault( >void *buf, unsigned long vaddr, int size, uint32_t pfec) >{ >- if ( hvm_nx_enabled(current) ) >+ if ( hvm_nx_enabled(current) || >+ (!(pfec | PFEC_user_mode) && hvm_smep_enabled(current)) )
Same here.
Jan
|
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|