From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Huth Subject: Re: [PATCH] KVM: PPC: Exit guest upon fatal machine check exception Date: Fri, 13 Nov 2015 08:38:08 +0100 Message-ID: <56459360.3090400@redhat.com> References: <20151111165845.3721.98296.stgit@aravindap> <876118ymy4.fsf@gamma.ozlabs.ibm.com> <20151112033816.GJ5852@voom.redhat.com> <5644164A.40706@linux.vnet.ibm.com> <20151112044316.GA4886@voom.redhat.com> <5644D1DD.1020201@linux.vnet.ibm.com> <20151113015015.GI4886@voom.redhat.com> <5645828E.1030609@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, michaele@au1.ibm.com, mahesh@linux.vnet.ibm.com, agraf@suse.de, kvm-ppc@vger.kernel.org, linuxppc-dev@ozlabs.org, Daniel Axtens To: Aravinda Prasad , David Gibson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46308 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753183AbbKMHiN (ORCPT ); Fri, 13 Nov 2015 02:38:13 -0500 In-Reply-To: <5645828E.1030609@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 13/11/15 07:26, Aravinda Prasad wrote: > > On Friday 13 November 2015 07:20 AM, David Gibson wrote: >> On Thu, Nov 12, 2015 at 11:22:29PM +0530, Aravinda Prasad wrote: [...] >>> So thinking whether qemu should explicitly enable the new NMI >>> behavior. >> >> So, I think the reasoning above tends towards having qemu control the >> MC behaviour. If qemu does nothing, MCs are delivered direct to >> 0x200, if it enables the new handling, they cause a KVM exit and qemu >> will deliver the MC. > > This essentially requires qemu to control how KVM behaves as KVM does > the actual redirection of MC either to guest's 0x200 vector or to exit > guest. So, if we are running new qemu, then KVM should exit guest and if > we are running old qemu, KVM should redirect MC to 0x200. Is there any > way to communicate this to KVM? ioctl? Simply introduce a KVM capability that can be enabled by userspace. See kvm_vcpu_ioctl_enable_cap() in arch/powerpc/kvm/powerpc.c. Thomas