From: Xiaoyao Li <xiaoyao.li@intel.com>
To: Benjamin Lamowski <benjamin.lamowski@kernkonzept.com>,
Sean Christopherson <sean.j.christopherson@intel.com>
Cc: philipp.eppelt@kernkonzept.com, bp@alien8.de,
fenghua.yu@intel.com, hpa@zytor.com,
linux-kernel@vger.kernel.org, luto@kernel.org, mingo@redhat.com,
nivedita@alum.mit.edu, pbonzini@redhat.com, peterz@infradead.org,
tglx@linutronix.de, tony.luck@intel.com, x86@kernel.org
Subject: Re: [PATCH 1/1] x86/split_lock: check split lock feature on initialization
Date: Mon, 6 Apr 2020 19:48:13 +0800 [thread overview]
Message-ID: <30e141b8-f9c9-370a-4667-1e2f0116b6f7@intel.com> (raw)
In-Reply-To: <f072e3e0-48b0-346e-b383-3e802069fc3a@kernkonzept.com>
On 4/6/2020 4:23 PM, Benjamin Lamowski wrote:
> [...]
>> Calling split_lock_verify_msr() with X86_FEATURE_SPLIT_LOCK_DETECT=0 is
>> intentional, the idea is to ensure SLD is disabled on all CPUs, e.g. in the
>> unlikely scenario that BIOS enabled SLD.
>
> I was aware of the intention, but I still don't understand under which
> scenario this could be set by the BIOS although the earlier feature
> detection has failed,
It's for the case that SLD is explicitly disabled by kernel params
"split_lock_detect=off". You know, BIOS may turn SLD on for itself. So
if user uses "split_lock_detect=off", we have to clear the SLD bit in
case BIOS forgets to clear it.
> i.e. shouldn't the feature have been detected in
> all cases where SLD can actually be disabled? If so, checking for
> availability first instead of catching a #GP(0) if it is not implemented
> seems to be the cleaner solution.
I understand what you want. i.e., X86_FEATURE_SPLIT_LOCK_DETECT is
independent from sld_off. I guess you have to make tglx accept it first.
>
>> The first rdmsrl_safe() should short circuit split_lock_verify_msr() if
>> the RDMSR faults, i.e. it might fault, but it shouldn't WARN. Are you
>> seeing issues or was this found via code inspection?
>
> We stumbled across this issue because the x86 version of our VMM is not
> yet ready for production and when accessing unimplemented MSRs would
> simply return 0 and issue a warning. This is of course a deviation from
> rdmsr as defined in the SDM and the pieces are ours to keep, it will be
> changed to generate a #GP(0) once the last missing MSRs are emulated
> properly.
>
Got it. you are running linux guest in your own VMM and there is warning
in the VMM.
If you really want to avoid the MSR access on the platform without SLD.
You could make the default sld_state as sld_unsupported. It can only be
changed to other value in split_lock_setup() when SLD is enumerated. So
in split_lock_init(), we can use if (sld_state == sld_unsupported) to
skip the MSR_TEST_CTRL access.
next prev parent reply other threads:[~2020-04-06 11:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-25 3:09 [PATCH v7 0/2] Fix and optimization of split_lock_detection Xiaoyao Li
2020-03-25 3:09 ` [PATCH v7 1/2] x86/split_lock: Rework the initialization flow of split lock detection Xiaoyao Li
2020-03-28 16:32 ` Sean Christopherson
2020-03-30 13:26 ` Xiaoyao Li
2020-03-30 14:26 ` Sean Christopherson
2020-03-25 3:09 ` [PATCH v7 2/2] x86/split_lock: Avoid runtime reads of the TEST_CTRL MSR Xiaoyao Li
2020-03-28 16:34 ` Sean Christopherson
2020-03-29 9:13 ` Xiaoyao Li
2020-03-30 18:18 ` Sean Christopherson
2020-04-03 17:44 ` [PATCH 0/1] x86/split_lock: check split lock feature on initialization Benjamin Lamowski
2020-04-03 17:44 ` [PATCH 1/1] " Benjamin Lamowski
2020-04-03 18:01 ` Sean Christopherson
2020-04-06 8:23 ` Benjamin Lamowski
2020-04-06 11:48 ` Xiaoyao Li [this message]
2020-04-06 15:57 ` [PATCH v2 0/1] x86/split_lock: check split lock support " Benjamin Lamowski
2020-04-06 16:02 ` [PATCH v2 1/1] " Benjamin Lamowski
2020-04-06 16:17 ` [PATCH v3 " Benjamin Lamowski
2020-04-06 21:24 ` Thomas Gleixner
2020-04-06 21:21 ` [PATCH 0/1] x86/split_lock: check split lock feature " Thomas Gleixner
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=30e141b8-f9c9-370a-4667-1e2f0116b6f7@intel.com \
--to=xiaoyao.li@intel.com \
--cc=benjamin.lamowski@kernkonzept.com \
--cc=bp@alien8.de \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=nivedita@alum.mit.edu \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=philipp.eppelt@kernkonzept.com \
--cc=sean.j.christopherson@intel.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.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®