[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/9] x86emul: support WRMSRNS


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 6 Apr 2023 08:47:20 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8VAXMuarZPILiWCKWQf+oZsYjafLrQh8Xc8wugtXYnk=; b=cgnGf82Z1XpxH3jbq3qeYB40kak/Nr64lckgxFze8TVImlAuz1ieYk5746B7HRejw5dqyWMDmpKKXf4da2ACznmQfPWb958tUADlDhPscRJO5/Cg0v5KYXoAltoylCX6DAExcKgvdQYu2qGOt79nLeYfwoElMrEernTSkHG1Aos3b6cpV87YrHDLxpDiXVrMMr+H4XfCg6X2QNDin7NWLOOAgpKpiOx6n+sHzIoGX+oV0tUPCHzqxlbzDDWeBKHSLBSEiFK2KDrDHzm72dPnH6taZw5jmtrgyORlHZqAnq+g53psLpRw7kxmO7I2N32YbPYXx4w2pb9Cxe8jEPC9qg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OZfrnU7T+SRufwcOeKKS/RSTyVYU4tJzR9AZhkH/MnZjyo2Map/rNMcIOL/AJxZ0Ab9nuYRSiqAgPosU72iaFlC1TkGy5Uy0UgyXw90YYbAu1YvevdOM3gaR3ghLt5T4vyZNEXXBpSt8xVS2tjZvobWrNJ3ERtHlc4rxphhHn5xBy2qIx9wfqrXEY2aFrIW6RSNrBWeRGAZdvOF4ps6w80U82kAG1ciEl6ZuGayfMyZZIpwFMltB1owD4M3MLrQ+GKj+kvOOtloozMz4WKYPNu6vxrUa5XDu2nTupznJ8gFamASS9k0qOFOBJJUHmXS1NmxBmoXzj98ICBw4tj0WwA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 06 Apr 2023 06:47:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 05.04.2023 23:29, Andrew Cooper wrote:
> On 04/04/2023 3:50 pm, Jan Beulich wrote:
>> This insn differs from WRMSR solely in the lack of serialization. Hence
>> the code used there can simply be used here as well, plus a feature
>> check of course.
> 
> I have a feeling this is a bit stale now that 0f01.c has moved into a
> separate file ?

Hmm, no, not really. This code was written long after the split anyway.
"Used here as well" is meant as "copy that code", not "goto ...".

>>  As there's no other infrastructure needed beyond
>> permitting the insn for PV privileged-op emulation (in particular no
>> separate new VMEXIT) we can expose the insn to guests right away.
> 
> There are good reasons not to expose this to PV guests.
> 
> The #GP fault to trigger emulation is serialising, so from the guest's
> point of view there is literally no difference between WRMSR and WRMSRNS.
> 
> All code is going to need to default to WRMSR for compatibility reasons,
> so not advertising WRMSRNS will save the guest going through and
> self-modifying itself to use a "more efficient" instruction which is not
> actually more efficient.

Well, sure, I can drop that again. I don't view "self-modifying itself"
as meaningful wastage. Plus I'd consider it reasonable to expose the
feature by default only to HVM, while permitting (non-default) exposure
to PV (in which case the emul-priv-op.c change would want retaining),
except that we can't express this afaict. Even without exposing at all
I'd consider it kind of reasonable to allow use of the insn, in case a
guest infers its availability (or simply knows from executing raw CPUID).

> The emulation implementation is fine, so Reviewed-by: Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx> but dependent on the PV guest changes being
> dropped.

Thanks.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.