From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch 1/2] KVM: x86: handle double and triple faults for every exception Date: Sun, 15 Nov 2009 14:30:27 +0200 Message-ID: <4AFFF463.60807@redhat.com> References: <20091111192947.348198723@localhost.localdomain> <20091111193837.115825934@localhost.localdomain> <4AFB196C.7010302@web.de> <20091111204107.GA14011@amt.cnet> <4AFB265B.9030506@web.de> <20091111214029.GA14787@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , kvm@vger.kernel.org, gleb@redhat.com, jan.kiszka@siemens.com, joerg.roedel@amd.com To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:18748 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752720AbZKOMa2 (ORCPT ); Sun, 15 Nov 2009 07:30:28 -0500 In-Reply-To: <20091111214029.GA14787@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: >> Another micro difference is this: >> >> >>> @@ -184,24 +196,6 @@ void kvm_inject_page_fault(struct kvm_vc >>> { >>> ++vcpu->stat.pf_guest; >>> >>> - 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; >>> - } >>> - } >>> vcpu->arch.cr2 = addr; >>> kvm_queue_exception_e(vcpu, PF_VECTOR, error_code); >>> } >>> >> So far cr2 was not touched on DF, now it is. >> > Yep. The PF was overwritten with DF, which means the cr2 value will not > be interpreted by the guest? > The note under interrupt 14 documentation in 5.15 indicates that cr2 is updated when the page fault is detected, not delivered, so it is correct to update cr2 immediately. -- error compiling committee.c: too many arguments to function