[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <946157a5-fdb2-a45a-63aa-97e9d602e6f0@hygon.cn>
Date: Tue, 4 Sep 2018 11:02:41 +0800
From: Pu Wen <puwen@...on.cn>
To: Borislav Petkov <bp@...en8.de>
Cc: tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
x86@...nel.org, thomas.lendacky@....com, pbonzini@...hat.com,
linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org
Subject: Re: [PATCH v5 03/16] x86/mtrr: get MTRR number and support TOP_MEM2
On 2018/9/4 3:04, Borislav Petkov wrote:
> It was "Hygon Dhyana" before now "Hygon" only. Can we agree on the
> naming nomenclature and stick with it.
OK, agree on it.
...
>> - if (!((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) &&
>> - (boot_cpu_data.x86 >= 0x0f)))
>> + if (!((boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
>> + boot_cpu_data.x86 >= 0x0f) ||
>> + boot_cpu_data.x86_vendor == X86_VENDOR_HYGON))
>
> Why are you even touching this statement? The function returns early on
> !X86_VENDOR_AMD.
The statement is briefly equal to !(X86_VENDOR_AMD || X86_VENDOR_HYGON).
So the function will not return early on !X86_VENDOR_AMD. :-)
Also the statement can be changed to:
+ if (!(boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
+ boot_cpu_data.x86 >= 0x0f) &&
+ !(boot_cpu_data.x86_vendor == X86_VENDOR_HYGON))
or:
+ if ((boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
+ boot_cpu_data.x86 < 0x0f) &&
+ (boot_cpu_data.x86_vendor != X86_VENDOR_HYGON))
Which statement is better?
Thanks,
Pu Wen
Powered by blists - more mailing lists