From: Tom Lendacky <thomas.lendacky@amd.com>
To: Borislav Petkov <bp@alien8.de>, Ard Biesheuvel <ardb@kernel.org>
Cc: Ard Biesheuvel <ardb+git@google.com>,
linux-kernel@vger.kernel.org,
Kevin Loughlin <kevinloughlin@google.com>,
Dionna Glaze <dionnaglaze@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Andy Lutomirski <luto@kernel.org>,
Brian Gerst <brgerst@gmail.com>
Subject: Re: [PATCH v7 2/9] x86/startup_64: Defer assignment of 5-level paging global variables
Date: Fri, 1 Mar 2024 13:13:47 -0600 [thread overview]
Message-ID: <8521a07a-b8c0-e653-e5a1-852bc3adbaac@amd.com> (raw)
In-Reply-To: <20240301173323.GDZeIRY_BVBqpudkEo@fat_crate.local>
On 3/1/24 11:33, Borislav Petkov wrote:
> On Fri, Mar 01, 2024 at 06:09:53PM +0100, Ard Biesheuvel wrote:
>> On Fri, 1 Mar 2024 at 17:09, Borislav Petkov <bp@alien8.de> wrote:
>>>
>>> On Fri, Mar 01, 2024 at 11:01:33AM +0100, Ard Biesheuvel wrote:
>>>> The scenario that I have not managed to test is entering from EFI with
>>>> 5 levels of paging enabled, and switching back to 4 levels (which
>>>> should work regardless of CONFIG_X86_5LEVEL). However, no firmware in
>>>> existence actually supports that today, and I am pretty sure that this
>>>> code has never been tested under those conditions to begin with. (OVMF
>>>> patches are under review atm to allow 5-level paging to be enabled in
>>>> the firmware)
>>>
>>> Aha.
>>>
>>
>> I've built a debug OVMF image using the latest version of the series,
>> and put it at [0]
>>
>> Run like this
>>
>> qemu-system-x86_64 -M q35 \
>> -cpu qemu64,+la57 -smp 4 \
>> -bios OVMF-5level.fd \
>> -kernel arch/x86/boot/bzImage \
>> -append console=ttyS0\ earlyprintk=ttyS0 \
>> -vga none -nographic -m 1g \
>> -initrd <initrd.img>
>>
>> and you will get loads of DEBUG output from the firmware first, and
>> then boot into Linux. (initrd can be omitted)
>>
>> Right before entering, it will print
>>
>> CpuDxe: 5-Level Paging = 1
>>
>> which confirms that the firmware is running with 5 levels of paging.
>>
>> I've confirmed that this boots happily with this series applied,
>> including when using 'no5lvl' on the command line, or when disabling
>> CONFIG_X86_5LEVEL [confirmed by inspecting
>> /sys/kernel/debug/page_tables/kernel].
>>
>>
>> [0] http://files.workofard.com/OVMF-5level.fd.gz
>
> Nice, that might come in handy for other testing too.
Be aware that additional work will need to be done in OVMF to support
5-level paging for SEV VMs.
Initial SEV implementation happened when there wasn't a page table library
and so SEV support had to roll it's own page table modifications. A page
table library has since been created and 5-level support was added, but
the SEV code hasn't been converted over to use the new library, yet.
Thanks,
Tom
>
> Thx.
>
next prev parent reply other threads:[~2024-03-01 19:13 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-27 15:19 [PATCH v7 0/9] x86: Confine early 1:1 mapped startup code Ard Biesheuvel
2024-02-27 15:19 ` [PATCH v7 1/9] x86/startup_64: Simplify CR4 handling in " Ard Biesheuvel
2024-02-28 13:45 ` Borislav Petkov
2024-02-29 22:36 ` Ard Biesheuvel
2024-03-04 22:09 ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel
2024-02-27 15:19 ` [PATCH v7 2/9] x86/startup_64: Defer assignment of 5-level paging global variables Ard Biesheuvel
2024-02-28 20:55 ` Borislav Petkov
2024-03-01 10:01 ` Ard Biesheuvel
2024-03-01 16:09 ` Borislav Petkov
2024-03-01 17:09 ` Ard Biesheuvel
2024-03-01 17:33 ` Borislav Petkov
2024-03-01 19:13 ` Tom Lendacky [this message]
2024-03-03 19:26 ` Borislav Petkov
2024-03-03 21:56 ` Ard Biesheuvel
2024-03-03 22:10 ` Borislav Petkov
2024-03-04 22:09 ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel
2024-02-27 15:19 ` [PATCH v7 3/9] x86/startup_64: Simplify calculation of initial page table address Ard Biesheuvel
2024-02-28 21:27 ` Borislav Petkov
2024-03-04 22:09 ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel
2024-02-27 15:19 ` [PATCH v7 4/9] x86/startup_64: Simplify virtual switch on primary boot Ard Biesheuvel
2024-02-29 10:37 ` Borislav Petkov
2024-02-29 22:36 ` Ard Biesheuvel
2024-03-01 16:12 ` Borislav Petkov
2024-03-04 22:09 ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel
2024-02-27 15:19 ` [PATCH v7 5/9] efi/libstub: Add generic support for parsing mem_encrypt= Ard Biesheuvel
2024-03-01 16:16 ` Borislav Petkov
2024-03-04 22:09 ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel
2024-02-27 15:19 ` [PATCH v7 6/9] x86/boot: Move mem_encrypt= parsing to the decompressor Ard Biesheuvel
2024-03-01 19:16 ` Borislav Petkov
2024-03-01 23:46 ` Ard Biesheuvel
2024-03-02 14:51 ` Borislav Petkov
2024-03-04 22:09 ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel
2024-02-27 15:19 ` [PATCH v7 7/9] x86/sme: Move early SME kernel encryption handling into .head.text Ard Biesheuvel
2024-03-04 22:08 ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel
2024-02-27 15:19 ` [PATCH v7 8/9] x86/sev: Move early startup code into .head.text section Ard Biesheuvel
2024-03-04 22:08 ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel
2024-02-27 15:19 ` [PATCH v7 9/9] x86/startup_64: Drop global variables keeping track of LA57 state Ard Biesheuvel
2024-03-01 19:20 ` Borislav Petkov
2024-03-01 23:55 ` Ard Biesheuvel
2024-03-02 15:17 ` Borislav Petkov
2024-03-02 15:32 ` Ard Biesheuvel
2024-03-02 18:22 ` Borislav Petkov
2024-03-04 17:07 ` [PATCH v7 0/9] x86: Confine early 1:1 mapped startup code Tom Lendacky
2024-03-04 19:13 ` Ard Biesheuvel
2024-03-04 22:41 ` Tom Lendacky
2024-03-05 8:46 ` 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-all 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=8521a07a-b8c0-e653-e5a1-852bc3adbaac@amd.com \
--to=thomas.lendacky@amd.com \
--cc=ardb+git@google.com \
--cc=ardb@kernel.org \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dave.hansen@linux.intel.com \
--cc=dionnaglaze@google.com \
--cc=kevinloughlin@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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