[PATCH WIP 02/14] x86/cpu-policy: HACK Disable PCID when nested virt is enabled

George Dunlap posted 14 patches 2 months, 3 weeks ago
There is a newer version of this series
[PATCH WIP 02/14] x86/cpu-policy: HACK Disable PCID when nested virt is enabled
Posted by George Dunlap 2 months, 3 weeks ago
The non-nested HVM code knows how to provide PCID functionality
(non-zero values in the lower 12 bits of CR3 when running in 64-bit
mode), but the nested code doesn't.  If the L2 decides to use the PCID
functionality, the L0 will fail the next L1 VMENTRY.

Long term we definitely want to enable this feature, but for now, just
hide it from guests when nested HVM is enabled.

Signed-off-by: George Dunlap <george.dunlap@cloud.com>
---
 xen/arch/x86/cpu-policy.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index d3ba177dac..91281b44b0 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -916,6 +916,7 @@ void recalculate_cpuid_policy(struct domain *d)
              * hosts.
              */
             fs[FEATURESET_ead] = max_fs[FEATURESET_ead];
+            __clear_bit(X86_FEATURE_PCID, max_fs);
         }
     }
 
-- 
2.25.1