diff mbox series

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

Message ID 20240626133853.4150731-3-george.dunlap@cloud.com (mailing list archive)
State New
Headers show
Series AMD Nested Virt Preparation | expand

Commit Message

George Dunlap June 26, 2024, 1:38 p.m. UTC
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 mbox series

Patch

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);
         }
     }