public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: "Xie, Yuanhao" <yuanhao.xie@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Subject: Re: [PATCH 2/4] UefiCpuPkg: Has APs in 64 bit long-mode before booting to OS.
Date: Mon, 19 Dec 2022 03:22:50 +0000	[thread overview]
Message-ID: <MWHPR11MB1631B068C13548BE720503EF8CE59@MWHPR11MB1631.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20221218214317.3431-3-yuanhao.xie@intel.com>

> +
> +    PageTable = CreatePageTable (
> +                  mReservedTopOfApStack,
> +                  ApSafeBufferSize
> +                  );
> +
> +    mApPageTable = PageTable;

1. Can you directly assign the CreatePageTable() return value to mApPageTable?
     So that the local "PageTable" is not needed.

> +
> +    mReservedTopOfApStack += CpuMpData->CpuCount * AP_SAFE_STACK_SIZE;
> +  }
2. Can you confirm if above change to mReservedTopOfApStack is needed for AMD path?

> diff --git a/UefiCpuPkg/Library/MpInitLib/Ia32/CreatePageTable.c b/UefiCpuPkg/Library/MpInitLib/Ia32/CreatePageTable.c
> new file mode 100644
> index 0000000000..54ec42469e
> --- /dev/null
> +++ b/UefiCpuPkg/Library/MpInitLib/Ia32/CreatePageTable.c
> @@ -0,0 +1,28 @@
> +/** @file
> +  CreatePageTable
3. File header comments are too simple.



> +
> +  Copyright (c) 2016 - 2022, Intel Corporation. All rights reserved.<BR>

4. Copyright year can be just "2022". No need to have "2016".

> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include <Base.h>
> +#include <Library/BaseMemoryLib.h>
> +#include <Library/DebugLib.h>

5. Can you try to remove the above two library header inclusion?

> +
> +/**
> +  Create or update page table.

6. The function header comments could be:
    "Create 1:1 mapping page table in reserved memory to map the specified address range."
    Please update in header file as well.

>  /**
>    Initialize global data for MP support.
> 
> diff --git a/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm b/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm
> index 47fc8e9325..b2d95adf6d 100644
> --- a/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm
> +++ b/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm
> @@ -514,4 +514,4 @@ DoHltAmd:
>      jmp        DoHltAmd
> 
>  BITS 64
> -AsmRelocateApLoopEndAmd:
> \ No newline at end of file
> +AsmRelocateApLoopEndAmd:

7. The change to add newline character should be in the first patch, not in this patch.


  reply	other threads:[~2022-12-19  3:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-18 21:43 [PATCH 0/4] Put APs in 64 bit long-mode before booting to OS Yuanhao Xie
2022-12-18 21:43 ` [PATCH 1/4] UefiCpuPkg: Duplicated AsmRelocateApLoop as AsmRelocateApLoopAmd Yuanhao Xie
2022-12-19  3:10   ` [edk2-devel] " Ni, Ray
2022-12-19  3:24   ` Ni, Ray
2022-12-18 21:43 ` [PATCH 2/4] UefiCpuPkg: Has APs in 64 bit long-mode before booting to OS Yuanhao Xie
2022-12-19  3:22   ` Ni, Ray [this message]
2022-12-18 21:43 ` [PATCH 3/4] OvmfPkg: Add CpuPageTableLib required by MpInitLib Yuanhao Xie
2022-12-19  3:23   ` [edk2-devel] " Ni, Ray
2022-12-19  5:44     ` Yao, Jiewen
2022-12-18 21:43 ` [PATCH 4/4] UefiPayloadPkg: " Yuanhao Xie
2022-12-19  1:06   ` [edk2-devel] " Guo, Gua
2022-12-19  3:23   ` Ni, Ray
  -- strict thread matches above, loose matches on Subject: below --
2022-12-19 21:40 [PATCH 0/4] Put APs in 64 bit long-mode before booting to OS Yuanhao Xie
2022-12-19 21:40 ` [PATCH 2/4] UefiCpuPkg: Has " Yuanhao Xie

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=MWHPR11MB1631B068C13548BE720503EF8CE59@MWHPR11MB1631.namprd11.prod.outlook.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