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 09:01:22 +0100 Message-ID: <4D33F752.2090106@web.de> References: <4D316245.9070304@web.de> <1295225670.10748.10.camel@yhuang-dev> <4D33EBBD.6040801@web.de> <1295249471.10748.91.camel@yhuang-dev> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig2E6C1CE1B9255E1B2E84A590" Cc: Avi Kivity , Marcelo Tosatti , kvm To: Huang Ying Return-path: Received: from fmmailgate01.web.de ([217.72.192.221]:55614 "EHLO fmmailgate01.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752526Ab1AQIBY (ORCPT ); Mon, 17 Jan 2011 03:01:24 -0500 In-Reply-To: <1295249471.10748.91.camel@yhuang-dev> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig2E6C1CE1B9255E1B2E84A590 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2011-01-17 08:31, Huang Ying wrote: > On Mon, 2011-01-17 at 15:11 +0800, Jan Kiszka wrote: >> 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. Moreo= ver, >>>> it can be misused to flood the kernel log. Remove it. >>> >>> 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 b= oot >>> stage or the second MC exception is raised before the first MC except= ion >>> is processed/cleared. >>> >>> So I use printk here to help debugging these issues. >>> >>> To avoid flooding the kernel log, we can use ratelimit. >> >> With user space I meant qemu, and maybe "error" was the wrong term. Th= is >> code path is only triggered if qemu decides to. >=20 > Not only decided by qemu, but also decided by guest OS. If guest OS > does not clear the MSR or guest OS does not set the X86_CR4_MCE bit in > the cr4, the triple fault will be triggered. Right, but qemu has full access to the state and can detect this. >=20 >> And there you may also >> print this event (and you already do). >=20 > Sorry, which print do you mean? I can not find similar print in user > space. Err, it's not yet there for the kvm case, I was starring at the tcg code path. >=20 >> 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. >=20 > OK. Then, I think it will be helpful for debugging if we can print > something like this in user space implementation. qemu_log_mask(CPU_LOG_RESET, "Triple fault\n"); (and there will be a message on the monitor if raised manually) Jan --------------enig2E6C1CE1B9255E1B2E84A590 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/ iEYEARECAAYFAk0z91IACgkQitSsb3rl5xSJAwCfdf7uPZ/YfWjn/tDUDlFLrZfS 1VoAnixdQbV8O2ZutUD4efhVKNJ3r4nQ =xbKG -----END PGP SIGNATURE----- --------------enig2E6C1CE1B9255E1B2E84A590--