[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH v10 36/38] x86/fred: Add fred_syscall_init()
- To: "Li, Xin3" <xin3.li@xxxxxxxxx>, "linux-doc@xxxxxxxxxxxxxxx" <linux-doc@xxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "linux-edac@xxxxxxxxxxxxxxx" <linux-edac@xxxxxxxxxxxxxxx>, "linux-hyperv@xxxxxxxxxxxxxxx" <linux-hyperv@xxxxxxxxxxxxxxx>, "kvm@xxxxxxxxxxxxxxx" <kvm@xxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
- Date: Wed, 20 Sep 2023 10:18:14 +0200
- Cc: "mingo@xxxxxxxxxx" <mingo@xxxxxxxxxx>, "bp@xxxxxxxxx" <bp@xxxxxxxxx>, "dave.hansen@xxxxxxxxxxxxxxx" <dave.hansen@xxxxxxxxxxxxxxx>, "x86@xxxxxxxxxx" <x86@xxxxxxxxxx>, "hpa@xxxxxxxxx" <hpa@xxxxxxxxx>, "Lutomirski, Andy" <luto@xxxxxxxxxx>, "pbonzini@xxxxxxxxxx" <pbonzini@xxxxxxxxxx>, "Christopherson,, Sean" <seanjc@xxxxxxxxxx>, "peterz@xxxxxxxxxxxxx" <peterz@xxxxxxxxxxxxx>, "Gross, Jurgen" <jgross@xxxxxxxx>, "Shankar, Ravi V" <ravi.v.shankar@xxxxxxxxx>, "mhiramat@xxxxxxxxxx" <mhiramat@xxxxxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "jiangshanlai@xxxxxxxxx" <jiangshanlai@xxxxxxxxx>
- Delivery-date: Wed, 20 Sep 2023 08:18:26 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Wed, Sep 20 2023 at 04:33, Li, Xin3 wrote:
>> > +static inline void fred_syscall_init(void) {
>> > + /*
>> > + * Per FRED spec 5.0, FRED uses the ring 3 FRED entrypoint for SYSCALL
>> > + * and SYSENTER, and ERETU is the only legit instruction to return to
>> > + * ring 3, as a result there is _no_ need to setup the SYSCALL and
>> > + * SYSENTER MSRs.
>> > + *
>> > + * Note, both sysexit and sysret cause #UD when FRED is enabled.
>> > + */
>> > + wrmsrl(MSR_LSTAR, 0ULL);
>> > + wrmsrl_cstar(0ULL);
>>
>> That write is pointless. See the comment in wrmsrl_cstar().
>
> What I heard is that AMD is going to support FRED.
>
> Both LSTAR and CSTAR have no function when FRED is enabled, so maybe
> just do NOT write to them?
Right. If AMD needs to clear it then it's trivial enough to add a
wrmsrl_cstar(0) to it.
|