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

Re: [Xen-devel] [PATCH] xc_cpuid_x86.c: No need to mask NX twice



Hi, Jan

Generally, I agree with you. But it seems that we may not simply remove the ones from the 2 vendor specific functions and keep the generic one, because the bit could be still cleared eventually when is_pae is true. And I find PSE36 will be cleared permanently no matter is_pae is true or not. Actually the work below has been totally overlapped:

ÂÂÂÂÂÂÂ if ( !is_pae ) {ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
ÂÂÂÂÂÂÂÂÂÂÂ clear_bit(X86_FEATURE_NX, regs[3]);ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
ÂÂÂÂÂÂÂÂÂÂÂ clear_bit(X86_FEATURE_PSE36, regs[3]);ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
ÂÂÂÂÂÂÂ }

How can we just "passthrough to cpu vendor specific functions" like leaf 0x80000000? like this:


ÂÂÂ case 0x80000000:
ÂÂÂ case 0x80000001:ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
ÂÂÂÂÂÂÂ /* Passthrough to cpu vendor specific functions */ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
ÂÂÂÂÂÂÂ break;Â


Correct me if I missed something.

Zhuo



On Fri, Sep 5, 2014 at 6:32 PM, Jan Beulich <JBeulich@xxxxxxxx> wrote:
>>> On 05.09.14 at 12:11, <alfred.z.song@xxxxxxxxx> wrote:
> Since amd_xc_cpuid_policy or intel_xc_cpuid_policy will do it later as
> well, we may drop an extra action.

But then I think it would be better to keep the generic one and
drop the vendor specific ones.

Jan

> Signed-off-by: Zhuo Song <songzhuo.sz@xxxxxxxxxxxxxxx>
> ---
>Â tools/libxc/xc_cpuid_x86.c | 1 -
>Â 1 file changed, 1 deletion(-)
>
> diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
> index 6b81641..61af3e6 100644
> --- a/tools/libxc/xc_cpuid_x86.c
> +++ b/tools/libxc/xc_cpuid_x86.c
> @@ -392,7 +392,6 @@ static void xc_cpuid_hvm_policy(
>
>Â Â Â case 0x80000001:
>Â Â Â Â Â if ( !is_pae ) {
> -Â Â Â Â Â Â clear_bit(X86_FEATURE_NX, regs[3]);
>Â Â Â Â Â Â Â clear_bit(X86_FEATURE_PSE36, regs[3]);
>Â Â Â Â Â }
>Â Â Â Â Â break;
> --
> 1.8.5.2 (Apple Git-48)
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel




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

 


Rackspace

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