diff mbox

[5/9] x86/mtrr: drop unused is_cpu() macro

Message ID 1471390109-10407-6-git-send-email-cardoe@cardoe.com (mailing list archive)
State New, archived
Headers show

Commit Message

Douglas Goldstein Aug. 16, 2016, 11:28 p.m. UTC
is_cpu() evaluated to Intel always so just drop it entirely.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
---
 xen/arch/x86/cpu/mtrr/generic.c | 2 +-
 xen/arch/x86/cpu/mtrr/mtrr.h    | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

Comments

Jan Beulich Aug. 17, 2016, 1:18 p.m. UTC | #1
>>> On 17.08.16 at 01:28, <cardoe@cardoe.com> wrote:
> --- a/xen/arch/x86/cpu/mtrr/generic.c
> +++ b/xen/arch/x86/cpu/mtrr/generic.c
> @@ -520,7 +520,7 @@ int mtrr_generic_validate_add_page(unsigned long base, unsigned long size, unsig
>  
>  	/*  For Intel PPro stepping <= 7, must be 4 MiB aligned 
>  	    and not touch 0x70000000->0x7003FFFF */
> -	if (is_cpu(INTEL) && boot_cpu_data.x86 == 6 &&
> +	if (boot_cpu_data.x86 == 6 &&
>  	    boot_cpu_data.x86_model == 1 &&
>  	    boot_cpu_data.x86_mask <= 7) {
>  		if (base & ((1 << (22 - PAGE_SHIFT)) - 1)) {

Well, this check then was and is (a) wrong (regardless of the MTRR
flavor used the family/model/stepping check has to be CPU vendor
specific) and (b) dead code (we don't run on PPro-s anymore).
Please instead delete it altogether.

Jan
diff mbox

Patch

diff --git a/xen/arch/x86/cpu/mtrr/generic.c b/xen/arch/x86/cpu/mtrr/generic.c
index 5c4b273..45d4def 100644
--- a/xen/arch/x86/cpu/mtrr/generic.c
+++ b/xen/arch/x86/cpu/mtrr/generic.c
@@ -520,7 +520,7 @@  int mtrr_generic_validate_add_page(unsigned long base, unsigned long size, unsig
 
 	/*  For Intel PPro stepping <= 7, must be 4 MiB aligned 
 	    and not touch 0x70000000->0x7003FFFF */
-	if (is_cpu(INTEL) && boot_cpu_data.x86 == 6 &&
+	if (boot_cpu_data.x86 == 6 &&
 	    boot_cpu_data.x86_model == 1 &&
 	    boot_cpu_data.x86_mask <= 7) {
 		if (base & ((1 << (22 - PAGE_SHIFT)) - 1)) {
diff --git a/xen/arch/x86/cpu/mtrr/mtrr.h b/xen/arch/x86/cpu/mtrr/mtrr.h
index 5e0d832..25f4867 100644
--- a/xen/arch/x86/cpu/mtrr/mtrr.h
+++ b/xen/arch/x86/cpu/mtrr/mtrr.h
@@ -63,8 +63,6 @@  extern void set_mtrr_ops(const struct mtrr_ops *);
 extern u64 size_or_mask, size_and_mask;
 extern const struct mtrr_ops *mtrr_if;
 
-#define is_cpu(vnd)	(X86_VENDOR_INTEL == X86_VENDOR_##vnd)
-
 extern unsigned int num_var_ranges;
 
 void mtrr_state_warn(void);