[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALMp9eTAFHCHUUf1vv8d7RatuLD3RsJa8tsFUkgXxX2h7HiPkQ@mail.gmail.com>
Date: Tue, 9 Jan 2018 13:59:39 -0800
From: Jim Mattson <jmattson@...gle.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Arjan van de Ven <arjan@...ux.intel.com>,
Liran Alon <liran.alon@...cle.com>, dwmw@...zon.co.uk,
bp@...en8.de, aliguori@...zon.com,
Tom Lendacky <thomas.lendacky@....com>,
LKML <linux-kernel@...r.kernel.org>,
kvm list <kvm@...r.kernel.org>
Subject: Re: [PATCH 6/7] x86/svm: Set IBPB when running a different VCPU
It's unclear from Intel's documentation whether writing bit 0 of
IA32_SPEC_CTRL or bit 0 of IA32_PRED_CMD will flush the BHB. (At
least, it's unclear from the documentation I have.)
The retpoline patches include code for *filling* the RSB, but if you
invoke the RSB refill code from kernel text before VM-entry, you still
reveal information about KASLR to the guest. I think we may need a
copy of the RSB refill code on a dynamically allocated page. In fact,
we may need ~32 branches on that page to clobber the BHB. That means
that maybe we can't do VM-entry from kernel text (unless one of IBRS
or IBPB flushes the BHB).
On Tue, Jan 9, 2018 at 1:42 PM, Paolo Bonzini <pbonzini@...hat.com> wrote:
> On 09/01/2018 21:57, Jim Mattson wrote:
>> Before VM-entry, don't we need to flush the BHB and the RSB to avoid
>> revealing KASLR information to the guest? (Thanks to Liran for
>> pointing this out.)
>
> I don't know how you flush the BHB? As to the RSB, that would also be
> part of generic Linux code so I've not included it yet in this series
> which was mostly about the new MSRs and CPUID bits.
>
> Paolo
Powered by blists - more mailing lists