From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH -v3] KVM: MCE: Add MCE support to KVM Date: Mon, 25 May 2009 20:15:43 +0200 Message-ID: <4A1AE04F.9070808@siemens.com> References: <1242031695.8213.17.camel@yhuang-dev.sh.intel.com> <4A105DE2.8090200@redhat.com> <4A1AD816.1060702@siemens.com> <4A1ADED5.4020605@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Huang Ying , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Kleen To: Avi Kivity Return-path: Received: from gecko.sbs.de ([194.138.37.40]:24641 "EHLO gecko.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751582AbZEYSQI (ORCPT ); Mon, 25 May 2009 14:16:08 -0400 In-Reply-To: <4A1ADED5.4020605@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > Jan Kiszka wrote: >> Avi Kivity wrote: >> =20 >>> Huang Ying wrote: >>> =20 >>>> The related MSRs are emulated. MCE capability is exported via >>>> extension KVM_CAP_MCE and ioctl KVM_X86_GET_MCE_CAP_SUPPORTED. A = new >>>> vcpu ioctl command KVM_X86_SETUP_MCE is used to setup MCE emulatio= n >>>> such as the mcg_cap. MCE is injected via vcpu ioctl command >>>> KVM_X86_SET_MCE. Extended machine-check state (MCG_EXT_P) and CMCI= are >>>> not implemented. >>>> >>>> =20 >>> Applied, thanks. >>> >>> =20 >> >> This patch breaks kvm build for 32-bit hosts. >> =20 >=20 > Strange, I build-test on i386. What's your failure? This is against some 2.6.28 kernel: CC [M] /data/kvm-kmod/x86/x86.o /data/kvm-kmod/x86/x86.c: In function =E2=80=98set_msr_mce=E2=80=99: /data/kvm-kmod/x86/x86.c:794: error: =E2=80=98MCG_CTL_P=E2=80=99 undecl= ared (first use in this function) /data/kvm-kmod/x86/x86.c:794: error: (Each undeclared identifier is rep= orted only once /data/kvm-kmod/x86/x86.c:794: error: for each function it appears in.) /data/kvm-kmod/x86/x86.c: In function =E2=80=98get_msr_mce=E2=80=99: /data/kvm-kmod/x86/x86.c:950: error: =E2=80=98MCG_CTL_P=E2=80=99 undecl= ared (first use in this function) /data/kvm-kmod/x86/x86.c: In function =E2=80=98kvm_arch_dev_ioctl=E2=80= =99: /data/kvm-kmod/x86/x86.c:1216: error: =E2=80=98MCG_CTL_P=E2=80=99 undec= lared (first use in this function) /data/kvm-kmod/x86/x86.c: In function =E2=80=98kvm_vcpu_ioctl_x86_setup= _mce=E2=80=99: /data/kvm-kmod/x86/x86.c:1592: error: =E2=80=98MCG_CTL_P=E2=80=99 undec= lared (first use in this function) /data/kvm-kmod/x86/x86.c: In function =E2=80=98kvm_vcpu_ioctl_x86_set_m= ce=E2=80=99: /data/kvm-kmod/x86/x86.c:1613: error: =E2=80=98MCI_STATUS_VAL=E2=80=99 = undeclared (first use in this function) /data/kvm-kmod/x86/x86.c:1619: error: =E2=80=98MCI_STATUS_UC=E2=80=99 u= ndeclared (first use in this function) /data/kvm-kmod/x86/x86.c:1619: error: =E2=80=98MCG_CTL_P=E2=80=99 undec= lared (first use in this function) /data/kvm-kmod/x86/x86.c:1630: error: =E2=80=98MCG_STATUS_MCIP=E2=80=99= undeclared (first use in this function) /data/kvm-kmod/x86/x86.c:1639: error: =E2=80=98MCI_STATUS_OVER=E2=80=99= undeclared (first use in this function) >=20 >> Is the KVM MCE interface completely or only partially limited to x86= -64, >> ie. can I completely #ifdef it away on 32-bit hosts (including >> KVM_CAP_MCE) or is this more complicated? >> =20 >=20 > I don't see any reason to limit it to x86_64? >=20 Well, if I look at the definition of MCI_STATUS_VAL as (1UL<<63), something tells me: "Hey, only use me on 64-bit hosts!" But I have no clue about details of this stuff, and from a second glance at it is seems to include at least some parts that are valid on 32-bit as well. Jan --=20 Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux