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 1/5] target-i386: Use X86CPU on cpu_x86_support_mca_broadcast()
Date: Fri, 24 Apr 2015 15:30:05 -0300	[thread overview]
Message-ID: <1429900209-31811-2-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>
---
 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	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 ` Eduardo Habkost [this message]
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 ` [Qemu-devel] [PATCH 4/5] target-i386: Use X86CPU on cpu_report_tpr_access() Eduardo Habkost
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-2-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).