p->basic.raw_fms &= 0x0fff0fff; /* Clobber Processor Type on Intel. */
p->basic.apic_id = 0; /* Dynamic. */
+ p->basic.raw[0x5] = EMPTY_LEAF; /* MONITOR not exposed to guests. */
+
p->basic.raw[0x8] = EMPTY_LEAF;
p->basic.raw[0xc] = EMPTY_LEAF;
res->a = (res->a & ~0xff) | 3;
break;
- case 0x00000005: /* MONITOR/MWAIT */
case 0x0000000b: /* Extended Topology Enumeration */
unsupported:
*res = EMPTY_LEAF;
break;
- case 0x0 ... 0x4:
+ case 0x0 ... 0x5:
case 0x7 ... 0x9:
case 0xc ... XSTATE_CPUID:
case 0x80000000 ... 0xffffffff:
res->a = (res->a & ~0xff) | 3;
break;
- case 0x0 ... 0x4:
+ case 0x0 ... 0x5:
case 0x7 ... 0x9:
case 0xc ... XSTATE_CPUID:
case 0x80000000 ... 0xffffffff:
goto legacy;
case 0x0 ... 0x3:
+ case 0x5:
case 0x8 ... 0x9:
case 0xc:
*res = p->basic.raw[leaf];
}
goto common_leaf1_adjustments;
+ case 0x5:
+ /*
+ * Leak the hardware MONITOR leaf under the same conditions that the
+ * MONITOR feature flag is leaked. See above for details.
+ */
+ regs = guest_cpu_user_regs();
+ if ( is_pv_domain(d) && is_hardware_domain(d) &&
+ guest_kernel_mode(v, regs) && cpu_has_monitor &&
+ regs->entry_vector == TRAP_gp_fault )
+ *res = raw_policy.basic.raw[leaf];
+ break;
+
case 0x7:
switch ( subleaf )
{