From nobody Mon Feb 9 09:16:24 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=1563990266; cv=none; d=zoho.com; s=zohoarc; b=MBQJYXQ/5WI/XHN02Svixe37fGLZX3MJ4IHuMLprprEpFWs8fyDYgEVFfVWKU2bcLDpbakyGCA8ygkWe7L4K8whDluZlqacxHw2vUMo9STAZd0rGB225evr4cgsA62eI/v2/AU/Hkcr+HN0iUHICRe/+e+RoPrB1x1dMjJG+FZg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563990266; 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=mKTzRu8/qRWMciBBCDqp7zGZina+i45dBTBUiVA4yqc=; b=QEBKrZp/L8nh4IJto5F44MOECNeIb9ElQ0UfleLjB1/snfC3izUHbc2kx6VXVjL4oQ9Zd5nW8MHG2DWN9dJg2GERl+mtlOI0YUVgKMO4afsaSGqyi/fMnRDv3MCWTRseiYFKGxMkyafxtdBE7mLetHnCoSR2OnF/TfWCiWI/qrA= 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 1563990266605591.0245953440954; Wed, 24 Jul 2019 10:44:26 -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 1hqLIF-0007kX-9i; Wed, 24 Jul 2019 17:43:11 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hqLID-0007jt-UK for xen-devel@lists.xenproject.org; Wed, 24 Jul 2019 17:43:09 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 7fd5dcd2-ae3a-11e9-8980-bc764e045a96; Wed, 24 Jul 2019 17:43:09 +0000 (UTC) X-Inumbo-ID: 7fd5dcd2-ae3a-11e9-8980-bc764e045a96 Authentication-Results: esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.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=esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 9zN1ffo3l/mw6vzOgEN4J1vYMsbwjRiFdBFDLGfrJHQaXtPvm29/RqESSeQVAozmiDzY5/lJ2A HJcQrhAQtdQ8cxiyTw1Yviqod5RFdAnwgSxqW6fxLl585i1ytBg7NG67ny5uyqvuWMbxWtW/qt vg39uXkiuLg5aGZwKT/3qIjuVpFnSJHn0boty8hajf+a7TH4Gi4g9gF57y1LCHe9I0BOgpCmmN 2qz5XTAM3Q//moRGY/aORZ8gT6PMczmtz7t38K6lm4kuP9cSrDP2K8Q5VP04LVHwbJP2+4yH7F Kus= X-SBRS: 2.7 X-MesageID: 3510257 X-Ironport-Server: esa4.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="3510257" From: Andrew Cooper To: Xen-devel Date: Wed, 24 Jul 2019 18:42:55 +0100 Message-ID: <20190724174256.5295-3-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 2/3] x86/dmi: Drop trivial callback functions 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" dmi_check_system() returns the number of matches. This being nonzero is mo= re 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. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/ioport_emulate.c | 18 +++--------------- xen/arch/x86/x86_64/mmconf-fam10h.c | 10 ++-------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/xen/arch/x86/ioport_emulate.c b/xen/arch/x86/ioport_emulate.c index c2aded7668..504bc513e2 100644 --- a/xen/arch/x86/ioport_emulate.c +++ b/xen/arch/x86/ioport_emulate.c @@ -33,12 +33,6 @@ static bool ioemul_handle_proliant_quirk( return true; } =20 -static int __init proliant_quirk(struct dmi_system_id *d) -{ - ioemul_handle_quirk =3D 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[] =3D { /* @@ -46,7 +40,6 @@ static struct dmi_system_id __initdata ioport_quirks_tbl[= ] =3D { * 'special' SMM goodness. */ { - .callback =3D proliant_quirk, .ident =3D "HP ProLiant DL3xx", .matches =3D { DMI_MATCH(DMI_BIOS_VENDOR, "HP"), @@ -54,7 +47,6 @@ static struct dmi_system_id __initdata ioport_quirks_tbl[= ] =3D { }, }, { - .callback =3D proliant_quirk, .ident =3D "HP ProLiant DL5xx", .matches =3D { DMI_MATCH(DMI_BIOS_VENDOR, "HP"), @@ -62,7 +54,6 @@ static struct dmi_system_id __initdata ioport_quirks_tbl[= ] =3D { }, }, { - .callback =3D proliant_quirk, .ident =3D "HP ProLiant DL7xx", .matches =3D { DMI_MATCH(DMI_BIOS_VENDOR, "HP"), @@ -70,7 +61,6 @@ static struct dmi_system_id __initdata ioport_quirks_tbl[= ] =3D { }, }, { - .callback =3D proliant_quirk, .ident =3D "HP ProLiant ML3xx", .matches =3D { DMI_MATCH(DMI_BIOS_VENDOR, "HP"), @@ -78,7 +68,6 @@ static struct dmi_system_id __initdata ioport_quirks_tbl[= ] =3D { }, }, { - .callback =3D proliant_quirk, .ident =3D "HP ProLiant ML5xx", .matches =3D { DMI_MATCH(DMI_BIOS_VENDOR, "HP"), @@ -86,7 +75,6 @@ static struct dmi_system_id __initdata ioport_quirks_tbl[= ] =3D { }, }, { - .callback =3D proliant_quirk, .ident =3D "HP ProLiant BL2xx", .matches =3D { DMI_MATCH(DMI_BIOS_VENDOR, "HP"), @@ -94,7 +82,6 @@ static struct dmi_system_id __initdata ioport_quirks_tbl[= ] =3D { }, }, { - .callback =3D proliant_quirk, .ident =3D "HP ProLiant BL4xx", .matches =3D { DMI_MATCH(DMI_BIOS_VENDOR, "HP"), @@ -102,7 +89,6 @@ static struct dmi_system_id __initdata ioport_quirks_tbl= [] =3D { }, }, { - .callback =3D proliant_quirk, .ident =3D "HP ProLiant BL6xx", .matches =3D { DMI_MATCH(DMI_BIOS_VENDOR, "HP"), @@ -114,7 +100,9 @@ static struct dmi_system_id __initdata ioport_quirks_tb= l[] =3D { =20 static int __init ioport_quirks_init(void) { - dmi_check_system(ioport_quirks_tbl); + if ( dmi_check_system(ioport_quirks_tbl) ) + ioemul_handle_quirk =3D ioemul_handle_proliant_quirk; + return 0; } __initcall(ioport_quirks_init); diff --git a/xen/arch/x86/x86_64/mmconf-fam10h.c b/xen/arch/x86/x86_64/mmco= nf-fam10h.c index f997688ad4..fa2f5b4881 100644 --- a/xen/arch/x86/x86_64/mmconf-fam10h.c +++ b/xen/arch/x86/x86_64/mmconf-fam10h.c @@ -185,15 +185,8 @@ void fam10h_check_enable_mmcfg(void) wrmsrl(MSR_FAM10H_MMIO_CONF_BASE, val); } =20 -static int __init set_check_enable_amd_mmconf(struct dmi_system_id *d) -{ - pci_probe |=3D PCI_CHECK_ENABLE_AMD_MMCONF; - return 0; -} - static struct dmi_system_id __initdata mmconf_dmi_table[] =3D { { - .callback =3D set_check_enable_amd_mmconf, .ident =3D "Sun Microsystems Machine", .matches =3D { DMI_MATCH(DMI_SYS_VENDOR, "Sun Microsystems"), @@ -204,5 +197,6 @@ static struct dmi_system_id __initdata mmconf_dmi_table= [] =3D { =20 void __init check_enable_amd_mmconf_dmi(void) { - dmi_check_system(mmconf_dmi_table); + if (dmi_check_system(mmconf_dmi_table)) + pci_probe |=3D PCI_CHECK_ENABLE_AMD_MMCONF; } --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel