[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b05e3092-8ba3-f4e1-b5a3-2125944936fd@zytor.com>
Date: Thu, 14 Sep 2023 19:06:04 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: andrew.cooper3@...rix.com, Thomas Gleixner <tglx@...utronix.de>,
Xin Li <xin3.li@...el.com>, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-edac@...r.kernel.org,
linux-hyperv@...r.kernel.org, kvm@...r.kernel.org,
xen-devel@...ts.xenproject.org
Cc: mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
x86@...nel.org, luto@...nel.org, pbonzini@...hat.com,
seanjc@...gle.com, peterz@...radead.org, jgross@...e.com,
ravi.v.shankar@...el.com, mhiramat@...nel.org,
jiangshanlai@...il.com
Subject: Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support
On 9/14/23 18:46, andrew.cooper3@...rix.com wrote:
> On 15/09/2023 1:38 am, H. Peter Anvin wrote:
>> On 9/14/23 17:33, andrew.cooper3@...rix.com wrote:
>>>
>>> It's an assumption about what "definitely won't" be paravirt in the
>>> future.
>>>
>>> XenPV stack handling is almost-FRED-like and has been for the better
>>> part of two decades.
>>>
>>> You frequently complain that there's too much black magic holding XenPV
>>> together. A paravirt-FRED will reduce the differences vs native
>>> substantially.
>>>
>>
>> Call it "paravirtualized exception handling." In that sense, the
>> refactoring of the exception handling to benefit FRED is definitely
>> useful for reducing paravirtualization. The FRED-specific code is
>> largely trivial, and presumably what you would do is to replace the
>> FRED wrapper with a Xen wrapper and call the common handler routines.
>
> Why do only half the job?
>
> There's no need for any Xen wrappers at all when XenPV can use the
> native FRED paths, as long as ERETU, ERETS and the relevant MSRs can be
> paravirt (sure - with an interface that sucks less than right now) so
> they're not taking the #GP/emulate in Xen path.
>
> And this can work on all hardware with a slightly-future version of Xen
> and Linux, because it's just a minor adjustment to how Xen writes the
> exception frame on the guests stack as part of event delivery.
>
It's not about doing "half the job", it's about using the proper
abstraction mechanism. By all means, if you can join the common code
flow earlier, do so, but paravirtualizing the entry/exit stubs which is
the *only* place ERETU and ERETS show up is just crazy.
Similarly, nearly all the MSRs are just configuration setup. The only
ones which have any kind of performance relevance is the stack setup (RSP0).
-hpa
Powered by blists - more mailing lists