From: Tom Lendacky <thomas.lendacky@amd.com>
To: Jim Mattson <jmattson@google.com>
Cc: Andy Lutomirski <luto@kernel.org>,
Sean Christopherson <sean.j.christopherson@intel.com>,
Joerg Roedel <joro@8bytes.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
X86 ML <x86@kernel.org>,
"Chang S. Bae" <chang.seok.bae@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Sasha Levin <sashal@kernel.org>, Borislav Petkov <bp@alien8.de>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: FSGSBASE causing panic on 5.9-rc1
Date: Thu, 20 Aug 2020 14:05:16 -0500 [thread overview]
Message-ID: <e8b3f80e-3c5a-7a03-97f9-75cbdbbb023c@amd.com> (raw)
In-Reply-To: <c4cc63b5-2861-5370-781f-5d664b6ffed5@amd.com>
On 8/20/20 2:04 PM, Tom Lendacky wrote:
> On 8/20/20 1:41 PM, Tom Lendacky wrote:
>> On 8/20/20 1:39 PM, Jim Mattson wrote:
>>> On Thu, Aug 20, 2020 at 11:38 AM Jim Mattson <jmattson@google.com> wrote:
>>>>
>>>> On Thu, Aug 20, 2020 at 11:34 AM Tom Lendacky
>>>> <thomas.lendacky@amd.com> wrote:
>>>>>
>>>>>
>>>>> Bisecting with unsafe_fsgsbase identified:
>>>>>
>>>>> c82965f9e530 ("x86/entry/64: Handle FSGSBASE enabled paranoid
>>>>> entry/exit")
>>>>>
>>>>> But I'm thinking that could be because it starts using GET_PERCPU_BASE,
>>>>> which on Rome would use RDPID. So is SVM restoring TSC_AUX_MSR too late?
>>>>> That would explain why I don't see the issue on Naples, which doesn't
>>>>> support RDPID.
>>>>
>>>> It looks to me like SVM loads the guest TSC_AUX from vcpu_load to
>>>> vcpu_put, with this comment:
>>>>
>>>> /* This assumes that the kernel never uses MSR_TSC_AUX */
>>>> if (static_cpu_has(X86_FEATURE_RDTSCP))
>>>> wrmsrl(MSR_TSC_AUX, svm->tsc_aux);
>>>
>>> Correction: It never restores TSC_AUX, AFAICT.
>>
>> It does, it's in the host_save_user_msrs array.
>
> I added a quick hack to save TSC_AUX to a new variable in the SVM struct
> and then restore it right after VMEXIT (just after where GS is restored in
> svm_vcpu_enter_exit()) and my guest is no longer crashing.
Sorry, I mean my host is no longer crashing.
Thanks,
Tom
>
> Thanks,
> Tom
>
>>
>> Thanks,
>> Tom
>>
>>>
next prev parent reply other threads:[~2020-08-20 19:05 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-19 18:07 FSGSBASE causing panic on 5.9-rc1 Tom Lendacky
2020-08-19 18:19 ` Tom Lendacky
2020-08-19 21:25 ` Andy Lutomirski
2020-08-20 0:21 ` Andy Lutomirski
2020-08-20 15:10 ` Sean Christopherson
2020-08-20 15:21 ` Tom Lendacky
2020-08-20 15:55 ` Andy Lutomirski
2020-08-20 16:17 ` Tom Lendacky
2020-08-20 16:30 ` Tom Lendacky
2020-08-20 17:41 ` Paolo Bonzini
2020-08-20 18:34 ` Tom Lendacky
2020-08-20 18:38 ` Jim Mattson
2020-08-20 18:39 ` Jim Mattson
2020-08-20 18:41 ` Tom Lendacky
2020-08-20 19:04 ` Tom Lendacky
2020-08-20 19:05 ` Tom Lendacky [this message]
2020-08-20 20:07 ` Dave Hansen
2020-08-20 20:15 ` Tom Lendacky
2020-08-20 20:36 ` Andy Lutomirski
2020-08-20 22:05 ` Sean Christopherson
2020-08-20 22:07 ` Andy Lutomirski
2020-08-20 22:34 ` Sean Christopherson
2020-08-21 0:00 ` Tom Lendacky
2020-08-21 1:56 ` Sean Christopherson
2020-08-20 18:43 ` Bae, Chang Seok
2020-08-20 13:43 ` Paolo Bonzini
2020-08-20 17:51 ` Andy Lutomirski
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=e8b3f80e-3c5a-7a03-97f9-75cbdbbb023c@amd.com \
--to=thomas.lendacky@amd.com \
--cc=bp@alien8.de \
--cc=chang.seok.bae@intel.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=sashal@kernel.org \
--cc=sean.j.christopherson@intel.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.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;
as well as URLs for NNTP newsgroup(s).