[PATCH] target/i386: allow RDMSR of MSR_TSC_AUX outside TARGET_X86_64

Keke Ming posted 1 patch 1 month, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260808072046.229644-1-ming.jvle@gmail.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>
target/i386/tcg/system/misc_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] target/i386: allow RDMSR of MSR_TSC_AUX outside TARGET_X86_64
Posted by Keke Ming 1 month, 2 weeks ago
WRMSR already accepts MSR_TSC_AUX outside TARGET_X86_64 and stores
the value in env->tsc_aux. RDMSR only returns env->tsc_aux inside
the TARGET_X86_64 block, which makes the TCG i386 target unable to
read back a value it can write.

Signed-off-by: Keke Ming <ming.jvle@gmail.com>
---
 target/i386/tcg/system/misc_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/i386/tcg/system/misc_helper.c b/target/i386/tcg/system/misc_helper.c
index 2998b1aae7..eb06f032af 100644
--- a/target/i386/tcg/system/misc_helper.c
+++ b/target/i386/tcg/system/misc_helper.c
@@ -387,10 +387,10 @@ void helper_rdmsr(CPUX86State *env)
     case MSR_KERNELGSBASE:
         val = env->kernelgsbase;
         break;
+#endif
     case MSR_TSC_AUX:
         val = env->tsc_aux;
         break;
-#endif
     case MSR_SMI_COUNT:
         val = env->msr_smi_count;
         break;
-- 
2.43.0