From: "Ard Biesheuvel via groups.io" <ardb=kernel.org@groups.io>
To: Breno Leitao <leitao@debian.org>
Cc: Usama Arif <usamaarif642@gmail.com>,
linux-efi@vger.kernel.org, devel@edk2.groups.io,
kexec@lists.infradead.org, hannes@cmpxchg.org,
dyoung@redhat.com, x86@kernel.org, linux-kernel@vger.kernel.org,
gourry@gourry.net, kernel-team@meta.com
Subject: Re: [edk2-devel] [RFC 2/2] efi/memattr: add efi_mem_attr_table as a reserved region in 820_table_firmware
Date: Fri, 10 Jan 2025 18:33:27 +0100 [thread overview]
Message-ID: <CAMj1kXFjJZKGS1VDcUw3Uw9xB0R5+Q3q-21hojw4NMbr__XmgA@mail.gmail.com> (raw)
In-Reply-To: <20250110-tricky-grasshopper-of-maturity-21771f@leitao>
On Fri, 10 Jan 2025 at 12:36, Breno Leitao <leitao@debian.org> wrote:
>
> Hello Ard,
>
> On Fri, Jan 10, 2025 at 08:32:08AM +0100, Ard Biesheuvel wrote:
> > On Thu, 9 Jan 2025 at 17:32, Usama Arif <usamaarif642@gmail.com> wrote:
>
> > > I think in the end whoevers' responsibility it is, the easiest path forward
> > > seems to be in kernel? (and not firmware or libstub)
> > >
> >
> > Agreed. But as I pointed out in the other thread, the memory
> > attributes table only augments the memory map with permission
> > information, and can be disregarded, and given how badly we mangle the
> > memory map on x86, maybe this is the right choice here.
>
> If this augmented memory is not preserved accross kexec, then the next
> kexec'ed kernel will be able to find the original table?
>
> I understand that the memattr region(s) need to be always (in each kexec
> instances) `memblocked_reserved` to protect it from being used as a
> System RAM, right?
>
> Thus, if it is not passed throught e820, kexec'ed kernel needs to fetch
> it again from original EFI table at kexec/boot time.
>
Not sure what 'fetching' means here.
> This brings me another question.
>
> If the kexec'ed kernel sees the original memory, why can't it
> augment/update the RX permissions *again*, instead of passing the
> previous augmented version from previous kernel in this crazy dance.
>
I don't understand what original memory means. I think we're talking
past each other tbh.
> > This is a kexec problem (on x86 only) so let's fix it there.
>
> Would you mind explaining what kexec needs to be done differently?
> Should it preserve the augmented memattr table independently if it is
> mapped in e820?
>
I don't know what 'mapped in e820' means.
Let's forget about what the memory attributes table actually contains,
and just assume we can live without it, ok?
So when booting x86 via kexec (which is already detected in
arch/x86/platform/efi/efi.c), the kernel should pretend that the table
does not exist.
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120981): https://edk2.groups.io/g/devel/message/120981
Mute This Topic: https://groups.io/mt/110518541/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
prev parent reply other threads:[~2025-01-10 17:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250108215957.3437660-1-usamaarif642@gmail.com>
[not found] ` <20250108215957.3437660-2-usamaarif642@gmail.com>
2025-01-09 15:45 ` [edk2-devel] [RFC 1/2] efi/memattr: Use desc_size instead of total size to check for corruption Ard Biesheuvel via groups.io
[not found] ` <d9c84079-6593-43f4-9483-648b665f03db@gmail.com>
2025-01-10 7:21 ` Ard Biesheuvel via groups.io
[not found] ` <8613563a-ee7c-4271-b1f0-4d1ac365ad3a@gmail.com>
2025-01-10 17:25 ` Ard Biesheuvel via groups.io
[not found] ` <20250108215957.3437660-3-usamaarif642@gmail.com>
2025-01-09 16:15 ` [edk2-devel] [RFC 2/2] efi/memattr: add efi_mem_attr_table as a reserved region in 820_table_firmware Ard Biesheuvel via groups.io
[not found] ` <cade51c5-5fcc-4208-b46c-f2e2038f03e7@gmail.com>
2025-01-10 7:32 ` Ard Biesheuvel via groups.io
[not found] ` <20250110-tricky-grasshopper-of-maturity-21771f@leitao>
2025-01-10 17:33 ` Ard Biesheuvel via groups.io [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=CAMj1kXFjJZKGS1VDcUw3Uw9xB0R5+Q3q-21hojw4NMbr__XmgA@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