From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [patch 1/2] KVM: x86: handle double and triple faults for every exception Date: Sun, 15 Nov 2009 14:51:46 +0200 Message-ID: <20091115125146.GF7392@redhat.com> References: <20091111192947.348198723@localhost.localdomain> <20091111193837.115825934@localhost.localdomain> <20091112122659.GC7392@redhat.com> <4AFFF716.5000708@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , kvm@vger.kernel.org, jan.kiszka@siemens.com, joerg.roedel@amd.com, Jan Kiszka To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:4679 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752673AbZKOMvq (ORCPT ); Sun, 15 Nov 2009 07:51:46 -0500 Content-Disposition: inline In-Reply-To: <4AFFF716.5000708@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Nov 15, 2009 at 02:41:58PM +0200, Avi Kivity wrote: > On 11/12/2009 02:26 PM, Gleb Natapov wrote: > >> > >>- if (vcpu->arch.exception.pending) { > >>- switch(vcpu->arch.exception.nr) { > >>- case DF_VECTOR: > >>- /* triple fault -> shutdown */ > >>- set_bit(KVM_REQ_TRIPLE_FAULT,&vcpu->requests); > >>- return; > >>- case PF_VECTOR: > >>- vcpu->arch.exception.nr = DF_VECTOR; > >>- vcpu->arch.exception.error_code = 0; > >>- return; > >>- default: > >>- /* replace previous exception with a new one in a hope > >>- that instruction re-execution will regenerate lost > >>- exception */ > >>- vcpu->arch.exception.pending = false; > >>- break; > >When exceptions are handled serially previous exception have to be > >replaced by new one. Think about #PF during #DE. #PF should be handled first > >before #DE can proceed. > > "replacing" exceptions is dangerous in the case of debug exceptions > and machine checks, since restarting execution won't recover them. > But not replacing them is not better. No point in re-injecting exception that causes another exception. -- Gleb.