Re: [PATCH kvm-unit-tests] access: check SMEP on prefetch pte path

2011-06-27 Thread Xiao Guangrong
On 06/25/2011 10:44 AM, Yang, Wei Y wrote: +void set_cr4_smep(int smep) +{ +unsigned long cr4 = read_cr4(); + +cr4 = ~CR4_SMEP_MASK; +if (smep) + cr4 |= CR4_SMEP_MASK; +write_cr4(cr4); +} + It can work if the box does not support SMEP? It will report unhandled

Re: [PATCH kvm-unit-tests] access: check SMEP on prefetch pte path

2011-06-24 Thread Xiao Guangrong
On 06/24/2011 03:16 PM, Yang, Wei wrote: +void set_cr4_smep(int smep) +{ +unsigned long cr4 = read_cr4(); + +cr4 = ~CR4_SMEP_MASK; +if (smep) + cr4 |= CR4_SMEP_MASK; +write_cr4(cr4); +} + It can work if the box does not support SMEP? void set_efer_nx(int nx) {

RE: [PATCH kvm-unit-tests] access: check SMEP on prefetch pte path

2011-06-24 Thread Yang, Wei Y
+void set_cr4_smep(int smep) +{ +unsigned long cr4 = read_cr4(); + +cr4 = ~CR4_SMEP_MASK; +if (smep) + cr4 |= CR4_SMEP_MASK; +write_cr4(cr4); +} + It can work if the box does not support SMEP? It will report unhandled exception 13 in access.out which we