[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/24] i386: Enable IA32_MISC_ENABLE MWAIT bit when e
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 05/24] i386: Enable IA32_MISC_ENABLE MWAIT bit when exposing mwait/monitor |
Date: |
Mon, 3 Jun 2019 19:10:24 +0200 |
From: Wanpeng Li <address@hidden>
The CPUID.01H:ECX[bit 3] ought to mirror the value of the MSR
IA32_MISC_ENABLE MWAIT bit and as userspace has control of them
both, it is userspace's job to configure both bits to match on
the initial setup.
Cc: Eduardo Habkost <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: Radim Krčmář <address@hidden>
Signed-off-by: Wanpeng Li <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
target/i386/cpu.c | 3 +++
target/i386/cpu.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 536d7d1..c1ab86d 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -4730,6 +4730,9 @@ static void x86_cpu_reset(CPUState *s)
env->pat = 0x0007040600070406ULL;
env->msr_ia32_misc_enable = MSR_IA32_MISC_ENABLE_DEFAULT;
+ if (env->features[FEAT_1_ECX] & CPUID_EXT_MONITOR) {
+ env->msr_ia32_misc_enable |= MSR_IA32_MISC_ENABLE_MWAIT;
+ }
memset(env->dr, 0, sizeof(env->dr));
env->dr[6] = DR6_FIXED_1;
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index fce6660..bd06523 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -387,6 +387,7 @@ typedef enum X86Seg {
#define MSR_IA32_MISC_ENABLE 0x1a0
/* Indicates good rep/movs microcode on some processors: */
#define MSR_IA32_MISC_ENABLE_DEFAULT 1
+#define MSR_IA32_MISC_ENABLE_MWAIT (1ULL << 18)
#define MSR_MTRRphysBase(reg) (0x200 + 2 * (reg))
#define MSR_MTRRphysMask(reg) (0x200 + 2 * (reg) + 1)
--
1.8.3.1
- [Qemu-devel] [PULL 00/24] Misc patches for 2019-06-03, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 01/24] test-thread-pool: be more reliable, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 02/24] vl: make -accel help to list enabled accelerators only, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 03/24] checkpatch: allow SPDX-License-Identifier, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 04/24] memory: Remove memory_region_get_dirty(), Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 07/24] edu: mmio: allow 64-bit access in read dispatch, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 08/24] edu: uses uint64_t in dma operation, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 09/24] qgraph: allow extra_device_opts on contains nodes, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 05/24] i386: Enable IA32_MISC_ENABLE MWAIT bit when exposing mwait/monitor,
Paolo Bonzini <=
- [Qemu-devel] [PULL 20/24] tests: convert ds1338-test to qtest, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 17/24] libqos: add ARM n800 machine object, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 14/24] imx25-pdk: create ds1338 for qtest inside the test, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 18/24] libqos: add ARM imx25-pdk machine object, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 15/24] libqos: split I2CAdapter initialization and allocation, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 21/24] libqos: i2c: move address into QI2CDevice, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 19/24] tests: convert OMAP i2c tests to qgraph, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 24/24] q35: Revert to kernel irqchip, Paolo Bonzini, 2019/06/03
- [Qemu-devel] [PULL 12/24] libqos: fix omap-i2c receiving more than 4 bytes, Paolo Bonzini, 2019/06/03