From: "Michael Kubacki" <mikuback@linux.microsoft.com>
To: devel@edk2.groups.io, ardb@kernel.org
Cc: Ray Ni <ray.ni@intel.com>, Jiewen Yao <jiewen.yao@intel.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Taylor Beebe <t@taylorbeebe.com>,
Oliver Smith-Denny <osd@smith-denny.com>,
Dandan Bi <dandan.bi@intel.com>, Dun Tan <dun.tan@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>,
"Kinney, Michael D" <michael.d.kinney@intel.com>,
Eric Dong <eric.dong@intel.com>,
Rahul Kumar <rahul1.kumar@intel.com>, Kun Qin <kuqin12@gmail.com>
Subject: Re: [edk2-devel] [PATCH 1/2] UefiCpuPkg/CpuMpPei: Print correct buffer size used for page table
Date: Thu, 8 Jun 2023 15:25:08 -0400 [thread overview]
Message-ID: <e020adcf-a70a-8f0a-e2a8-4e4f410cc85a@linux.microsoft.com> (raw)
In-Reply-To: <20230608172323.9096-2-ardb@kernel.org>
Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
A couple comments below.
On 6/8/2023 1:23 PM, Ard Biesheuvel wrote:
> 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 <ardb@kernel.org>
> ---
> UefiCpuPkg/CpuMpPei/CpuPaging.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/UefiCpuPkg/CpuMpPei/CpuPaging.c b/UefiCpuPkg/CpuMpPei/CpuPaging.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;
>
> }
>
>
>
> + DEBUG ((
>
> + DEBUG_INFO,
>
> + "EnablePaePageTable: Created PageTable = 0x%x, BufferSize = %x\n",
>
> + PageTable,
>
> + BufferSize
>
> + ));
>
> +
In the past, a point was made to improve portability between 32-bit and
64-bit architectures by casting UINTN values to UINT64 and then printing
them %Lx. If this is a DEBUG only change that might be worth adding as well.
In any case, can you please prefix the print specifier for BufferSize
with "0x"?
>
> Status = PageTableMap (&PageTable, PagingPae, Buffer, &BufferSize, 0, SIZE_4GB, &MapAttribute, &MapMask, NULL);
>
> ASSERT_EFI_ERROR (Status);
>
> if (EFI_ERROR (Status) || (PageTable == 0)) {
>
> @@ -417,13 +424,6 @@ EnablePaePageTable (
> //
>
> AsmWriteCr0 (AsmReadCr0 () | BIT31);
>
>
>
> - DEBUG ((
>
> - DEBUG_INFO,
>
> - "EnablePaePageTable: Created PageTable = 0x%x, BufferSize = %x\n",
>
> - PageTable,
>
> - BufferSize
>
> - ));
>
> -
>
> return Status;
>
> }
>
>
>
next prev parent reply other threads:[~2023-06-08 19:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-08 17:23 [PATCH 0/2] UefiCpuPkg/CpuMpPei X64: reallocate page tables in PEI Ard Biesheuvel
2023-06-08 17:23 ` [PATCH 1/2] UefiCpuPkg/CpuMpPei: Print correct buffer size used for page table Ard Biesheuvel
2023-06-08 19:25 ` Michael Kubacki [this message]
2023-06-08 17:23 ` [PATCH 2/2] UefiCpuPkg/CpuMpPei X64: Reallocate page tables in permanent DRAM Ard Biesheuvel
2023-06-08 17:39 ` [edk2-devel] " Oliver Smith-Denny
2023-06-08 17:48 ` Ard Biesheuvel
2023-06-08 18:27 ` Sean
2023-06-08 19:32 ` Michael Kubacki
2023-06-08 22:17 ` Ard Biesheuvel
2023-06-08 19:38 ` Michael Kubacki
2023-06-09 0:24 ` Ni, Ray
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e020adcf-a70a-8f0a-e2a8-4e4f410cc85a@linux.microsoft.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox