From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web10.127.1686245019028191765 for ; Thu, 08 Jun 2023 10:23:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AdtE/a1M; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9528160DBD; Thu, 8 Jun 2023 17:23:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10B26C433EF; Thu, 8 Jun 2023 17:23:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686245018; bh=Rqt7cTns0ehB5cq5B0xRL94siy0uVDb77oI3g0KixpI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AdtE/a1M3j+M1lS+bLfu9q7+4VFI8GAS/Pa7BMFpIZqPDnwxwRNaf4HK5jc3iv61g IPt0tn8wdnvdbJivH4l3t5cemwvmqwbF6NxeFnPIs4JmCpO514yKQGUyAhzRkWl/6a 7wURN7xW0lc2yRj++xyD7Qh0qT+Ktcnn32CKht0f7G8jenmFsrPi641cPXvmAGcRMf cAA/L9cJoi8MiHR/IMMynxfcCsx9oQvAYvC1TBcANO5Scvb1aFe9MfF/MfbSDBtv0Z l9vt577wtiQb7jqHSuw1drKbZQtABarc58XFvZO1/avtMP30tkc+dGNYBKGHcjq7M6 CvzFQUMg/Hz1g== From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Ray Ni , Jiewen Yao , Gerd Hoffmann , Taylor Beebe , Oliver Smith-Denny , Dandan Bi , Dun Tan , Liming Gao , "Kinney, Michael D" , Michael Kubacki , Eric Dong , Rahul Kumar , Kun Qin Subject: [PATCH 1/2] UefiCpuPkg/CpuMpPei: Print correct buffer size used for page table Date: Thu, 8 Jun 2023 19:23:22 +0200 Message-Id: <20230608172323.9096-2-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230608172323.9096-1-ardb@kernel.org> References: <20230608172323.9096-1-ardb@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The DEBUG print that outputs the base and size of the page table allocation always prints 0x0 for the size, given that BufferSize will be updated by PageTableMap () and contain the unused allocation on return. So move the DEBUG print right after the allocation. Signed-off-by: Ard Biesheuvel --- UefiCpuPkg/CpuMpPei/CpuPaging.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/UefiCpuPkg/CpuMpPei/CpuPaging.c b/UefiCpuPkg/CpuMpPei/CpuPagin= g.c index b7ddb0005b6fbcac..175e47ccd737a0c1 100644 --- a/UefiCpuPkg/CpuMpPei/CpuPaging.c +++ b/UefiCpuPkg/CpuMpPei/CpuPaging.c @@ -396,6 +396,13 @@ EnablePaePageTable ( return EFI_OUT_OF_RESOURCES;=0D }=0D =0D + DEBUG ((=0D + DEBUG_INFO,=0D + "EnablePaePageTable: Created PageTable =3D 0x%x, BufferSize =3D %x\n",= =0D + PageTable,=0D + BufferSize=0D + ));=0D +=0D Status =3D PageTableMap (&PageTable, PagingPae, Buffer, &BufferSize, 0, = SIZE_4GB, &MapAttribute, &MapMask, NULL);=0D ASSERT_EFI_ERROR (Status);=0D if (EFI_ERROR (Status) || (PageTable =3D=3D 0)) {=0D @@ -417,13 +424,6 @@ EnablePaePageTable ( //=0D AsmWriteCr0 (AsmReadCr0 () | BIT31);=0D =0D - DEBUG ((=0D - DEBUG_INFO,=0D - "EnablePaePageTable: Created PageTable =3D 0x%x, BufferSize =3D %x\n",= =0D - PageTable,=0D - BufferSize=0D - ));=0D -=0D return Status;=0D }=0D =0D --=20 2.39.2