public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: Dionna Amalie Glaze <dionnaglaze@google.com>
Cc: devel@edk2.groups.io, Ard Biesheuvel <ardb+tianocore@kernel.org>,
	 Erdem Aktas <erdemaktas@google.com>,
	James Bottomley <jejb@linux.ibm.com>,
	 Jiewen Yao <jiewen.yao@intel.com>, Min Xu <min.m.xu@intel.com>,
	 Tom Lendacky <thomas.lendacky@amd.com>,
	Michael Roth <michael.roth@amd.com>
Subject: Re: [PATCH] OvmfPkg: Fix SevMemoryAcceptance memory attributes
Date: Wed, 1 Feb 2023 14:52:20 +0100	[thread overview]
Message-ID: <CAMj1kXHi_Lms8KcXp9KxA5tfvm_AXSrZAGGyJBhP-OxxO-5SzQ@mail.gmail.com> (raw)
In-Reply-To: <CAAH4kHb0GirnyVCaBPdVCSEzHkRrY_fihtpUpdByLuLBz9uP1A@mail.gmail.com>

On Tue, 31 Jan 2023 at 20:18, Dionna Amalie Glaze
<dionnaglaze@google.com> wrote:
>
> >
> > efi: mem94: [Conventional|   |  |CC|  |  |  |  |  |  |   |  |  |  |  ]
> > range=[0x0000000100000000-0x000000023fffffff] (5120MB)
> >
> > This does not have the cache capabilities one would expect for system
> > memory, UC|WC|WT|WB.
> >
> > After this change, the same entry becomes
> >
> > efi: mem94: [Conventional|   |  |CC|  |  |  |  |  |  |   |WB|WT|WC|UC]
> > range=[0x0000000100000000-0x000000023fffffff] (5120MB)
> >
> > This has all the expected attributes.
> >
>
> This change is made given a request from Ard. The CC capability is not
> applied to other system memory ranges that probably should also have
> that capability, given that it's encrypted and accepted. I haven't
> considered carefully where EFI_MEMORY_CPU_CRYPTO should be added to
> conventional memory, given the acceptance happens before DXE
> initializes. Perhaps
> CoreConvertResourceDescriptorHobAttributesToCapabilities? This is more
> of a question to Ard and Thomas.
>

It's not clear to me whether the CC attribute applies to the host or
the guest. From the guest PoV, there is really no distinction, whereas
on the host, I could imagine that only CC capable memory can be used
for handing out to VMs.

The important thing for this conversion is that
- the type changes to ConventionalMemory
- EFI_MEMORY_WB gets set (along with the other ones set in the
capability), as otherwise, Linux will disregard this memory and not
use it at all.

The EFI_MEMORY_CPU_CRYPTO flag is currently only referenced by Linux
in code that prints the memory map for diagnostic purposes, and not
used anywhere else.

  reply	other threads:[~2023-02-01 13:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31 19:08 [PATCH] OvmfPkg: Fix SevMemoryAcceptance memory attributes Dionna Glaze
2023-01-31 19:18 ` Dionna Glaze
2023-02-01 13:52   ` Ard Biesheuvel [this message]
2023-02-02 20:41     ` Dionna Glaze
2023-02-14 22:37       ` Ard Biesheuvel

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=CAMj1kXHi_Lms8KcXp9KxA5tfvm_AXSrZAGGyJBhP-OxxO-5SzQ@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