From nobody Mon Feb 9 14:03:02 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1563990261; cv=none; d=zoho.com; s=zohoarc; b=Plx/p55TZpWCr1yQsjD7NMmiu6Mx1vwrP7EpmCwIhDy4LslWVdsVqdGxHhwf81DSktECvmp2oQ0nqV9LcD06aLUG6KvXd7XZFI144NTf+DnabE+WpDjGuo5ehOpgQN9rZNWGB2xe0UdRuf6KLXbBgxWHfx8AflILx8+d+Pk4nXA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563990261; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=n/OJyGe4G5RAA8BBmByYTjVmYuxtUiOxkjHEzEjRrWk=; b=iH5kXlwXV8oIMEIUhaZvTzxiia0Q+P3BqJmW9f3BXSCdojfcxtNvNlbrmVXiFpzTzyiTg19s+BlW9SBGA87kOGbPugf8DNy5EvNzO7B34XOu2TaWCcMl65JcXUawdrytVpdqbbOBp8kBhuh0hfw9F58tGT7/zIFJh6oEs2R6eIs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1563990261892315.99001077316257; Wed, 24 Jul 2019 10:44:21 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hqLIE-0007jv-1K; Wed, 24 Jul 2019 17:43:10 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hqLID-0007jf-1R for xen-devel@lists.xenproject.org; Wed, 24 Jul 2019 17:43:09 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 7d820db0-ae3a-11e9-a97c-53c606eea54a; Wed, 24 Jul 2019 17:43:05 +0000 (UTC) X-Inumbo-ID: 7d820db0-ae3a-11e9-a97c-53c606eea54a Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: Z7r6putUKzAQFE0ZPcdflW8v8uurE2p6y/VjR5c6doNar6bYBdS0W52IjAkkLwLvJaa0c8Abx4 LUyXeqYlkRd8OOv+i35XKZhRXEF3Cp5kQaBK50TfkmHFAA9qfesew8wMnHCpyNh3PgBEB1nlU0 7mYiC1pjDTir5qzUa4b7XHKWSl5EILjShHv1MyBvtiqqNlKoziHWwnXP6sClX5HzuuxglmRCYa oYK/tuSCyx08TNV5kYXE0+0j8Utbf2N/kpKdc1lHq2wD5Bvyd3oNGddoeYRi6xvcdjh5CvpmnA WXs= X-SBRS: 2.7 X-MesageID: 3400782 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,303,1559534400"; d="scan'208";a="3400782" From: Andrew Cooper To: Xen-devel Date: Wed, 24 Jul 2019 18:42:56 +0100 Message-ID: <20190724174256.5295-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190724174256.5295-1-andrew.cooper3@citrix.com> References: <20190724174256.5295-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 3/3] x86/dmi: Constify quirks data X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" All DMI quirks tables are mutable, but are only ever read. Update dmi_check_system() and dmi_system_id.callback to pass a const pointe= r, and move all quirks tables into __initconst. No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 --- 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(-) diff --git a/xen/arch/x86/dmi_scan.c b/xen/arch/x86/dmi_scan.c index 7063c2c799..808fa7f10e 100644 --- a/xen/arch/x86/dmi_scan.c +++ b/xen/arch/x86/dmi_scan.c @@ -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. */ =20 -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 keybo= ard sometimes generates 3 keypresses instead of one, see http://davyd.ucc.a= sn.au/projects/toshiba/README\n"); return 0; } =20 -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; =20 @@ -488,14 +488,14 @@ static int __init ich10_bios_quirk(struct dmi_system_= id *d) return 0; } =20 -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 |=3D 2; return 0; } =20 -static __init int dmi_disable_acpi(struct dmi_blacklist *d)=20 +static __init int dmi_disable_acpi(const struct dmi_blacklist *d) {=20 if (!acpi_force) {=20 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)=20 +static __init int force_acpi_ht(const struct dmi_blacklist *d) {=20 if (!acpi_force) {=20 printk(KERN_NOTICE "%s detected: force use of acpi=3Dht\n", d->ident); @@ -533,7 +533,7 @@ static __init int force_acpi_ht(struct dmi_blacklist *d) * interrupt mask settings according to the laptop */ =20 -static __initdata struct dmi_blacklist dmi_blacklist[]=3D{ +static const struct dmi_blacklist __initconst dmi_blacklist[]=3D{ =20 { broken_toshiba_keyboard, "Toshiba Satellite 4030cdt", { /* Keyboard gen= erates 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 =3D 0; - struct dmi_system_id *d =3D list; + const struct dmi_system_id *d =3D list; =20 while (d->ident) { for (i =3D 0; i < ARRAY_SIZE(d->matches); i++) { diff --git a/xen/arch/x86/genapic/bigsmp.c b/xen/arch/x86/genapic/bigsmp.c index 91a973ac16..2ed1cb8f49 100644 --- a/xen/arch/x86/genapic/bigsmp.c +++ b/xen/arch/x86/genapic/bigsmp.c @@ -11,7 +11,7 @@ #include #include =20 -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=3Dbigsmp\n", d->ident); def_to_bigsmp =3D true; @@ -19,7 +19,7 @@ static __init int force_bigsmp(struct dmi_system_id *d) } =20 =20 -static struct dmi_system_id __initdata bigsmp_dmi_table[] =3D { +static const struct dmi_system_id __initconst bigsmp_dmi_table[] =3D { { force_bigsmp, "UNISYS ES7000-ONE", { DMI_MATCH(DMI_PRODUCT_NAME, "ES7000-ONE") }}, diff --git a/xen/arch/x86/hvm/quirks.c b/xen/arch/x86/hvm/quirks.c index a298ccdbb9..906bf80cc3 100644 --- a/xen/arch/x86/hvm/quirks.c +++ b/xen/arch/x86/hvm/quirks.c @@ -24,7 +24,7 @@ s8 __read_mostly hvm_port80_allowed =3D -1; boolean_param("hvm_port80", hvm_port80_allowed); =20 -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[] =3D + static const struct dmi_system_id __initconst hvm_no_port80_dmi_table[= ] =3D { { .callback =3D dmi_hvm_deny_port80, diff --git a/xen/arch/x86/ioport_emulate.c b/xen/arch/x86/ioport_emulate.c index 504bc513e2..626533b66c 100644 --- a/xen/arch/x86/ioport_emulate.c +++ b/xen/arch/x86/ioport_emulate.c @@ -34,7 +34,7 @@ static bool ioemul_handle_proliant_quirk( } =20 /* This table is the set of system-specific I/O emulation hooks. */ -static struct dmi_system_id __initdata ioport_quirks_tbl[] =3D { +static const struct dmi_system_id __initconst ioport_quirks_tbl[] =3D { /* * I/O emulation hook for certain HP ProLiant servers with * 'special' SMM goodness. diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c index 69b82542b3..3af7b5b023 100644 --- a/xen/arch/x86/shutdown.c +++ b/xen/arch/x86/shutdown.c @@ -157,7 +157,7 @@ static void default_reboot_type(void) reboot_type =3D BOOT_ACPI; } =20 -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 =3D (long)d->driver_data; =20 @@ -181,7 +181,7 @@ static int __init override_reboot(struct dmi_system_id = *d) return 0; } =20 -static struct dmi_system_id __initdata reboot_dmi_table[] =3D { +static const struct dmi_system_id __initconst reboot_dmi_table[] =3D { { /* Handle problems with rebooting on Dell E520's */ .callback =3D override_reboot, .driver_data =3D (void *)(long)BOOT_KBD, diff --git a/xen/arch/x86/x86_64/mmconf-fam10h.c b/xen/arch/x86/x86_64/mmco= nf-fam10h.c index fa2f5b4881..5af6f22c9f 100644 --- a/xen/arch/x86/x86_64/mmconf-fam10h.c +++ b/xen/arch/x86/x86_64/mmconf-fam10h.c @@ -185,7 +185,7 @@ void fam10h_check_enable_mmcfg(void) wrmsrl(MSR_FAM10H_MMIO_CONF_BASE, val); } =20 -static struct dmi_system_id __initdata mmconf_dmi_table[] =3D { +static const struct dmi_system_id __initconst mmconf_dmi_table[] =3D { { .ident =3D "Sun Microsystems Machine", .matches =3D { diff --git a/xen/include/xen/dmi.h b/xen/include/xen/dmi.h index eba2c27b2f..fa25f6cd38 100644 --- a/xen/include/xen/dmi.h +++ b/xen/include/xen/dmi.h @@ -24,7 +24,7 @@ struct dmi_strmatch { }; =20 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 { =20 #define DMI_MATCH(a,b) { a, b } =20 -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); --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel