From: Tom Lendacky <thomas.lendacky@amd.com>
To: Dexuan Cui <decui@microsoft.com>,
Jeremi Piotrowski <jpiotrowski@linux.microsoft.com>
Cc: Borislav Petkov <bp@alien8.de>,
"sandipan.das@amd.com" <sandipan.das@amd.com>,
"Gupta, Pankaj" <pankaj.gupta@amd.com>,
"ray.huang@amd.com" <ray.huang@amd.com>,
"brijesh.singh@amd.com" <brijesh.singh@amd.com>,
"michael.roth@amd.com" <michael.roth@amd.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"x86@kernel.org" <x86@kernel.org>,
Tianyu Lan <Tianyu.Lan@microsoft.com>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Does earlyprintk=ttyS0 work for an AMD SNP guest on KVM?
Date: Fri, 17 Mar 2023 13:07:01 -0500 [thread overview]
Message-ID: <54a4ca2e-3389-dd48-1d1f-8b385fbfc0cf@amd.com> (raw)
In-Reply-To: <SA1PR21MB13352DCAA7371B90CB8A637CBFA69@SA1PR21MB1335.namprd21.prod.outlook.com>
On 2/17/23 20:54, Dexuan Cui wrote:
>> From: Jeremi Piotrowski <jpiotrowski@linux.microsoft.com>
>> Sent: Friday, February 17, 2023 4:51 AM
>> To: Dexuan Cui <decui@microsoft.com>
>>> [...]
>>> The comment before the first branch says:
>>> On 4-level paging, p4d_offset(top_level_pgt, 0) is equal to 'top_level_pgt'.
>>>
>>> IIUC this means 'top_level_pgt' is equal to '_pgtable'? i.e. without
>>> CONFIG_RANDOMIZE_BASE, pgt_data.pgt_buf_size should be 0.
>>>
>>> Not sure why it's not getting into the first branch for you.
>>
>> Sorry, I got two things confused here. The relevant part of the comment is this:
>> "If we came here via startup_32(), cr3 will be _pgtable already".
>>
>> Booting a (non-SNP) guest via BIOS I end up in the first branch. Upstream SNP
>> support requires OVMF (UEFI) so we'll always reach the kernel in 64-bit mode
>> (startup_64?), and end up in the second branch.
>>
>> Jeremi
>
> Here I'm running a C-bit mode SNP guest on Hyper-V via "direct-boot" (i.e.
> I run Set-VMFirmware to tell Hyper-V to boot the kernel directly without
> UEFI). Looks like arch/x86/boot/compressed/head_64.S: startup_32 runs
> first and calls startup_64 later (?) This might explain why I'm getting into
> the first branch, which I hope could be fixed by someone...
It sounds like there aren't enough pages available to satisfy the page
split in order to make the GHCB shared. Have you tried changing
BOOT_INIT_PGT_SIZE to increase it by 1 page. Splitting the page will
require an additional page table, I think that is all that would be needed.
Thanks,
Tom
prev parent reply other threads:[~2023-03-17 18:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-16 4:40 Dexuan Cui
2023-02-16 9:14 ` Jeremi Piotrowski
2023-02-16 17:58 ` Dexuan Cui
2023-02-17 12:51 ` Jeremi Piotrowski
2023-02-18 2:54 ` Dexuan Cui
2023-03-17 18:07 ` Tom Lendacky [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-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=54a4ca2e-3389-dd48-1d1f-8b385fbfc0cf@amd.com \
--to=thomas.lendacky@amd.com \
--cc=Tianyu.Lan@microsoft.com \
--cc=bp@alien8.de \
--cc=brijesh.singh@amd.com \
--cc=decui@microsoft.com \
--cc=jpiotrowski@linux.microsoft.com \
--cc=kvm@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.roth@amd.com \
--cc=pankaj.gupta@amd.com \
--cc=ray.huang@amd.com \
--cc=sandipan.das@amd.com \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®