From nobody Sat Apr 20 09:21:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1578489800; cv=none; d=zohomail.com; s=zohoarc; b=RSfnvOgwGhqvYxvz/dhXwBVF3snTcdJcomy8T786PEV7beQMHH7VD9vlTyP05qsaucZlzhhzXxDfDjj61VvOqbFdFMU0e4iNhAY5BzJ+uXzUKzbUjvgGWREesDTESrAyPt/EadUc9v5Ca2+MAxtNTscOkylfN+ldtdp7Nx7ubpY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578489800; 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; bh=UE/0sJSJyH9usvfKQsRWBnID9A3Cr2lREFVrRE18tfE=; b=jVlPjH8R7yB3fsw0me/vW1JSvWX+zApKySzWAlIV1QWHS4TBzoUkiOTJ68O1IeTKw6xBmlccIVruJsBOxeGySp/Sj3OW1TjqFjtN2KFMRKlDx47bTRuzcl7+08ap3wzxRQyKRhsgyE3fGvbtBxHnQSCIw3VHvgN+rDpIgpZVCuM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1578489800049309.41655283478553; Wed, 8 Jan 2020 05:23:20 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipBIN-0008VT-DW; Wed, 08 Jan 2020 13:22:47 +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 1ipBIM-0008VL-2E for xen-devel@lists.xenproject.org; Wed, 08 Jan 2020 13:22:46 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id f4abd1c4-3219-11ea-b7f4-12813bfff9fa; Wed, 08 Jan 2020 13:22:45 +0000 (UTC) X-Inumbo-ID: f4abd1c4-3219-11ea-b7f4-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1578489766; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=GWTtW/iClDApFXi8woALVRB6iPRyx6+Wv9Jkh+1vvNk=; b=VIq/bkkqs9egIgcVrYAVRN3GThiwLxnN7pf4wLekSXXoxcmc+BFLhOrW kUiPblEtdWQCkn7KGPubku2C96OqNHcx5uBfM+nrxhhqtmmD5Mi8XfQ9i S5wSz9TUqZLDM4ExzOJrItmD1HlqIH7zrN/vuwKP9foMpSrrmEBPJsv8Z I=; 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 (zohomail.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 ip4:168.245.78.127 ~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: HsNKVDwso4S4crO/12IiqoarTcb8SopdsbXAHVmQxfjSNdReOk6qx5nuKyahshuocDK/fmdvVH Qcug2d7/0EIVrOUUVyAYAHalyO7W9PjmgotFpRy2KUZFTiu76KEbY0t3Yzu+gbCI35clCEOUXx 5LTuzepj+adm2Qbf4jJK7bWbYXHflqq3J8osobGdVMs8eH6c9GvTzdolKbS2kTOL1drTqLTmNU uT7qxipnMskD5QhVCh8a6bYJFKSkDZPhWdlvERm4zi6n+DpGmZoq4uHVGiw20fzcJymDtvM2TE SH0= X-SBRS: 2.7 X-MesageID: 10638348 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.69,410,1571716800"; d="scan'208";a="10638348" From: Andrew Cooper To: Xen-devel Date: Wed, 8 Jan 2020 13:22:41 +0000 Message-ID: <20200108132241.8564-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/boot: Simplify BSS zeroing 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" X-ZohoMail-DKIM: fail (Header signature does not verify) There is no need to load a non-flat %es to zero the BSS. Use sym_esi() instead, which is easier to follow, faster (avoids two segment loads) and doesn't require use of the stack. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 Looking through the code, almost everything that uses sym_fs() would be bet= ter using sym_esi(). It is unnecessary extra instruction stream bytes, and AGU hit for every memory operand. Most importantly however, the code is far more simple to reason about when = it is consitent about being flat, rather than mixing and matching between flat and non-flat views of the same memory. --- xen/arch/x86/boot/head.S | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index 82395e91dd..1b729c37f8 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -617,16 +617,12 @@ trampoline_setup: jnz 1f =20 /* Initialize BSS (no nasty surprises!). */ - mov $sym_offs(__bss_start),%edi - mov $sym_offs(__bss_end),%ecx - push %fs - pop %es + lea sym_esi(__bss_start), %edi + lea sym_esi(__bss_end), %ecx sub %edi,%ecx xor %eax,%eax shr $2,%ecx rep stosl - push %ds - pop %es =20 1: /* Interrogate CPU extended features via CPUID. */ --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel