From: Brijesh Singh <brijesh.singh@amd.com>
To: Borislav Petkov <bp@suse.de>
Cc: brijesh.singh@amd.com, "x86@kernel.org" <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
Thomas Gleixner <tglx@linutronix.de>,
Paolo Bonzini <pbonzini@redhat.com>,
Pavel Tatashin <pasha.tatashin@oracle.com>
Subject: Re: SEV guest regression in 4.18
Date: Tue, 21 Aug 2018 09:37:56 -0500 [thread overview]
Message-ID: <3d46f44c-dd78-8fa9-02ac-8206676ffde9@amd.com> (raw)
In-Reply-To: <20180821083911.GF24940@nazgul.tnic>
Hi Boris,
On 08/21/2018 03:39 AM, Borislav Petkov wrote:
> On Mon, Aug 20, 2018 at 05:11:53PM -0500, Brijesh Singh wrote:
>> Hi All,
>>
>> The following commit
>>
>> "
>> x86/kvmclock: Remove memblock dependency
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=368a540e0232ad446931f5a4e8a5e06f69f21343
>>
>> "
>> broke the SEV support in 4.18.
>>
>> Since the guest physical address holding the wall_clock and
>> vcpu_time_info are shared with the hypervisor it must be mapped
>> as "decrypted" when SEV is active. To clear the C-bit we use
>> kernel_physical_mapping_init() to split the large pages into 4K before
>> changing the C-bit. Now the kernel_physical_mapping_init() is failing to
>> allocate the memory because its called very early.
>>
>> [ 0.000000] Call Trace:
>> [ 0.000000] ? dump_stack+0x5c/0x80
>> [ 0.000000] ? panic+0xe7/0x247
>> [ 0.000000] ? alloc_low_pages+0x130/0x130
>> [ 0.000000] ? kernel_physical_mapping_init+0xe0/0x204
>> [ 0.000000] ? early_set_memory_enc_dec+0x123/0x174
>> [ 0.000000] ? 0xffffffffae000000
>> [ 0.000000] ? kvmclock_init+0x60/0x1ea
>> [ 0.000000] ? kvm_init_platform+0xa/0x16
>> [ 0.000000] ? setup_arch+0x434/0xce9
>> [ 0.000000] ? start_kernel+0x67/0x52e
>> [ 0.000000] ? load_ucode_bsp+0x76/0x12e
>> [ 0.000000] ? secondary_startup_64+0xa4/0xb0
>
> Silly question: can we delay the call to kernel_physical_mapping_init()
> to right before those variables are accessed by the guest for the first
> time, assuming we can allocate memory at that point?
>
Those variables are accessed immediately by the tsc calibration code
path hence we will not able to delay the allocation. Before the above
patch series, kvmclock_init() and early tsc calibration was called a
bit late in setup_arch() hence it all worked fine.
-Brijesh
next prev parent reply other threads:[~2018-08-21 14:38 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-20 22:11 Brijesh Singh
2018-08-21 8:39 ` Borislav Petkov
2018-08-21 14:37 ` Brijesh Singh [this message]
2018-08-21 15:19 ` Borislav Petkov
2018-08-21 16:07 ` Brijesh Singh
2018-08-22 8:14 ` Borislav Petkov
2018-08-22 15:00 ` Sean Christopherson
2018-08-22 20:11 ` Brijesh Singh
2018-08-23 11:26 ` Paolo Bonzini
2018-08-23 15:29 ` Sean Christopherson
2018-08-23 16:16 ` Paolo Bonzini
2018-08-24 15:41 ` Brijesh Singh
2018-08-24 15:50 ` Paolo Bonzini
2018-08-24 18:47 ` Brijesh Singh
2018-08-25 4:47 ` Borislav Petkov
2018-08-24 16:24 ` Sean Christopherson
2018-08-24 18:48 ` Brijesh Singh
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=3d46f44c-dd78-8fa9-02ac-8206676ffde9@amd.com \
--to=brijesh.singh@amd.com \
--cc=Thomas.Lendacky@amd.com \
--cc=bp@suse.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pasha.tatashin@oracle.com \
--cc=pbonzini@redhat.com \
--cc=tglx@linutronix.de \
--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®