All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Clean up cpu_inject_x86_mce().
@ 2010-12-10  8:20 Jin Dongming
  2010-12-20 11:28 ` Marcelo Tosatti
  0 siblings, 1 reply; 3+ messages in thread
From: Jin Dongming @ 2010-12-10  8:20 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti
  Cc: Andi Kleen, Huang Ying, Hidetoshi Seto, Dean Nelson, KVM list

Hi, all

I am sorry for replying late.
I modified the patches as the comments of huang-san and Marcelo-san
and resend them.

Thanks.

Best Regards,
Jin Dongming
-----------------------------------------------------------
Clean up cpu_inject_x86_mce() for later patch.

Signed-off-by: Jin Dongming <jin.dongming@np.css.fujitsu.com>
---
 target-i386/helper.c |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/target-i386/helper.c b/target-i386/helper.c
index d765cc6..9c07c38 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1023,21 +1023,12 @@ static void breakpoint_handler(CPUState *env)
 /* This should come from sysemu.h - if we could include it here... */
 void qemu_system_reset_request(void);
 
-void cpu_inject_x86_mce(CPUState *cenv, int bank, uint64_t status,
+static void qemu_inject_x86_mce(CPUState *cenv, int bank, uint64_t status,
                         uint64_t mcg_status, uint64_t addr, uint64_t misc)
 {
     uint64_t mcg_cap = cenv->mcg_cap;
-    unsigned bank_num = mcg_cap & 0xff;
     uint64_t *banks = cenv->mce_banks;
 
-    if (bank >= bank_num || !(status & MCI_STATUS_VAL))
-        return;
-
-    if (kvm_enabled()) {
-        kvm_inject_x86_mce(cenv, bank, status, mcg_status, addr, misc, 0);
-        return;
-    }
-
     /*
      * if MSR_MCG_CTL is not all 1s, the uncorrected error
      * reporting is disabled
@@ -1078,6 +1069,22 @@ void cpu_inject_x86_mce(CPUState *cenv, int bank, uint64_t status,
     } else
         banks[1] |= MCI_STATUS_OVER;
 }
+
+void cpu_inject_x86_mce(CPUState *cenv, int bank, uint64_t status,
+                        uint64_t mcg_status, uint64_t addr, uint64_t misc)
+{
+    unsigned bank_num = cenv->mcg_cap & 0xff;
+
+    if (bank >= bank_num || !(status & MCI_STATUS_VAL)) {
+        return;
+    }
+
+    if (kvm_enabled()) {
+        kvm_inject_x86_mce(cenv, bank, status, mcg_status, addr, misc, 0);
+    } else {
+        qemu_inject_x86_mce(cenv, bank, status, mcg_status, addr, misc);
+    }
+}
 #endif /* !CONFIG_USER_ONLY */
 
 static void mce_init(CPUX86State *cenv)
-- 
1.7.1.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/3] Clean up cpu_inject_x86_mce().
  2010-12-10  8:20 [PATCH 1/3] Clean up cpu_inject_x86_mce() Jin Dongming
@ 2010-12-20 11:28 ` Marcelo Tosatti
  0 siblings, 0 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2010-12-20 11:28 UTC (permalink / raw)
  To: Jin Dongming
  Cc: Avi Kivity, Andi Kleen, Huang Ying, Hidetoshi Seto, Dean Nelson,
	KVM list

On Fri, Dec 10, 2010 at 05:20:44PM +0900, Jin Dongming wrote:
> Hi, all
> 
> I am sorry for replying late.
> I modified the patches as the comments of huang-san and Marcelo-san
> and resend them.

Applied all 3 to uq/master, thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/3] Clean up cpu_inject_x86_mce().
@ 2010-11-30  8:12 Jin Dongming
  0 siblings, 0 replies; 3+ messages in thread
From: Jin Dongming @ 2010-11-30  8:12 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti
  Cc: Andi Kleen, Huang Ying, Hidetoshi Seto, Dean Nelson, KVM list

Clean up cpu_inject_x86_mce() for later patch.

Signed-off-by: Jin Dongming <jin.dongming@np.css.fujitsu.com>
---
 target-i386/helper.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/target-i386/helper.c b/target-i386/helper.c
index f5c06a8..e384fdc 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1023,21 +1023,12 @@ static void breakpoint_handler(CPUState *env)
 /* This should come from sysemu.h - if we could include it here... */
 void qemu_system_reset_request(void);
 
-void cpu_inject_x86_mce(CPUState *cenv, int bank, uint64_t status,
+static void qemu_inject_x86_mce(CPUState *cenv, int bank, uint64_t status,
                         uint64_t mcg_status, uint64_t addr, uint64_t misc)
 {
     uint64_t mcg_cap = cenv->mcg_cap;
-    unsigned bank_num = mcg_cap & 0xff;
     uint64_t *banks = cenv->mce_banks;
 
-    if (bank >= bank_num || !(status & MCI_STATUS_VAL))
-        return;
-
-    if (kvm_enabled()) {
-        kvm_inject_x86_mce(cenv, bank, status, mcg_status, addr, misc, 0);
-        return;
-    }
-
     /*
      * if MSR_MCG_CTL is not all 1s, the uncorrected error
      * reporting is disabled
@@ -1078,6 +1069,21 @@ void cpu_inject_x86_mce(CPUState *cenv, int bank, uint64_t status,
     } else
         banks[1] |= MCI_STATUS_OVER;
 }
+
+void cpu_inject_x86_mce(CPUState *cenv, int bank, uint64_t status,
+                        uint64_t mcg_status, uint64_t addr, uint64_t misc)
+{
+    unsigned bank_num = cenv->mcg_cap & 0xff;
+
+    if (bank >= bank_num || !(status & MCI_STATUS_VAL))
+        return;
+
+    if (kvm_enabled()) {
+        kvm_inject_x86_mce(cenv, bank, status, mcg_status, addr, misc, 0);
+    } else {
+        qemu_inject_x86_mce(cenv, bank, status, mcg_status, addr, misc);
+    }
+}
 #endif /* !CONFIG_USER_ONLY */
 
 static void mce_init(CPUX86State *cenv)
-- 
1.7.1.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-20 11:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-10  8:20 [PATCH 1/3] Clean up cpu_inject_x86_mce() Jin Dongming
2010-12-20 11:28 ` Marcelo Tosatti
  -- strict thread matches above, loose matches on Subject: below --
2010-11-30  8:12 Jin Dongming

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.