From nobody Tue Apr 23 19:20:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1568025916; cv=none; d=zoho.com; s=zohoarc; b=UNp/vzS9LiR7vsghco2z/EjuuLbYBnVyli3OQ7nE7aXUNN4mi1fauEufYRz7gR2fS89hFN19vCXu6GpQRLCYI8eEWP/jzlUkI5YmIgygWwdYAY5ZxF4ShLQcb7yK9I/NV6GbBkZq56IQFuSQTSZkcMT4tKwd3yQD7aycmap4hdM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568025916; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=5kyGTup/Vs2PP2qcKeUCg3kJYC9ZWrXoDAe3M+3bJfk=; b=ZxN5QsmyeZnC25s1YRB8QwPOCcFZ/Jm+25ZFkv09IGd/RVlyJagrWeMd/Mxbe2ZwgsBUbKaSqFen8R1bAz02CRTvY6Bd+tdG4AuXRocOzilyV0mcV9AvbzYrdv66CQgeGgmxlU3p45IqEzkn01tHMEVqhXuQVpOd6RW57yE/sW4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; 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 1568025916801525.4769733331718; Mon, 9 Sep 2019 03:45:16 -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 1i7H9Y-00054e-V0; Mon, 09 Sep 2019 10:44:12 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i7H9X-00054U-KY for xen-devel@lists.xenproject.org; Mon, 09 Sep 2019 10:44:11 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id c1a85386-d2ee-11e9-b76c-bc764e2007e4; Mon, 09 Sep 2019 10:44:11 +0000 (UTC) X-Inumbo-ID: c1a85386-d2ee-11e9-b76c-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1568025851; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=pbzWSKaX+Wm3RY+4CLESZ4ZMerCguRXM3oPuyvc0cdM=; b=Owh/Tp700t+/ju2tkjFSLU+q5p7zqPxupm7Y8WH/ckr8fZ4yhoCBpUGC TwFgov6RwznJtZ7g8Lo4FIcQkHvxnPITM44FLzX+TnjDliw/I8f/GGx3k M3x5q1wi2gtH+DGMUo5o5qbU5N4pbxLzruAmlZzwBwVWfJkvcOaV85Nnf c=; Authentication-Results: esa2.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 (esa2.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=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.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=esa2.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 (esa2.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=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: jSImWnGeiga63TUO9HlVbQ7MTI83V3aEEWY5U465QQk9RvvW/JDZWFNZcXMVNrysM87M9bLWl2 5bhmFOWoUWiDaERtk6XAgr0l6pzJf0Tv14FEr1aK9tZuQ6V87+K9O3tZPfAYSDc0dGAOKbeAxl Yprs5w8oeOHV+bLjfDnTFGDN/ta6Gq1ljH/HZviE7+LDDujzzl6/pWqgohM1y/rSaXUK4edKzN 6qfONE2axwJKfnQK2FfR7WOxZxxWmFaPN2wMS+9B1vqcea4mdfC1cPNH6aiKtvCdCqvzOUkFSU 9OQ= X-SBRS: 2.7 X-MesageID: 5307168 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,484,1559534400"; d="scan'208";a="5307168" From: Andrew Cooper To: Xen-devel Date: Mon, 9 Sep 2019 11:44:07 +0100 Message-ID: <20190909104407.13666-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86: Misc trivial cleanup of bootsym_phys() 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 , Lukasz Hawrylko , 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" X-ZohoMail-DKIM: fail (Header signature does not verify) In smpboot, there is no need to abstract setup_trampoline() away. Drop the define and use bootsym_phys() directly. In tboot, the 3 size calculations are invariant of their bootsym_phys()/__p= a() transformations, but the compiler can't tell this. Drop the tranformations, which simplifies the compiled function. add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-134 (-134) Function old new delta tboot_shutdown 620 486 -134 Total: Before=3D3337042, After=3D3336908, chg -0.00% Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Lukasz Hawrylko --- xen/arch/x86/smpboot.c | 4 +--- xen/arch/x86/tboot.c | 9 +++------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index 911416c1e1..6904ef5771 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -46,8 +46,6 @@ #include #include =20 -#define setup_trampoline() (bootsym_phys(trampoline_realmode_entry)) - unsigned long __read_mostly trampoline_phys; =20 /* representing HT siblings of each logical CPU */ @@ -545,7 +543,7 @@ static int do_boot_cpu(int apicid, int cpu) =20 booting_cpu =3D cpu; =20 - start_eip =3D setup_trampoline(); + start_eip =3D bootsym_phys(trampoline_realmode_entry); =20 /* start_eip needs be page aligned, and below the 1M boundary. */ if ( start_eip & ~0xff000 ) diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c index 8263f24009..3e828fe204 100644 --- a/xen/arch/x86/tboot.c +++ b/xen/arch/x86/tboot.c @@ -370,16 +370,13 @@ void tboot_shutdown(uint32_t shutdown_type) g_tboot_shared->num_mac_regions =3D 3; /* S3 resume code (and other real mode trampoline code) */ g_tboot_shared->mac_regions[0].start =3D bootsym_phys(trampoline_s= tart); - g_tboot_shared->mac_regions[0].size =3D bootsym_phys(trampoline_en= d) - - bootsym_phys(trampoline_star= t); + g_tboot_shared->mac_regions[0].size =3D trampoline_end - trampolin= e_start; /* hypervisor .text + .rodata */ g_tboot_shared->mac_regions[1].start =3D (uint64_t)__pa(&_stext); - g_tboot_shared->mac_regions[1].size =3D __pa(&__2M_rodata_end) - - __pa(&_stext); + g_tboot_shared->mac_regions[1].size =3D __2M_rodata_end - _stext; /* hypervisor .data + .bss */ g_tboot_shared->mac_regions[2].start =3D (uint64_t)__pa(&__2M_rwda= ta_start); - g_tboot_shared->mac_regions[2].size =3D __pa(&__2M_rwdata_end) - - __pa(&__2M_rwdata_start); + g_tboot_shared->mac_regions[2].size =3D __2M_rwdata_end - __2M_rwd= ata_start; =20 /* * MAC domains and other Xen memory --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel