Blame SOURCES/kvm-target-i386-fix-TCG-UCODE_REV-access.patch

4636b8
From 836c2251308bb9a3a8355e09c2d89c53526aa898 Mon Sep 17 00:00:00 2001
4636b8
From: Paolo Bonzini <pbonzini@redhat.com>
4636b8
Date: Mon, 17 Feb 2020 16:23:21 -0500
4636b8
Subject: [PATCH 06/12] target/i386: fix TCG UCODE_REV access
4636b8
MIME-Version: 1.0
4636b8
Content-Type: text/plain; charset=UTF-8
4636b8
Content-Transfer-Encoding: 8bit
4636b8
4636b8
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
4636b8
Message-id: <20200217162323.2572-5-pbonzini@redhat.com>
4636b8
Patchwork-id: 93906
4636b8
O-Subject: [RHEL7.9 qemu-kvm-rhev PATCH 4/6] target/i386: fix TCG UCODE_REV access
4636b8
Bugzilla: 1791653
4636b8
RH-Acked-by: Maxim Levitsky <mlevitsk@redhat.com>
4636b8
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
4636b8
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
4636b8
4636b8
This was a very interesting semantic conflict that caused git to move
4636b8
the MSR_IA32_UCODE_REV read to helper_wrmsr.  Not a big deal, but
4636b8
still should be fixed...
4636b8
4636b8
Fixes: 4e45aff398 ("target/i386: add a ucode-rev property", 2020-01-24)
4636b8
Message-id: <20200206171022.9289-1-pbonzini@redhat.com>
4636b8
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4636b8
(cherry picked from commit 9028c75c9d08be303ccc425bfe3d3b23d8f4cac7)
4636b8
4636b8
[RHEL7: replace env_archcpu with x86_env_get_cpu]
4636b8
4636b8
Signed-off-by: Jon Maloy <jmaloy.redhat.com>
4636b8
---
4636b8
 target/i386/misc_helper.c | 8 ++++----
4636b8
 1 file changed, 4 insertions(+), 4 deletions(-)
4636b8
4636b8
diff --git a/target/i386/misc_helper.c b/target/i386/misc_helper.c
4636b8
index f93e61f05d..42daf36764 100644
4636b8
--- a/target/i386/misc_helper.c
4636b8
+++ b/target/i386/misc_helper.c
4636b8
@@ -229,7 +229,6 @@ void helper_rdmsr(CPUX86State *env)
4636b8
 #else
4636b8
 void helper_wrmsr(CPUX86State *env)
4636b8
 {
4636b8
-    X86CPU *x86_cpu = x86_env_get_cpu(env);
4636b8
     uint64_t val;
4636b8
 
4636b8
     cpu_svm_check_intercept_param(env, SVM_EXIT_MSR, 1, GETPC());
4636b8
@@ -372,9 +371,6 @@ void helper_wrmsr(CPUX86State *env)
4636b8
         env->msr_bndcfgs = val;
4636b8
         cpu_sync_bndcs_hflags(env);
4636b8
         break;
4636b8
-     case MSR_IA32_UCODE_REV:
4636b8
-        val = x86_cpu->ucode_rev;
4636b8
-        break;
4636b8
     default:
4636b8
         if ((uint32_t)env->regs[R_ECX] >= MSR_MC0_CTL
4636b8
             && (uint32_t)env->regs[R_ECX] < MSR_MC0_CTL +
4636b8
@@ -393,6 +389,7 @@ void helper_wrmsr(CPUX86State *env)
4636b8
 
4636b8
 void helper_rdmsr(CPUX86State *env)
4636b8
 {
4636b8
+    X86CPU *x86_cpu = x86_env_get_cpu(env);
4636b8
     uint64_t val;
4636b8
 
4636b8
     cpu_svm_check_intercept_param(env, SVM_EXIT_MSR, 0, GETPC());
4636b8
@@ -523,6 +520,9 @@ void helper_rdmsr(CPUX86State *env)
4636b8
     case MSR_IA32_BNDCFGS:
4636b8
         val = env->msr_bndcfgs;
4636b8
         break;
4636b8
+     case MSR_IA32_UCODE_REV:
4636b8
+        val = x86_cpu->ucode_rev;
4636b8
+        break;
4636b8
     default:
4636b8
         if ((uint32_t)env->regs[R_ECX] >= MSR_MC0_CTL
4636b8
             && (uint32_t)env->regs[R_ECX] < MSR_MC0_CTL +
4636b8
-- 
4636b8
2.18.2
4636b8