[PATCH 8/8] xen/mm: Exclude flushtlb.h from mm.h for x86

Andrew Cooper posted 8 patches 11 months ago
[PATCH 8/8] xen/mm: Exclude flushtlb.h from mm.h for x86
Posted by Andrew Cooper 11 months ago
alternative.c and livepatch.c pick up flushtlb.h transitively through mm.h.

Fix these, and finally resolve the TODO in microcode/amd.c

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Anthony PERARD <anthony.perard@vates.tech>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Julien Grall <julien@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/x86/alternative.c       | 1 +
 xen/arch/x86/cpu/microcode/amd.c | 2 +-
 xen/arch/x86/livepatch.c         | 1 +
 xen/include/xen/mm.h             | 4 ----
 4 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 46b04c9cb83d..d97eda129c32 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -10,6 +10,7 @@
 #include <asm/alternative.h>
 #include <asm/apic.h>
 #include <asm/endbr.h>
+#include <asm/flushtlb.h>
 #include <asm/nmi.h>
 #include <asm/nops.h>
 #include <asm/processor.h>
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index ee7de5282b2a..d84dc5b0ef1f 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -17,9 +17,9 @@
 #include <xen/bsearch.h>
 #include <xen/err.h>
 #include <xen/init.h>
-#include <xen/mm.h> /* TODO: Fix asm/tlbflush.h breakage */
 #include <xen/sha2.h>
 
+#include <asm/flushtlb.h>
 #include <asm/msr.h>
 
 #include "private.h"
diff --git a/xen/arch/x86/livepatch.c b/xen/arch/x86/livepatch.c
index 5158e91f7e6e..5c1d16ecf5a8 100644
--- a/xen/arch/x86/livepatch.c
+++ b/xen/arch/x86/livepatch.c
@@ -16,6 +16,7 @@
 
 #include <asm/endbr.h>
 #include <asm/fixmap.h>
+#include <asm/flushtlb.h>
 #include <asm/nmi.h>
 #include <asm/setup.h>
 
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 27e420e302d8..088f77eed5e5 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -587,10 +587,6 @@ void destroy_ring_for_helper(void **_va, struct page_info *page);
 /* Return the upper bound of MFNs, including hotplug memory. */
 unsigned long get_upper_mfn_bound(void);
 
-#if defined(CONFIG_X86)
-#include <asm/flushtlb.h>
-#endif
-
 enum XENSHARE_flags {
     SHARE_rw,
     SHARE_ro,
-- 
2.39.5


Re: [PATCH 8/8] xen/mm: Exclude flushtlb.h from mm.h for x86
Posted by Jan Beulich 11 months ago
On 12.03.2025 18:45, Andrew Cooper wrote:
> alternative.c and livepatch.c pick up flushtlb.h transitively through mm.h.
> 
> Fix these, and finally resolve the TODO in microcode/amd.c
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
Re: [PATCH 8/8] xen/mm: Exclude flushtlb.h from mm.h for x86
Posted by Andrew Cooper 11 months ago
On 13/03/2025 9:13 am, Jan Beulich wrote:
> On 12.03.2025 18:45, Andrew Cooper wrote:
>> alternative.c and livepatch.c pick up flushtlb.h transitively through mm.h.
>>
>> Fix these, and finally resolve the TODO in microcode/amd.c
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Acked-by: Jan Beulich <jbeulich@suse.com>
>
>

Thanks.  Randconfig thus far has found that
xen/arch/x86/guest/hyperv/tlb.c needs an extra include too, which I've
fixed up locally.

~Andrew