* [PATCH] x86/kvm: Include linux/types.h in asm/kvm_para.h
@ 2026-05-05 6:58 WEI-HONG, YE
2026-05-05 8:02 ` Thomas Huth
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: WEI-HONG, YE @ 2026-05-05 6:58 UTC (permalink / raw)
To: seanjc, pbonzini
Cc: vkuznets, tglx, mingo, bp, dave.hansen, x86, hpa, thuth, kvm,
linux-kernel, hank20010209, WEI-HONG, YE
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.
Signed-off-by: WEI-HONG, YE <1234567weewee457@gmail.com>
---
arch/x86/include/asm/kvm_para.h | 2 ++
arch/x86/kernel/cpu/mtrr/mtrr.c | 2 --
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
index 4a47c16e2df8..26e86db37b05 100644
--- a/arch/x86/include/asm/kvm_para.h
+++ b/arch/x86/include/asm/kvm_para.h
@@ -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>
diff --git a/arch/x86/kernel/cpu/mtrr/mtrr.c b/arch/x86/kernel/cpu/mtrr/mtrr.c
index 4b3d492afe17..cdba5bf4a51d 100644
--- a/arch/x86/kernel/cpu/mtrr/mtrr.c
+++ b/arch/x86/kernel/cpu/mtrr/mtrr.c
@@ -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>
--
2.48.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] x86/kvm: Include linux/types.h in asm/kvm_para.h
2026-05-05 6:58 [PATCH] x86/kvm: Include linux/types.h in asm/kvm_para.h WEI-HONG, YE
@ 2026-05-05 8:02 ` Thomas Huth
2026-07-07 18:20 ` Sean Christopherson
[not found] ` <ak1Dd5M6EtzOF1k_@google.com>
2 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2026-05-05 8:02 UTC (permalink / raw)
To: WEI-HONG, YE, seanjc, pbonzini
Cc: vkuznets, tglx, mingo, bp, dave.hansen, x86, hpa, kvm,
linux-kernel, hank20010209
On 05/05/2026 08.58, WEI-HONG, YE wrote:
> 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.
>
> Signed-off-by: WEI-HONG, YE <1234567weewee457@gmail.com>
> ---
> arch/x86/include/asm/kvm_para.h | 2 ++
> arch/x86/kernel/cpu/mtrr/mtrr.c | 2 --
> 2 files changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] x86/kvm: Include linux/types.h in asm/kvm_para.h
2026-05-05 6:58 [PATCH] x86/kvm: Include linux/types.h in asm/kvm_para.h WEI-HONG, YE
2026-05-05 8:02 ` Thomas Huth
@ 2026-07-07 18:20 ` Sean Christopherson
[not found] ` <ak1Dd5M6EtzOF1k_@google.com>
2 siblings, 0 replies; 5+ messages in thread
From: Sean Christopherson @ 2026-07-07 18:20 UTC (permalink / raw)
To: WEI-HONG, YE
Cc: pbonzini, vkuznets, tglx, mingo, bp, dave.hansen, x86, hpa, thuth,
kvm, linux-kernel, hank20010209
On Tue, May 05, 2026, WEI-HONG, YE wrote:
> 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.
>
> Signed-off-by: WEI-HONG, YE <1234567weewee457@gmail.com>
> ---
> arch/x86/include/asm/kvm_para.h | 2 ++
> arch/x86/kernel/cpu/mtrr/mtrr.c | 2 --
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
> index 4a47c16e2df8..26e86db37b05 100644
> --- a/arch/x86/include/asm/kvm_para.h
> +++ b/arch/x86/include/asm/kvm_para.h
> @@ -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>
> diff --git a/arch/x86/kernel/cpu/mtrr/mtrr.c b/arch/x86/kernel/cpu/mtrr/mtrr.c
> index 4b3d492afe17..cdba5bf4a51d 100644
> --- a/arch/x86/kernel/cpu/mtrr/mtrr.c
> +++ b/arch/x86/kernel/cpu/mtrr/mtrr.c
> @@ -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.
diff --git a/arch/x86/kernel/cpu/mtrr/mtrr.c b/arch/x86/kernel/cpu/mtrr/mtrr.c
index 4b3d492afe17..db5bf4adfd28 100644
--- a/arch/x86/kernel/cpu/mtrr/mtrr.c
+++ b/arch/x86/kernel/cpu/mtrr/mtrr.c
@@ -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>
^ permalink raw reply related [flat|nested] 5+ messages in thread[parent not found: <ak1Dd5M6EtzOF1k_@google.com>]
* Re: [PATCH] x86/kvm: Include linux/types.h in asm/kvm_para.h
[not found] ` <ak1Dd5M6EtzOF1k_@google.com>
@ 2026-07-08 7:42 ` WEI-HONG, YE
2026-07-08 13:09 ` Sean Christopherson
0 siblings, 1 reply; 5+ messages in thread
From: WEI-HONG, YE @ 2026-07-08 7:42 UTC (permalink / raw)
To: seanjc
Cc: pbonzini, vkuznets, tglx, mingo, bp, dave.hansen, x86, hpa, thuth,
kvm, linux-kernel, hank20010209
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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] x86/kvm: Include linux/types.h in asm/kvm_para.h
2026-07-08 7:42 ` WEI-HONG, YE
@ 2026-07-08 13:09 ` Sean Christopherson
0 siblings, 0 replies; 5+ messages in thread
From: Sean Christopherson @ 2026-07-08 13:09 UTC (permalink / raw)
To: WEI-HONG, YE
Cc: pbonzini, vkuznets, tglx, mingo, bp, dave.hansen, x86, hpa, thuth,
kvm, linux-kernel, hank20010209
On Wed, Jul 08, 2026, WEI-HONG, YE wrote:
> 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.
Works for me.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-07-08 13:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-05 6:58 [PATCH] x86/kvm: Include linux/types.h in asm/kvm_para.h WEI-HONG, YE
2026-05-05 8:02 ` Thomas Huth
2026-07-07 18:20 ` Sean Christopherson
[not found] ` <ak1Dd5M6EtzOF1k_@google.com>
2026-07-08 7:42 ` WEI-HONG, YE
2026-07-08 13:09 ` Sean Christopherson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox