[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171017133555.de4omyuoveaijkk6@pd.tnic>
Date: Tue, 17 Oct 2017 15:35:55 +0200
From: Borislav Petkov <bp@...en8.de>
To: Brijesh Singh <brijesh.singh@....com>
Cc: x86@...nel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>,
Tom Lendacky <thomas.lendacky@....com>,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Subject: Re: [Part1 PATCH v6 16/17] X86/KVM: Decrypt shared per-cpu variables
when SEV is active
On Tue, Oct 17, 2017 at 06:54:52AM -0500, Brijesh Singh wrote:
> Will do. Do you want me to send v7 with that addressed. Because this
> require changes in 3 patches (PATCH 14, 16, 17)
Just send me those three first as a reply to the thread so that I can
test the whole queue everywhere. Or even better, point me to the v7 git
branch once you have it ready.
> The second call is for UP cases. The kvm_smp_prepapre_boot_cpu() is
> called only when CONFIG_SMP is enabled. Am I missing something ?
Yes, you are.
kvm_guest_init() gets called unconditionally from setup_arch(). But then
you said kvm_guest_init() is called before setup_per_cpu_areas() so why
do you need that call there at all? percpu areas are not ready yet, what
makes them ready in the UP case?
IOW, this sev_map_percpu_data() needs to happen only once, during boot.
So call it only once by finding the right spot and not by adding a
second call for the UP case.
AFAICT, it looks the easiest if you put it in kvm_guest_cpu_init() and
do something like:
if (smp_processor_id() == boot_cpu_data.cpu_index)
sev_map_percpu_data();
...
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
Powered by blists - more mailing lists