[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87h7wtl0sf.fsf@nanos.tec.linutronix.de>
Date: Wed, 06 May 2020 14:12:48 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Sean Christopherson <sean.j.christopherson@...el.com>
Cc: Xiaoyao Li <xiaoyao.li@...el.com>,
Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, x86@...nel.org,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Arvind Sankar <nivedita@...m.mit.edu>
Subject: Re: [PATCH v8 4/4] kvm: vmx: virtualize split lock detection
Sean Christopherson <sean.j.christopherson@...el.com> writes:
> On Wed, Apr 15, 2020 at 02:43:18PM -0700, Sean Christopherson wrote:
>> On Wed, Apr 15, 2020 at 11:22:11PM +0200, Thomas Gleixner wrote:
>> > So we can go with the proposed mode of allowing the write but not
>> > propagating it. If the resulting split lock #AC originates from CPL != 3
>> > then the guest will be killed with SIGBUS. If it originates from CPL ==
>> > 3 and the guest has user #AC disabled then it will be killed as well.
>>
>> An idea that's been floated around to avoid killing the guest on a CPL==3
>> split-lock #AC is to add a STICKY bit to MSR_TEST_CTRL that KVM can
>> virtualize to tell the guest that attempting to disable SLD is futile,
>> e.g. so that the guest can kill its misbehaving userspace apps instead of
>> trying to disable SLD and getting killed by the host.
>
> Circling back to this. KVM needs access to sld_state in one form or another
> if we want to add a KVM hint when the host is in fatal mode. Three options
> I've come up with:
>
> 1. Bite the bullet and export sld_state.
>
> 2. Add an is_split_fatal_wrapper(). Ugly since it needs to be non-inline
> to avoid triggering (1).
>
> 3. Add a synthetic feature flag, e.g. X86_FEATURE_SLD_FATAL, and drop
> sld_state altogether.
>
> I like (3) because it requires the least amount of code when all is said
> and done, doesn't require more exports, and as a bonus it'd probably be nice
> for userspace to see sld_fatal in /proc/cpuinfo.
#3 makes sense and is elegant.
Thanks,
tglx
Powered by blists - more mailing lists