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:20:07 +0200 Message-ID: <4A1AE157.3010609@siemens.com> References: <1242031695.8213.17.camel@yhuang-dev.sh.intel.com> <4A105DE2.8090200@redhat.com> <4A1AD816.1060702@siemens.com> <4A1ADED5.4020605@redhat.com> <4A1AE04F.9070808@siemens.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 lizzard.sbs.de ([194.138.37.39]:15175 "EHLO lizzard.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751507AbZEYSVp (ORCPT ); Mon, 25 May 2009 14:21:45 -0400 In-Reply-To: <4A1AE04F.9070808@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: Jan Kiszka wrote: > 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 emulati= on >>>>> such as the mcg_cap. MCE is injected via vcpu ioctl command >>>>> KVM_X86_SET_MCE. Extended machine-check state (MCG_EXT_P) and CMC= I are >>>>> not implemented. >>>>> >>>>> =20 >>>> Applied, thanks. >>>> >>>> =20 >>> This patch breaks kvm build for 32-bit hosts. >>> =20 >> Strange, I build-test on i386. What's your failure? >=20 > This is against some 2.6.28 kernel: >=20 > 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 unde= clared (first use in this function) > /data/kvm-kmod/x86/x86.c:794: error: (Each undeclared identifier is r= eported 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 unde= clared (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 und= eclared (first use in this function) > /data/kvm-kmod/x86/x86.c: In function =E2=80=98kvm_vcpu_ioctl_x86_set= up_mce=E2=80=99: > /data/kvm-kmod/x86/x86.c:1592: error: =E2=80=98MCG_CTL_P=E2=80=99 und= eclared (first use in this function) > /data/kvm-kmod/x86/x86.c: In function =E2=80=98kvm_vcpu_ioctl_x86_set= _mce=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= undeclared (first use in this function) > /data/kvm-kmod/x86/x86.c:1619: error: =E2=80=98MCG_CTL_P=E2=80=99 und= eclared (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 x8= 6-64, >>> ie. can I completely #ifdef it away on 32-bit hosts (including >>> KVM_CAP_MCE) or is this more complicated? >>> =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= =2E Ah, interesting: /someone/ removed the #ifdef __x86_64__ from arch/x86/include/asm/mce.h, but that's not mainline yet... Jan --=20 Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux