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

Re: [Xen-devel] [PATCH v6] xen/sm{e, a}p: allow disabling sm{e, a}p for Xen itself



>>> On 05.09.16 at 07:17, <he.chen@xxxxxxxxxxxxxxx> wrote:
> @@ -1403,12 +1451,16 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>  
>      if ( !opt_smep )
>          setup_clear_cpu_cap(X86_FEATURE_SMEP);
> -    if ( cpu_has_smep )
> +    else if ( opt_smep == 1 )
> +        __set_bit(X86_FEATURE_XEN_SMEP, boot_cpu_data.x86_capability);
> +    if ( boot_cpu_has(X86_FEATURE_XEN_SMEP) )
>          set_in_cr4(X86_CR4_SMEP);
>  
>      if ( !opt_smap )
>          setup_clear_cpu_cap(X86_FEATURE_SMAP);
> -    if ( cpu_has_smap )
> +    else if ( opt_smap == 1 )
> +        __set_bit(X86_FEATURE_XEN_SMAP, boot_cpu_data.x86_capability);
> +    if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
>          set_in_cr4(X86_CR4_SMAP);

This is still wrong, as spotted by osstest's smoke test: It in particular
doesn't work on a system which doesn't have SMEP and/or SMAP.
Please fix this while incorporating the other adjustments I did while
committing; I've reverted the patch until then.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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