public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: Laszlo Ersek <lersek@redhat.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	Gerd Hoffmann <kraxel@redhat.com>
Cc: "ardb@kernel.org" <ardb@kernel.org>,
	"Xie, Yuanhao" <yuanhao.xie@intel.com>,
	"thomas.lendacky@amd.com" <thomas.lendacky@amd.com>
Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg:Fixed AsmRelocateApLoopStart and ensure allocated memory <4GB
Date: Fri, 6 Jan 2023 09:45:39 +0000	[thread overview]
Message-ID: <MN6PR11MB82443B7F7B3504DA687862748CFB9@MN6PR11MB8244.namprd11.prod.outlook.com> (raw)
In-Reply-To: <28b1ecd3-631e-8f00-6495-acd9ec76037b@redhat.com>

> This makes sense, but, again, even disregarding the problem that the
> code forgot to switch to the new page table, the idea should be spelled
> out in the commit message and/or in code comments. Preferably: both.
> 
> (In fact if the idea had been documented, Yuanhao might not have
> forgotten to implement the switch.)
> 

But the following cases still require the XD bit be removed from the active page table:
*. 32bit mode
    In fact, old 32bit logic contains a bug that paging might still be enabled when AP is in the idle loop.
    That's a long-exist bug. QEMU doesn't enable the memory protection feature resulting the paging is disabled in 32bit mode.
    Hence the bug doesn't appear in QEMU 32bit image.
    Yuanhao's logic tries to not create page table for 32bit mode. I agree with this because it simplifies the 32bit flow.
    But considering the paging might be enabled, XD removal logic should be kept.

*. 64bit AMD
    Today Yuanhao's logic tries to not modify AMD 64bit flow no matter SEV is enabled or not.
    But if the BSP page table is used by AP when running the code in the reserved memory, the XD bit removal logic should be
    kept for 64bit AMD.
    So, that means only 64bit Intel flow doesn't require the XD bit removal logic.
    Then, for code simplicity (reducing the branches), I recommend keeping the XD bit removal logic always.

Imaging in a long future that 32bit x86 support is removed from edk2 and the legacy SEV is removed as well, we can cleanup
the unnecessary XD bit removal then.
    

  reply	other threads:[~2023-01-06  9:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05  6:21 [PATCH] UefiCpuPkg:Fixed AsmRelocateApLoopStart and ensure allocated memory <4GB Yuanhao Xie
2023-01-05  6:28 ` [edk2-devel] " Ni, Ray
2023-01-05  7:19   ` Yuanhao Xie
2023-01-05  9:38 ` Ard Biesheuvel
2023-01-06  4:12   ` Ni, Ray
2023-01-06  6:42     ` Laszlo Ersek
2023-01-06  8:03       ` Gerd Hoffmann
2023-01-06  8:30         ` Laszlo Ersek
2023-01-06  8:39           ` Ni, Ray
2023-01-06  9:19             ` Laszlo Ersek
2023-01-06  9:45               ` Ni, Ray [this message]
2023-01-06 10:35                 ` Laszlo Ersek
2023-01-06 11:14                   ` Gerd Hoffmann
2023-01-06 12:20                     ` Laszlo Ersek
2023-01-06  8:43         ` Yuanhao Xie
2023-01-06  9:04           ` Laszlo Ersek
2023-01-06 15:42         ` Lendacky, Thomas

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=MN6PR11MB82443B7F7B3504DA687862748CFB9@MN6PR11MB8244.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