From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mx.groups.io with SMTP id smtpd.web10.2586.1680024678503103736 for ; Tue, 28 Mar 2023 10:31:18 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@bsdio.com header.s=fm3 header.b=WRx1uV4l; spf=pass (domain: bsdio.com, ip: 66.111.4.26, mailfrom: rebecca@bsdio.com) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id BC8C35C00EC; Tue, 28 Mar 2023 13:31:17 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 28 Mar 2023 13:31:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdio.com; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1680024677; x= 1680111077; bh=7JQR6/Hl8KaYHbIz1E+ya/4Lw/nKZhCdBBo4pK7PXI4=; b=W Rx1uV4lSBdAqEY2AM5TW721QZEwHdGTGlLLMwaA2bpuJ07l6YC1tPMbrZUBv69R/ sb9B1Y/2ko4IxsecYkmDHW2uBhJZkQQ1Ykp/x7hrjmd2uDGFVwhWp3fjFkhFs/mp cQ9Ft6RpIkf1psOJumYVDs1ZWbiUAckK2lyzxZwPjlTi+W3xchDZm1W6TAb7vRqp l38kN3/x5v3dge4pG4FvfkXJB4PYbyxWlp99ZdaP29nzRmg1pwkDQkF4ueqs/IMg SAwxLMoGOwzbIbbzh1zOOFoDjstKwy6SvNkF6PIuzDKyheRXuS60TMAsz+KwGw8s 9Q82VmFoncALBi93R6LFw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1680024677; x= 1680111077; bh=7JQR6/Hl8KaYHbIz1E+ya/4Lw/nKZhCdBBo4pK7PXI4=; b=C a4/pb67fbvZleb+ydzWegGeiEOMeaDd4rXEaIVR1a36MBR78fxSDdaFxbxzV9bF8 P1uUPSUMSrOINBE0MD4r2mHhFYYMeOvmC/3UWyzixKjdLdiis02Lcl7Ong5dgdfC UW+zRSxqDZtlLUmbsolKrzE+2outULO1FGgGXf9VAvUF11z62yxKPkq5LWkzxgwt 8fgd8v0Vz0G6Eu93K5ad/n2hA5KjhYKc2kE8Ra9AzMFNGzX3gIntgH/sK6vkP3sP SjPtyu4jyPPgzIa+i7FrB+AR+Q3HCtLgcy02C0CzevwFWrZ1JQJFKXx6YIm33RBL Xbtp5294sgREoyq4pjpVQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdehgedguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeftvggs vggttggrucevrhgrnhcuoehrvggsvggttggrsegsshguihhordgtohhmqeenucggtffrrg htthgvrhhnpeegffeuueelvdeggfdvvdfgtedvudfhfeekudekieektddukeefteetieef vdelfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hrvggsvggttggrsegsshguihhordgtohhm X-ME-Proxy: Feedback-ID: i5b994698:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 Mar 2023 13:31:16 -0400 (EDT) From: "Rebecca Cran" To: devel@edk2.groups.io, Oliver Smith-Denny , Guomin Jiang , Xiaoyu Lu , Jian J Wang , Jiewen Yao , Ard Biesheuvel , Jordan Justen , Gerd Hoffmann , Bob Feng , Liming Gao , Andrew Fish , Leif Lindholm , Michael D Kinney Cc: Rebecca Cran Subject: [PATCH v2 01/13] OvmfPkg: Replace static struct initialization with ZeroMem call Date: Tue, 28 Mar 2023 11:30:59 -0600 Message-Id: <20230328173111.759017-2-rebecca@bsdio.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230328173111.759017-1-rebecca@bsdio.com> References: <20230328173111.759017-1-rebecca@bsdio.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Replace the static struct initialization with a call to ZeroMem to avoid generating a call to memset in certain build configurations. Signed-off-by: Rebecca Cran Reviewed-by: Gerd Hoffmann Reviewed-by: Oliver Smith-Denny --- OvmfPkg/Library/PlatformInitLib/MemDetect.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c index 38cece9173e8..0bcdfb83721f 100644 --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c @@ -608,10 +608,12 @@ PlatformAddressWidthFromCpuid ( { UINT32 RegEax, RegEbx, RegEcx, RegEdx, Max; UINT8 PhysBits; - CHAR8 Signature[13] = { 0 }; + CHAR8 Signature[13]; BOOLEAN Valid = FALSE; BOOLEAN Page1GSupport = FALSE; + ZeroMem (Signature, sizeof (Signature)); + AsmCpuid (0x80000000, &RegEax, &RegEbx, &RegEcx, &RegEdx); *(UINT32 *)(Signature + 0) = RegEbx; *(UINT32 *)(Signature + 4) = RegEdx; -- 2.34.1