From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jin Dongming Subject: [PATCH 3/3] Check processor version for broadcast. Date: Tue, 30 Nov 2010 17:15:24 +0900 Message-ID: <4CF4B29C.5000907@np.css.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Cc: Andi Kleen , Huang Ying , Hidetoshi Seto , Dean Nelson , KVM list To: Avi Kivity , Marcelo Tosatti Return-path: Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:42550 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754462Ab0K3INN (ORCPT ); Tue, 30 Nov 2010 03:13:13 -0500 Received: from m1.gw.fujitsu.co.jp ([10.0.50.71]) by fgwmail5.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id oAU8DBuH021062 for (envelope-from jin.dongming@np.css.fujitsu.com); Tue, 30 Nov 2010 17:13:11 +0900 Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 61DDF45DE5C for ; Tue, 30 Nov 2010 17:13:11 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 4B17E45DE58 for ; Tue, 30 Nov 2010 17:13:11 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 3E1471DB8047 for ; Tue, 30 Nov 2010 17:13:11 +0900 (JST) Received: from m001.s.css.fujitsu.com (m001.s.css.fujitsu.com [10.23.4.39]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 10CD91DB804B for ; Tue, 30 Nov 2010 17:13:11 +0900 (JST) Sender: kvm-owner@vger.kernel.org List-ID: Broadcast MCA signal is not supported by the CPUs whose version is below 06H_EH. Signed-off-by: Jin Dongming --- target-i386/helper.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/target-i386/helper.c b/target-i386/helper.c index 7e07ebd..437290b 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -1077,10 +1077,23 @@ void cpu_inject_x86_mce(CPUState *cenv, int bank, uint64_t status, unsigned bank_num = cenv->mcg_cap & 0xff; CPUState *env; int flag = 0; + int family, model, cpuver = first_cpu->cpuid_version; if (bank >= bank_num || !(status & MCI_STATUS_VAL)) return; + if (broadcast) { + family = (cpuver >> 8) & 0x0f; + model = ((cpuver >> 12) & 0xf0) + ((cpuver >> 4) & 0x0f); + + if ((family == 6 && model >= 14) || family > 6) + broadcast = 1; + else { + fprintf(stderr, "Current CPU does not support broadcast\n"); + return; + } + } + if (kvm_enabled()) { if (broadcast) flag |= 0x02; /* bit 1: 1(broadcast); 0(not broadcast) */ -- 1.7.1.1