Skip to contentSkip to conversation

x86/dmi: Cleanup

PATCH In review Andrew Cooper 2 participants 12 messages Jul 24, 2019 – Jul 25, 2019

lore
Share & tools
lore
#0 lore raw

cover x86/dmi: Cleanup

This is all trivial cleanup spotted after having come collisions in the XenServer patchqueue when rebasing over Rogers PCI SBDF changes in staging.

Andrew Cooper (3):
x86: Drop CONFIG_ACPI_SLEEP
x86/dmi: Drop trivial callback functions
x86/dmi: Constify quirks data

 xen/arch/x86/acpi/boot.c            |  4 ----
 xen/arch/x86/dmi_scan.c             | 23 ++++++++++-------------
 xen/arch/x86/genapic/bigsmp.c       |  4 ++--
 xen/arch/x86/hvm/quirks.c           |  4 ++--
 xen/arch/x86/ioport_emulate.c       | 20 ++++----------------
 xen/arch/x86/shutdown.c             |  4 ++--
 xen/arch/x86/x86_64/mmconf-fam10h.c | 12 +++---------
 xen/include/asm-x86/acpi.h          |  4 ----
 xen/include/asm-x86/config.h        |  1 -
 xen/include/xen/dmi.h               |  4 ++--
 10 files changed, 25 insertions(+), 55 deletions(-)
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#3 lore raw

PATCH 2/3 x86/dmi: Drop trivial callback functions

dmi_check_system() returns the number of matches. This being nonzero is more efficient than calling into a trivial function to modify a variable.

No functional change, but this results in less compiled code, which is also (fractionally) quicker to run.

---
CC: Jan Beulich <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>

---
 xen/arch/x86/ioport_emulate.c       | 18 +++---------------
 xen/arch/x86/x86_64/mmconf-fam10h.c | 10 ++--------
 2 files changed, 5 insertions(+), 23 deletions(-)
xen/arch/x86/ioport_emulate.c +3 -15
index c2aded7668..504bc513e2 100644
@@ -33,12 +33,6 @@ static bool ioemul_handle_proliant_quirk(
     return true;
 }
 
