@@ -6553,10 +6553,14 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
break;
case 5:
/* MONITOR/MWAIT Leaf */
- *eax = cpu->mwait.eax; /* Smallest monitor-line size in bytes */
- *ebx = cpu->mwait.ebx; /* Largest monitor-line size in bytes */
- *ecx = cpu->mwait.ecx; /* flags */
- *edx = cpu->mwait.edx; /* mwait substates */
+ if (env->features[FEAT_1_ECX] & CPUID_EXT_MONITOR) {
+ *eax = cpu->mwait.eax; /* Smallest monitor-line size in bytes */
+ *ebx = cpu->mwait.ebx; /* Largest monitor-line size in bytes */
+ *ecx = cpu->mwait.ecx; /* flags */
+ *edx = cpu->mwait.edx; /* mwait substates */
+ } else {
+ *eax = *ebx = *ecx = *edx = 0;
+ }
break;
case 6:
/* Thermal and Power Leaf */
When CPUID_EXT_MONITOR is not set, it means no support of MONITOR/MWAIT leaf, i.e., CPUID leaf 5. Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com> --- target/i386/cpu.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)