qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/5] target-i386: Use X86CPU on cpu_x86_support_mca_


From: Eduardo Habkost
Subject: [Qemu-devel] [PATCH 1/5] target-i386: Use X86CPU on cpu_x86_support_mca_broadcast()
Date: Fri, 24 Apr 2015 15:30:05 -0300

Signed-off-by: Eduardo Habkost <address@hidden>
---
 target-i386/cpu.h    | 2 +-
 target-i386/helper.c | 6 +++---
 target-i386/kvm.c    | 3 +--
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 4ee12ca..5f4dab1 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -984,7 +984,7 @@ X86CPU *cpu_x86_create(const char *cpu_model, Error **errp);
 int cpu_x86_exec(CPUX86State *s);
 void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf);
 void x86_cpudef_setup(void);
-int cpu_x86_support_mca_broadcast(CPUX86State *env);
+int cpu_x86_support_mca_broadcast(X86CPU *cpu);
 
 int cpu_get_pic_interrupt(CPUX86State *s);
 /* MSDOS compatibility mode FPU exception support */
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 4f1ddf7..166a803 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -38,12 +38,12 @@ static void cpu_x86_version(CPUX86State *env, int *family, 
int *model)
 }
 
 /* Broadcast MCA signal for processor version 06H_EH and above */
-int cpu_x86_support_mca_broadcast(CPUX86State *env)
+int cpu_x86_support_mca_broadcast(X86CPU *cpu)
 {
     int family = 0;
     int model = 0;
 
-    cpu_x86_version(env, &family, &model);
+    cpu_x86_version(&cpu->env, &family, &model);
     if ((family == 6 && model >= 14) || family > 6) {
         return 1;
     }
@@ -1148,7 +1148,7 @@ void cpu_x86_inject_mce(Monitor *mon, X86CPU *cpu, int 
bank,
         return;
     }
     if ((flags & MCE_INJECT_BROADCAST)
-        && !cpu_x86_support_mca_broadcast(cenv)) {
+        && !cpu_x86_support_mca_broadcast(cpu)) {
         monitor_printf(mon, "Guest CPU does not support MCA broadcast\n");
         return;
     }
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 41d09e5..bb2477d 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -298,7 +298,6 @@ static int kvm_get_mce_cap_supported(KVMState *s, uint64_t 
*mce_cap,
 
 static void kvm_mce_inject(X86CPU *cpu, hwaddr paddr, int code)
 {
-    CPUX86State *env = &cpu->env;
     uint64_t status = MCI_STATUS_VAL | MCI_STATUS_UC | MCI_STATUS_EN |
                       MCI_STATUS_MISCV | MCI_STATUS_ADDRV | MCI_STATUS_S;
     uint64_t mcg_status = MCG_STATUS_MCIP;
@@ -312,7 +311,7 @@ static void kvm_mce_inject(X86CPU *cpu, hwaddr paddr, int 
code)
     }
     cpu_x86_inject_mce(NULL, cpu, 9, status, mcg_status, paddr,
                        (MCM_ADDR_PHYS << 6) | 0xc,
-                       cpu_x86_support_mca_broadcast(env) ?
+                       cpu_x86_support_mca_broadcast(cpu) ?
                        MCE_INJECT_BROADCAST : 0);
 }
 
-- 
2.1.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]