qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 4/5] target-i386: Use X86CPU on cpu_report_tpr_acces


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

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

diff --git a/hw/intc/apic.c b/hw/intc/apic.c
index 0f97b47..2f19c19 100644
--- a/hw/intc/apic.c
+++ b/hw/intc/apic.c
@@ -684,7 +684,7 @@ static uint32_t apic_mem_readl(void *opaque, hwaddr addr)
     case 0x08:
         apic_sync_vapic(s, SYNC_FROM_VAPIC);
         if (apic_report_tpr_access) {
-            cpu_report_tpr_access(&s->cpu->env, TPR_ACCESS_READ);
+            cpu_report_tpr_access(s->cpu, TPR_ACCESS_READ);
         }
         val = s->tpr;
         break;
@@ -786,7 +786,7 @@ static void apic_mem_writel(void *opaque, hwaddr addr, 
uint32_t val)
         break;
     case 0x08:
         if (apic_report_tpr_access) {
-            cpu_report_tpr_access(&s->cpu->env, TPR_ACCESS_WRITE);
+            cpu_report_tpr_access(s->cpu, TPR_ACCESS_WRITE);
         }
         s->tpr = val;
         apic_sync_vapic(s, SYNC_TO_VAPIC);
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 5eb8a79..3c2055f 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -1306,7 +1306,7 @@ void do_interrupt_x86_hardirq(CPUX86State *env, int 
intno, int is_hw);
 
 void do_smm_enter(X86CPU *cpu);
 
-void cpu_report_tpr_access(CPUX86State *env, TPRAccess access);
+void cpu_report_tpr_access(X86CPU *cpu, TPRAccess access);
 
 void x86_cpu_compat_set_features(const char *cpu_model, FeatureWord w,
                                  uint32_t feat_add, uint32_t feat_remove);
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 215b354..54a0fdb 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1172,19 +1172,18 @@ void cpu_x86_inject_mce(Monitor *mon, X86CPU *cpu, int 
bank,
     }
 }
 
-void cpu_report_tpr_access(CPUX86State *env, TPRAccess access)
+void cpu_report_tpr_access(X86CPU *cpu, TPRAccess access)
 {
-    X86CPU *cpu = x86_env_get_cpu(env);
     CPUState *cs = CPU(cpu);
 
     if (kvm_enabled()) {
-        env->tpr_access_type = access;
+        cpu->env.tpr_access_type = access;
 
         cpu_interrupt(cs, CPU_INTERRUPT_TPR);
     } else {
         cpu_restore_state(cs, cs->mem_io_pc);
 
-        apic_handle_tpr_access_report(cpu->apic_state, env->eip, access);
+        apic_handle_tpr_access_report(cpu->apic_state, cpu->env.eip, access);
     }
 }
 #endif /* !CONFIG_USER_ONLY */
-- 
2.1.0




reply via email to

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