public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Mikolaj Lisik" <lisik@google.com>
To: Pedro Falcato <pedro.falcato@gmail.com>
Cc: devel@edk2.groups.io, Erdem Aktas <erdemaktas@google.com>,
	 James Bottomley <jejb@linux.ibm.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>, Min Xu <min.m.xu@intel.com>,
	 Tom Lendacky <thomas.lendacky@amd.com>,
	michael.roth@amd.com
Subject: Re: [edk2-devel] [PATCH] OvmfPkg: Create additional PML4 entries for large SEV-SNP VMs
Date: Tue, 24 Jan 2023 17:44:51 -0800	[thread overview]
Message-ID: <CADtC8PXzE8QjRzdR9NH-H=76qwhjQebq2RM4ddSTFBO9nRvcVQ@mail.gmail.com> (raw)
In-Reply-To: <CAKbZUD3z82Z4nP2PmfS-ED=_0UpGTRCnh4b7vw+RrRVKGCziTQ@mail.gmail.com>

Thanks for the review!

> Please swap the Present and ReadWrite lines. You should only set
> Present after everything else as to avoid explicit caching (TLB and
> paging structure) issues.
>
> Although this whole file is full of spotty behavior. ASSERTS can get
> deleted and the file is full of them.

Yes, keeping consistency with the rest of the file was my main
motivation for doing things this way. Will add popper error handling
bere in V2.

> There are plenty of Present = 1 sets before setting other important
> bits like RW, which *will* cause you to get bad TLB entries if the CPU
> speculates a load/store to that address.
...
> *sigh*
> In any case, because of that CpuFlushTlb () your patch isn't wrong,
> but it should be changed into something more MMU-code natural.

Makes sense! Thanks for all this information. Yes, I simply wanted to
order setting of the bits exactly as they have been done before in the
file. Will adjust in V2 and send a second patch adjusting them for
other instances.

Mikolaj

      parent reply	other threads:[~2023-01-25  1:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13  0:57 [PATCH] OvmfPkg: Create additional PML4 entries for large SEV-SNP VMs lisik
2023-01-14  2:35 ` [edk2-devel] " Pedro Falcato
2023-01-16 10:39   ` Gerd Hoffmann
2023-01-25  1:53     ` Mikolaj Lisik
2023-01-25  1:44   ` Mikolaj Lisik [this message]

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='CADtC8PXzE8QjRzdR9NH-H=76qwhjQebq2RM4ddSTFBO9nRvcVQ@mail.gmail.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