x86/kvm: Include linux/types.h in asm/kvm_para.h
Subsystems (4)
PATCH 1/1 x86/kvm: Include linux/types.h in asm/kvm_para.h
arch/x86/include/asm/kvm_para.h uses u32 in function declarations, but does not include linux/types.h itself. One user, mtrr.c, carried an explicit workaround for this dependency.
Include linux/types.h from asm/kvm_para.h and remove the workaround from mtrr.c.
Build-tested with x86_64 defconfig.
--- arch/x86/include/asm/kvm_para.h | 2 ++ arch/x86/kernel/cpu/mtrr/mtrr.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/kvm_para.h +2 -0
@@ -2,6 +2,8 @@#ifndef _ASM_X86_KVM_PARA_H#define _ASM_X86_KVM_PARA_H +#include <linux/types.h> +#include <asm/processor.h> #include <asm/alternative.h> #include <linux/interrupt.h>
arch/x86/kernel/cpu/mtrr/mtrr.c +0 -2
@@ -18,8 +18,6 @@System Programming Guide; Section 9.11. (1997 edition - PPro). */ -#include <linux/types.h> /* FIXME: kvm_para.h needs this */ -#include <linux/stop_machine.h> #include <linux/kvm_para.h> #include <linux/uaccess.h>
Signature · 1 line
2.48.1
Quoted 7 lines · YE
arch/x86/include/asm/kvm_para.huses u32 in function declarations, but does not includelinux/types.hitself. One user,mtrr.c, carried an explicit workaround for this dependency.Include
linux/types.hfromasm/kvm_para.hand remove the workaround frommtrr.c.
Quoted 7 lines
Build-tested with
x86_64defconfig.Signed-off-by WEI-HONG, YE <[email protected]>--- arch/x86/include/asm/kvm_para.h | 2 ++ arch/x86/kernel/cpu/mtrr/mtrr.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)
Sean Christopherson
maintainerQuoted 33 lines · YE
arch/x86/include/asm/kvm_para.huses u32 in function declarations, but does not includelinux/types.hitself. One user,mtrr.c, carried an explicit workaround for this dependency.Include
linux/types.hfromasm/kvm_para.hand remove the workaround frommtrr.c.Build-tested with
x86_64defconfig.Signed-off-by WEI-HONG, YE <[email protected]>--- arch/x86/include/asm/kvm_para.h | 2 ++ arch/x86/kernel/cpu/mtrr/mtrr.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)arch/x86/include/asm/kvm_para.h +2
-0@@ -2,6 +2,8 @@#ifndef _ASM_X86_KVM_PARA_H#define _ASM_X86_KVM_PARA_H +#include <linux/types.h> +#include <asm/processor.h> #include <asm/alternative.h> #include <linux/interrupt.h> arch/x86/kernel/cpu/mtrr/mtrr.c +0
-0
arch/x86/kernel/cpu/mtrr/mtrr.c line 22
Quoted 7 lines
arch/x86/kernel/cpu/mtrr/mtrr.c +0
-2@@ -18,8 +18,6 @@System Programming Guide; Section 9.11. (1997 edition - PPro). */ -#include <linux/types.h> /* FIXME: kvm_para.h needs this */ -#include <linux/stop_machine.h> #include <linux/kvm_para.h>
Just drop the kvm_para.h include, it has been needed since commit bf3647c44bc7 ("x86: tone down mtrr_trim_uncached_memory() warning") from 2009. I.e.
arch/x86/kernel/cpu/mtrr/mtrr.c +0 -3
@@ -18,10 +18,7 @@System Programming Guide; Section 9.11. (1997 edition - PPro). */ -#include <linux/types.h> /* FIXME: kvm_para.h needs this */ -#include <linux/stop_machine.h> -#include <linux/kvm_para.h> #include <linux/uaccess.h> #include <linux/export.h> #include <linux/mutex.h>
A message that is not in the archive (sent off-list or not yet received): [email protected]
Thanks for the review and the suggested fix.
I checked the commit bf3647c44bc7 and agree that mtrr.c no longer needs linux/kvm_para.h. I'll send a v2 that drops both the stale linux/kvm_para.h include and the linux/types.h workaround from mtrr.c.
I'll add your Suggested-by tag in v2 unless you prefer otherwise.
Cheers,
Hong
Sean Christopherson
maintainerQuoted 7 lines · YE
Thanks for the review and the suggested fix.
I checked the commit
bf3647c44bc7and agree thatmtrr.cno longer needslinux/kvm_para.h. I'll send a v2 that drops both the stalelinux/kvm_para.hinclude and thelinux/types.hworkaround frommtrr.c.I'll add your Suggested-by tag in v2 unless you prefer otherwise.
Works for me.