From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] KVM: x86: Remove user space triggerable MCE error message Date: Mon, 17 Jan 2011 08:11:57 +0100 Message-ID: <4D33EBBD.6040801@web.de> References: <4D316245.9070304@web.de> <1295225670.10748.10.camel@yhuang-dev> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigA8BAA396A86304FFB7C5B211" Cc: Avi Kivity , Marcelo Tosatti , kvm To: Huang Ying Return-path: Received: from fmmailgate02.web.de ([217.72.192.227]:45163 "EHLO fmmailgate02.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752825Ab1AQHMF (ORCPT ); Mon, 17 Jan 2011 02:12:05 -0500 In-Reply-To: <1295225670.10748.10.camel@yhuang-dev> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA8BAA396A86304FFB7C5B211 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2011-01-17 01:54, Huang Ying wrote: > On Sat, 2011-01-15 at 17:00 +0800, Jan Kiszka wrote: >> From: Jan Kiszka >> >> This case is a pure user space error we do not need to record. Moreove= r, >> it can be misused to flood the kernel log. Remove it. >=20 > I don't think this is a pure user space error. This happens on real > hardware too, if the Machine Check exception is raised during early boo= t > stage or the second MC exception is raised before the first MC exceptio= n > is processed/cleared. >=20 > So I use printk here to help debugging these issues. >=20 > To avoid flooding the kernel log, we can use ratelimit. With user space I meant qemu, and maybe "error" was the wrong term. This code path is only triggered if qemu decides to. And there you may also print this event (and you already do). Another reason to not rely on catching this case here: KVM_X86_SET_MCE is obsolete on current kernels. Qemu will use a combination of KVM_SET_MSRS and KVM_SET_VCPU_EVENTS in the future, only falling back to this interface on pre-vcpu-events kernels. Then you need to debug this in user space anyway as the triple fault will no longer make it to the kernel. Jan >=20 > Best Regards, > Huang Ying >=20 >> Signed-off-by: Jan Kiszka >> --- >> arch/x86/kvm/x86.c | 3 --- >> 1 files changed, 0 insertions(+), 3 deletions(-) >> >> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c >> index 9dda70d..7f7e4a5 100644 >> --- a/arch/x86/kvm/x86.c >> +++ b/arch/x86/kvm/x86.c >> @@ -2575,9 +2575,6 @@ static int kvm_vcpu_ioctl_x86_set_mce(struct kvm= _vcpu *vcpu, >> if (mce->status & MCI_STATUS_UC) { >> if ((vcpu->arch.mcg_status & MCG_STATUS_MCIP) || >> !kvm_read_cr4_bits(vcpu, X86_CR4_MCE)) { >> - printk(KERN_DEBUG "kvm: set_mce: " >> - "injects mce exception while " >> - "previous one is in progress!\n"); >> kvm_make_request(KVM_REQ_TRIPLE_FAULT, vcpu); >> return 0; >> } >=20 >=20 --------------enigA8BAA396A86304FFB7C5B211 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk0z68IACgkQitSsb3rl5xTIYACfb3evKTsMKGPXBmosHUqb4PRX mYwAoLjpFeTH5G7NlmC7v1jHh+YELimz =B8Sl -----END PGP SIGNATURE----- --------------enigA8BAA396A86304FFB7C5B211--