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

Re: [Xen-devel] [PATCH] x86/vvmx: set CR4 before CR0



On Wed, Jun 26, 2019 at 08:02:12PM +0100, Andrew Cooper wrote:
> From: Sergey Dyasli <sergey.dyasli@xxxxxxxxxx>
> 
> Otherwise hvm_set_cr0() will check the wrong CR4 bits (L1 instead of L2
> and vice-versa).
> 
> Signed-off-by: Sergey Dyasli <sergey.dyasli@xxxxxxxxxx>
> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

> ---
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: Wei Liu <wl@xxxxxxx>
> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> CC: Jun Nakajima <jun.nakajima@xxxxxxxxx>
> CC: Kevin Tian <kevin.tian@xxxxxxxxx>
> 
> I found this patch languishing in the XenServer patchqueue, and Sergey is OoO
> so I'm submitting it on his behalf.
> 
> Without this change, nested virt is broken when L1 and L2 differ in their use
> of PCID.
> 
> This is only a stopgap solution - it resolves the PCID issue without
> introducing other issues, but the proper fix needs to consider all control
> bits at once, rather than considering a vmentry/exit as a sequence of changes
> of discrete registers.

The current approach seems prone to such ordering issues, and I don't
see a way to make it more robust while keeping the current approach,
so I guess setting all the registers state and then evaluating them
would make more sense and prevent this kind of mistakes.

Thanks.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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