-static int __init proliant_quirk(struct dmi_system_id *d)
-{
-    ioemul_handle_quirk = ioemul_handle_proliant_quirk;
-    return 0;
-}
-
 /* This table is the set of system-specific I/O emulation hooks. */
 static struct dmi_system_id __initdata ioport_quirks_tbl[] = {
     /*
@@ -46,7 +40,6 @@ static struct dmi_system_id __initdata ioport_quirks_tbl[] = {
      * 'special' SMM goodness.
      */
     {
-        .callback = proliant_quirk,
         .ident = "HP ProLiant DL3xx",
         .matches = {
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
@@ -54,7 +47,6 @@ static struct dmi_system_id __initdata ioport_quirks_tbl[] = {
         },
     },
     {
-        .callback = proliant_quirk,
         .ident = "HP ProLiant DL5xx",
         .matches = {
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
@@ -62,7 +54,6 @@ static struct dmi_system_id __initdata ioport_quirks_tbl[] = {
         },
     },
     {
-        .callback = proliant_quirk,
         .ident = "HP ProLiant DL7xx",
         .matches = {
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
@@ -70,7 +61,6 @@ static struct dmi_system_id __initdata ioport_quirks_tbl[] = {
         },
     },
     {
-        .callback = proliant_quirk,
         .ident = "HP ProLiant ML3xx",
         .matches = {
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
@@ -78,7 +68,6 @@ static struct dmi_system_id __initdata ioport_quirks_tbl[] = {
         },
     },
     {
-        .callback = proliant_quirk,
         .ident = "HP ProLiant ML5xx",
         .matches = {
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
@@ -86,7 +75,6 @@ static struct dmi_system_id __initdata ioport_quirks_tbl[] = {
         },
     },
     {
-        .callback = proliant_quirk,
         .ident = "HP ProLiant BL2xx",
         .matches = {
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
@@ -94,7 +82,6 @@ static struct dmi_system_id __initdata ioport_quirks_tbl[] = {
         },
     },
     {
-        .callback = proliant_quirk,
         .ident = "HP ProLiant BL4xx",
         .matches = {
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
@@ -102,7 +89,6 @@ static struct dmi_system_id __initdata ioport_quirks_tbl[] = {
         },
     },
     {
-        .callback = proliant_quirk,
         .ident = "HP ProLiant BL6xx",
         .matches = {
             DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
@@ -114,7 +100,9 @@ static struct dmi_system_id __initdata ioport_quirks_tbl[] = {
 
 static int __init ioport_quirks_init(void)
 {
-    dmi_check_system(ioport_quirks_tbl);
+    if ( dmi_check_system(ioport_quirks_tbl) )
+        ioemul_handle_quirk = ioemul_handle_proliant_quirk;
+
     return 0;
 }
 __initcall(ioport_quirks_init);
xen/arch/x86/x86_64/mmconf-fam10h.c +2 -8
index f997688ad4..fa2f5b4881 100644
@@ -185,15 +185,8 @@ void fam10h_check_enable_mmcfg(void)
 	wrmsrl(MSR_FAM10H_MMIO_CONF_BASE, val);
 }
 
-static int __init set_check_enable_amd_mmconf(struct dmi_system_id *d)
-{
-        pci_probe |= PCI_CHECK_ENABLE_AMD_MMCONF;
-        return 0;
-}
-
 static struct dmi_system_id __initdata mmconf_dmi_table[] = {
 	{
-		.callback = set_check_enable_amd_mmconf,
 		.ident = "Sun Microsystems Machine",
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Sun Microsystems"),
@@ -204,5 +197,6 @@ static struct dmi_system_id __initdata mmconf_dmi_table[] = {
 
 void __init check_enable_amd_mmconf_dmi(void)
 {
-	dmi_check_system(mmconf_dmi_table);
+	if (dmi_check_system(mmconf_dmi_table))
+		pci_probe |= PCI_CHECK_ENABLE_AMD_MMCONF;
 }
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#5 lore raw

PATCH 3/3 x86/dmi: Constify quirks data

In reply to Andrew Cooper

All DMI quirks tables are mutable, but are only ever read.

Update dmi_check_system() and dmi_system_id.callback to pass a const pointer, and move all quirks tables into __initconst.

No functional change.

---
CC: Jan Beulich <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>

---
 xen/arch/x86/dmi_scan.c             | 16 ++++++++--------
 xen/arch/x86/genapic/bigsmp.c       |  4 ++--
 xen/arch/x86/hvm/quirks.c           |  4 ++--
 xen/arch/x86/ioport_emulate.c       |  2 +-
 xen/arch/x86/shutdown.c             |  4 ++--
 xen/arch/x86/x86_64/mmconf-fam10h.c |  2 +-
 xen/include/xen/dmi.h               |  4 ++--
 7 files changed, 18 insertions(+), 18 deletions(-)
xen/arch/x86/dmi_scan.c +8 -8
index 7063c2c799..808fa7f10e 100644
@@ -459,13 +459,13 @@ static void __init dmi_save_ident(struct dmi_header *dm, int slot, int string)
  * Toshiba keyboard likes to repeat keys when they are not repeated.
  */
 
-static __init int broken_toshiba_keyboard(struct dmi_blacklist *d)
+static __init int broken_toshiba_keyboard(const struct dmi_blacklist *d)
 {
 	printk(KERN_WARNING "Toshiba with broken keyboard detected. If your keyboard sometimes generates 3 keypresses instead of one, see http://davyd.ucc.asn.au/projects/toshiba/README\n");
 	return 0;
 }
 
-static int __init ich10_bios_quirk(struct dmi_system_id *d)
+static int __init ich10_bios_quirk(const struct dmi_system_id *d)
 {
     u32 port, smictl;
 
@@ -488,14 +488,14 @@ static int __init ich10_bios_quirk(struct dmi_system_id *d)
     return 0;
 }
 
-static __init int reset_videomode_after_s3(struct dmi_blacklist *d)
+static __init int reset_videomode_after_s3(const struct dmi_blacklist *d)
 {
 	/* See wakeup.S */
 	acpi_video_flags |= 2;
 	return 0;
 }
 
-static __init int dmi_disable_acpi(struct dmi_blacklist *d) 
+static __init int dmi_disable_acpi(const struct dmi_blacklist *d)
 { 
 	if (!acpi_force) { 
 		printk(KERN_NOTICE "%s detected: acpi off\n",d->ident);
@@ -510,7 +510,7 @@ static __init int dmi_disable_acpi(struct dmi_blacklist *d)
 /*
  * Limit ACPI to CPU enumeration for HT
  */
-static __init int force_acpi_ht(struct dmi_blacklist *d) 
+static __init int force_acpi_ht(const struct dmi_blacklist *d)
 { 
 	if (!acpi_force) { 
 		printk(KERN_NOTICE "%s detected: force use of acpi=ht\n", d->ident);
@@ -533,7 +533,7 @@ static __init int force_acpi_ht(struct dmi_blacklist *d)
  *	interrupt mask settings according to the laptop
  */
  
-static __initdata struct dmi_blacklist dmi_blacklist[]={
+static const struct dmi_blacklist __initconst dmi_blacklist[]={
 
 	{ broken_toshiba_keyboard, "Toshiba Satellite 4030cdt", { /* Keyboard generates spurious repeats */
 			MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
@@ -708,10 +708,10 @@ void __init dmi_scan_machine(void)
  *	returns non zero or we hit the end. Callback function is called for
  *	each successfull match. Returns the number of matches.
  */
-int __init dmi_check_system(struct dmi_system_id *list)
+int __init dmi_check_system(const struct dmi_system_id *list)
 {
 	int i, count = 0;
-	struct dmi_system_id *d = list;
+	const struct dmi_system_id *d = list;
 
 	while (d->ident) {
 		for (i = 0; i < ARRAY_SIZE(d->matches); i++) {
xen/arch/x86/genapic/bigsmp.c +2 -2
index 91a973ac16..2ed1cb8f49 100644
@@ -11,7 +11,7 @@
 #include <asm/mach-default/mach_mpparse.h>
 #include <asm/io_apic.h>
 
-static __init int force_bigsmp(struct dmi_system_id *d)
+static __init int force_bigsmp(const struct dmi_system_id *d)
 {
 	printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
 	def_to_bigsmp = true;
@@ -19,7 +19,7 @@ static __init int force_bigsmp(struct dmi_system_id *d)
 }
 
 
-static struct dmi_system_id __initdata bigsmp_dmi_table[] = {
+static const struct dmi_system_id __initconst bigsmp_dmi_table[] = {
 	{ force_bigsmp, "UNISYS ES7000-ONE", {
 		DMI_MATCH(DMI_PRODUCT_NAME, "ES7000-ONE")
 	 }},
xen/arch/x86/hvm/quirks.c +2 -2
index a298ccdbb9..906bf80cc3 100644
@@ -24,7 +24,7 @@
 s8 __read_mostly hvm_port80_allowed = -1;
 boolean_param("hvm_port80", hvm_port80_allowed);
 
-static int __init dmi_hvm_deny_port80(/*const*/ struct dmi_system_id *id)
+static int __init dmi_hvm_deny_port80(const struct dmi_system_id *id)
 {
     printk(XENLOG_WARNING "%s: port 0x80 access %s allowed for HVM guests\n",
            id->ident, hvm_port80_allowed > 0 ? "forcibly" : "not");
@@ -41,7 +41,7 @@ static int __init check_port80(void)
      * Quirk table for systems that misbehave (lock up, etc.) if port
      * 0x80 is used:
      */
-    static struct dmi_system_id __initdata hvm_no_port80_dmi_table[] =
+    static const struct dmi_system_id __initconst hvm_no_port80_dmi_table[] =
     {
         {
             .callback = dmi_hvm_deny_port80,
xen/arch/x86/ioport_emulate.c +1 -1
index 504bc513e2..626533b66c 100644
@@ -34,7 +34,7 @@ static bool ioemul_handle_proliant_quirk(
 }
 
 /* This table is the set of system-specific I/O emulation hooks. */
-static struct dmi_system_id __initdata ioport_quirks_tbl[] = {
+static const struct dmi_system_id __initconst ioport_quirks_tbl[] = {
     /*
      * I/O emulation hook for certain HP ProLiant servers with
      * 'special' SMM goodness.
xen/arch/x86/shutdown.c +2 -2
index 69b82542b3..3af7b5b023 100644
@@ -157,7 +157,7 @@ static void default_reboot_type(void)
         reboot_type = BOOT_ACPI;
 }
 
-static int __init override_reboot(struct dmi_system_id *d)
+static int __init override_reboot(const struct dmi_system_id *d)
 {
     enum reboot_type type = (long)d->driver_data;
 
@@ -181,7 +181,7 @@ static int __init override_reboot(struct dmi_system_id *d)
     return 0;
 }
 
-static struct dmi_system_id __initdata reboot_dmi_table[] = {
+static const struct dmi_system_id __initconst reboot_dmi_table[] = {
     {    /* Handle problems with rebooting on Dell E520's */
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_KBD,
xen/arch/x86/x86_64/mmconf-fam10h.c +1 -1
index fa2f5b4881..5af6f22c9f 100644
@@ -185,7 +185,7 @@ void fam10h_check_enable_mmcfg(void)
 	wrmsrl(MSR_FAM10H_MMIO_CONF_BASE, val);
 }
 
-static struct dmi_system_id __initdata mmconf_dmi_table[] = {
+static const struct dmi_system_id __initconst mmconf_dmi_table[] = {
 	{
 		.ident = "Sun Microsystems Machine",
 		.matches = {
xen/include/xen/dmi.h +2 -2
index eba2c27b2f..fa25f6cd38 100644
@@ -24,7 +24,7 @@ struct dmi_strmatch {
 };
 
 struct dmi_system_id {
-	int (*callback)(struct dmi_system_id *);
+	int (*callback)(const struct dmi_system_id *);
 	char *ident;
 	struct dmi_strmatch matches[4];
 	void *driver_data;
@@ -32,7 +32,7 @@ struct dmi_system_id {
 
 #define DMI_MATCH(a,b)	{ a, b }
 
-extern int dmi_check_system(struct dmi_system_id *list);
+extern int dmi_check_system(const struct dmi_system_id *list);
 extern void dmi_scan_machine(void);
 extern const char *dmi_get_table(paddr_t *base, u32 *len);
 extern void dmi_efi_get_table(const void *smbios, const void *smbios3);
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

PATCH 1/3 x86: Drop CONFIG_ACPI_SLEEP

In reply to Andrew Cooper

This option is hardcoded to 1, and the #ifdef-ary doesn't exclude wakeup.S, which makes it useless code noise.

---
CC: Jan Beulich <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>

An alternative would be to wire it into Kconfig properly and properly exclude wakeup.S, but that is more complicated than I have time for. Thoughts?

---
 xen/arch/x86/acpi/boot.c     | 4 ----
 xen/arch/x86/dmi_scan.c      | 7 ++-----
 xen/include/asm-x86/acpi.h   | 4 ----
 xen/include/asm-x86/config.h | 1 -
 4 files changed, 2 insertions(+), 14 deletions(-)
xen/arch/x86/acpi/boot.c +0 -4
index 1382b4dcd0..15542a9bdf 100644
@@ -332,7 +332,6 @@ static int __init acpi_invalidate_bgrt(struct acpi_table_header *table)
 	return 0;
 }
 
-#ifdef CONFIG_ACPI_SLEEP
 #define acpi_fadt_copy_address(dst, src, len) do {			\
 	if (fadt->header.revision >= FADT2_REVISION_ID &&		\
 	    fadt->header.length >= ACPI_FADT_V2_SIZE)			\
@@ -457,7 +456,6 @@ acpi_fadt_parse_sleep_info(struct acpi_table_fadt *fadt)
 	memset(&acpi_sinfo.sleep_status + 1, 0,
 	       (long)(&acpi_sinfo + 1) - (long)(&acpi_sinfo.sleep_status + 1));
 }
-#endif
 
 static int __init acpi_parse_fadt(struct acpi_table_header *table)
 {
@@ -501,9 +499,7 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table)
 	acpi_enable_value  = fadt->acpi_enable;
 	acpi_disable_value = fadt->acpi_disable;
 
-#ifdef CONFIG_ACPI_SLEEP
 	acpi_fadt_parse_sleep_info(fadt);
-#endif
 
 	return 0;
 }
xen/arch/x86/dmi_scan.c +2 -5
index 31caad133e..7063c2c799 100644
@@ -488,14 +488,12 @@ static int __init ich10_bios_quirk(struct dmi_system_id *d)
     return 0;
 }
 
-#ifdef CONFIG_ACPI_SLEEP
 static __init int reset_videomode_after_s3(struct dmi_blacklist *d)
 {
-	/* See acpi_wakeup.S */
+	/* See wakeup.S */
 	acpi_video_flags |= 2;
 	return 0;
 }
-#endif
 
 static __init int dmi_disable_acpi(struct dmi_blacklist *d) 
 { 
@@ -541,12 +539,11 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
 			MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
 			NO_MATCH, NO_MATCH, NO_MATCH
 			} },
-#ifdef CONFIG_ACPI_SLEEP
+
 	{ reset_videomode_after_s3, "Toshiba Satellite 4030cdt", { /* Reset video mode after returning from ACPI S3 sleep */
 			MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
 			NO_MATCH, NO_MATCH, NO_MATCH
 			} },
-#endif
 
 	{ ich10_bios_quirk, "Intel board & BIOS",
 		/*
xen/include/asm-x86/acpi.h +0 -4
index a105d1186c..7032f3a001 100644
@@ -105,8 +105,6 @@ extern s8 acpi_numa;
 extern int acpi_scan_nodes(u64 start, u64 end);
 #define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
 
-#ifdef CONFIG_ACPI_SLEEP
-
 extern struct acpi_sleep_info acpi_sinfo;
 #define acpi_video_flags bootsym(video_flags)
 struct xenpf_enter_acpi_sleep;
@@ -134,8 +132,6 @@ struct acpi_sleep_info {
     bool_t sleep_extended;
 };
 
-#endif /* CONFIG_ACPI_SLEEP */
-
 #define MAX_MADT_ENTRIES	MAX(256, 2 * NR_CPUS)
 extern u32 x86_acpiid_to_apicid[];
 #define MAX_LOCAL_APIC		MAX(256, 4 * NR_CPUS)
xen/include/asm-x86/config.h +0 -1
index 9ef9d03ca7..6e4f28d934 100644
@@ -34,7 +34,6 @@
 /* Intel P4 currently has largest cache line (L2 line size is 128 bytes). */
 #define CONFIG_X86_L1_CACHE_SHIFT 7
 
-#define CONFIG_ACPI_SLEEP 1
 #define CONFIG_ACPI_NUMA 1
 #define CONFIG_ACPI_SRAT 1
 #define CONFIG_ACPI_CSTATE 1
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#9 lore raw

[Xen-devel] [PATCH 4/3] x86/dmi: Drop warning with an obsolete URL

In reply to Andrew Cooper

This quirk doesn't change anything in Xen, and the web page doesn't exist.

The wayback machine confirms that the link disappeared somewhere between 2003-06-14 and 2004-07-07.

---
CC: Jan Beulich <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>

---
 xen/arch/x86/dmi_scan.c | 15 ---------------
 1 file changed, 15 deletions(-)
xen/arch/x86/dmi_scan.c +0 -15
index 808fa7f10e..053f0598cc 100644
@@ -455,16 +455,6 @@ static void __init dmi_save_ident(struct dmi_header *dm, int slot, int string)
 #define NO_MATCH	{ DMI_NONE, NULL}
 #define MATCH		DMI_MATCH
 
-/*
- * Toshiba keyboard likes to repeat keys when they are not repeated.
- */
-
-static __init int broken_toshiba_keyboard(const struct dmi_blacklist *d)
-{
-	printk(KERN_WARNING "Toshiba with broken keyboard detected. If your keyboard sometimes generates 3 keypresses instead of one, see http://davyd.ucc.asn.au/projects/toshiba/README\n");
-	return 0;
-}
-
 static int __init ich10_bios_quirk(const struct dmi_system_id *d)
 {
     u32 port, smictl;
@@ -535,11 +525,6 @@ static __init int force_acpi_ht(const struct dmi_blacklist *d)
  
 static const struct dmi_blacklist __initconst dmi_blacklist[]={
 
-	{ broken_toshiba_keyboard, "Toshiba Satellite 4030cdt", { /* Keyboard generates spurious repeats */
-			MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
-			NO_MATCH, NO_MATCH, NO_MATCH
-			} },
-
 	{ reset_videomode_after_s3, "Toshiba Satellite 4030cdt", { /* Reset video mode after returning from ACPI S3 sleep */
 			MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
 			NO_MATCH, NO_MATCH, NO_MATCH
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#11 lore raw
In reply to Andrew Cooper
Quoted 2 lines · Andrew Cooper

This is all trivial cleanup spotted after having come collisions in the XenServer patchqueue when rebasing over Rogers PCI SBDF changes in staging.

/sigh and further looking through dmi_scan.c has revealed that dmi_save_ident() leaks all of the strings it gets, because alloc_bootmem() is aliased to xmalloc_bytes() and never freed.

If someone has time to fix this then please do.  If not, I'll put it into my todo list.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by on v1 1/3
#2 lore raw

Re: [Xen-devel] [PATCH 1/3] x86: Drop CONFIG_ACPI_SLEEP

In reply to Andrew Cooper
Quoted 4 lines · Andrew Cooper

This option is hardcoded to 1, and the #ifdef-ary doesn't exclude wakeup.S, which makes it useless code noise.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by on v1 2/3
#4 lore raw

Re: [Xen-devel] [PATCH 2/3] x86/dmi: Drop trivial callback functions

In reply to Andrew Cooper
Quoted 7 lines · Andrew Cooper

dmi_check_system() returns the number of matches. This being nonzero is more efficient than calling into a trivial function to modify a variable.

No functional change, but this results in less compiled code, which is also (fractionally) quicker to run.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by on v1 3/3
#6 lore raw

Re: [Xen-devel] [PATCH 3/3] x86/dmi: Constify quirks data

In reply to Andrew Cooper
Quoted 4 lines · Andrew Cooper

All DMI quirks tables are mutable, but are only ever read.

Update dmi_check_system() and dmi_system_id.callback to pass a const pointer, and move all quirks tables into __initconst.

I think you need to use __initconstrel throughout.

Quoted 3 lines

No functional change.

With that adjustment

Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Acked-by
#10 lore raw

Re: [Xen-devel] [PATCH 4/3] x86/dmi: Drop warning with an obsolete URL

In reply to Andrew Cooper
Quoted 6 lines · Andrew Cooper

This quirk doesn't change anything in Xen, and the web page doesn't exist.

The wayback machine confirms that the link disappeared somewhere between 2003-06-14 and 2004-07-07.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#7 lore raw

Re: [Xen-devel] [PATCH 3/3] x86/dmi: Constify quirks data

In reply to Jan Beulich
Quoted 6 lines · Jan Beulich
Quoted 4 lines · Andrew Cooper

All DMI quirks tables are mutable, but are only ever read.

Update dmi_check_system() and dmi_system_id.callback to pass a const pointer, and move all quirks tables into __initconst.

I think you need to use __initconstrel throughout.

Hmm - what's the practical difference?  __initconst certainly compiles fine for me.

(I've got no vested interest, but I'd like to understand why)

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#8 lore raw

Re: [Xen-devel] [PATCH 3/3] x86/dmi: Constify quirks data

Quoted 4 lines · Andrew Cooper
Quoted 3 lines · Jan Beulich
Quoted 2 lines · Andrew Cooper

All DMI quirks tables are mutable, but are only ever read.

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

Update dmi_check_system() and dmi_system_id.callback to pass a const pointer, and move all quirks tables into __initconst.

I think you need to use __initconstrel throughout.

Hmm - what's the practical difference?  __initconst certainly compiles fine for me.

(I've got no vested interest, but I'd like to understand why)

Some compiler versions dislike mixing of .section with the same name, but different "writable" attributes. When static initializers involve relocations, the respective section gets marked writable by the compiler, whereas when they don't the section would remain readonly. Hence things generally build fine either way _until_ both an initconst item with and one without relocations appear in the same CU.

Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel