[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4f7566b5-a743-4819-b221-88207c132f63@zytor.com>
Date: Fri, 16 Aug 2024 14:26:03 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Andrew Cooper <andrew.cooper3@...rix.com>, Xin Li <xin@...or.com>,
linux-kernel@...r.kernel.org
Cc: tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, x86@...nel.org, peterz@...radead.org,
seanjc@...gle.com
Subject: Re: [PATCH v1 2/3] x86/msr: Switch between WRMSRNS and WRMSR with the
alternatives mechanism
On 8/16/24 11:40, Andrew Cooper wrote:
>>
>> As the CALL instruction is 5-byte long, and we need to pad nop for both
>> WRMSR and WRMSRNS, what about not using segment prefix at all?
>
You can use up to 4 prefixes of any kind (which includes opcode prefixes
before 0F) before most decoders start hurting, so we can pad it out to 5
bytes by doing 3f 3f .. .. ..
>
> My suggestion, not that I've had time to experiment, was to change
> paravirt to use a non-C ABI and have asm_xen_write_msr() recombine
> edx:eax into rsi. That way the top level wrmsr() retains sensible
> codegen for native even when paravirt is active.
>
I have attached what should be an "obvious" example... famous last words.
-hpa
View attachment "xen.S" of type "text/plain" (1692 bytes)
Powered by blists - more mailing lists