[PATCH 3/4] x86: Drop mach-default/bios_ebda.h

Andrew Cooper posted 4 patches 11 months, 4 weeks ago
[PATCH 3/4] x86: Drop mach-default/bios_ebda.h
Posted by Andrew Cooper 11 months, 4 weeks ago
It has a single function, and a single user.  This is unlikely to change
moving forwards so fold it into mpparse.c

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/include/asm/mach-default/bios_ebda.h | 15 ---------------
 xen/arch/x86/mpparse.c                            |  9 +++++++--
 2 files changed, 7 insertions(+), 17 deletions(-)
 delete mode 100644 xen/arch/x86/include/asm/mach-default/bios_ebda.h

diff --git a/xen/arch/x86/include/asm/mach-default/bios_ebda.h b/xen/arch/x86/include/asm/mach-default/bios_ebda.h
deleted file mode 100644
index 42de6b2a5b97..000000000000
--- a/xen/arch/x86/include/asm/mach-default/bios_ebda.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef _MACH_BIOS_EBDA_H
-#define _MACH_BIOS_EBDA_H
-
-/*
- * there is a real-mode segmented pointer pointing to the
- * 4K EBDA area at 0x40E.
- */
-static inline unsigned int get_bios_ebda(void)
-{
-	unsigned int address = *(unsigned short *)maddr_to_virt(0x40E);
-	address <<= 4;
-	return address;	/* 0 means none */
-}
-
-#endif /* _MACH_BIOS_EBDA_H */
diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c
index b16c105b18bf..957a19d9887d 100644
--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -31,8 +31,6 @@
 #include <asm/io_apic.h>
 #include <asm/setup.h>
 
-#include <bios_ebda.h>
-
 /* Have we found an MP table */
 bool __initdata smp_found_config;
 
@@ -734,6 +732,13 @@ static void __init efi_check_config(void)
 		efi_unmap_mpf();
 }
 
+static unsigned int get_bios_ebda(void)
+{
+	unsigned int address = *(unsigned short *)maddr_to_virt(0x40E);
+
+	return address << 4; /* 0 means none */
+}
+
 void __init find_smp_config (void)
 {
 	unsigned int address;
-- 
2.39.5


Re: [PATCH 3/4] x86: Drop mach-default/bios_ebda.h
Posted by Jan Beulich 11 months, 3 weeks ago
On 08.11.2024 21:11, Andrew Cooper wrote:
> @@ -734,6 +732,13 @@ static void __init efi_check_config(void)
>  		efi_unmap_mpf();
>  }
>  
> +static unsigned int get_bios_ebda(void)
> +{
> +	unsigned int address = *(unsigned short *)maddr_to_virt(0x40E);

Now this is a case where I think use of uint16_t is not just optional, but
even a requirement.

Jan