qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Igor Mammedov" <imammedo@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>,
	"Andreas Färber" <afaerber@suse.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [Qemu-devel] [PATCH 4/5] target-i386: Use X86CPU on cpu_report_tpr_access()
Date: Fri, 24 Apr 2015 15:30:08 -0300	[thread overview]
Message-ID: <1429900209-31811-5-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1429900209-31811-1-git-send-email-ehabkost@redhat.com>

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 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

  parent reply	other threads:[~2015-04-24 18:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-24 18:30 [Qemu-devel] [PATCH 0/5] target-i386: Some CPUX86State -> X86CPU conversions Eduardo Habkost
2015-04-24 18:30 ` [Qemu-devel] [PATCH 1/5] target-i386: Use X86CPU on cpu_x86_support_mca_broadcast() Eduardo Habkost
2015-04-24 18:30 ` [Qemu-devel] [PATCH 2/5] target-i386: Use X86CPU on cpu_x86_version() Eduardo Habkost
2015-04-24 18:30 ` [Qemu-devel] [PATCH 3/5] target-i386: Use X86CPU on cpu_get_pic_interrupt() Eduardo Habkost
2015-04-24 18:30 ` Eduardo Habkost [this message]
2015-04-24 18:30 ` [Qemu-devel] [PATCH 5/5] target-i386: Use X86CPU on cpu_x86_cpuid() Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1429900209-31811-5-git-send-email-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=afaerber@suse.de \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).