From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic. Date: Sun, 19 Apr 2009 11:52:07 +0300 Message-ID: <49EAE637.5000204@redhat.com> References: <1239616545-25199-1-git-send-email-gleb@redhat.com> <1239616545-25199-6-git-send-email-gleb@redhat.com> <49E997C6.4090503@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , kvm@vger.kernel.org, joerg.roedel@amd.com, sheng@linux.intel.com, Dmitry Baryshkov To: Jan Kiszka Return-path: Received: from mx2.redhat.com ([66.187.237.31]:48017 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754921AbZDSIwU (ORCPT ); Sun, 19 Apr 2009 04:52:20 -0400 In-Reply-To: <49E997C6.4090503@web.de> Sender: kvm-owner@vger.kernel.org List-ID: Jan Kiszka wrote: >> - >> - if (!npt_enabled && event_injection) >> - kvm_mmu_unprotect_page_virt(&svm->vcpu, fault_address); >> + else { >> + if (svm->vcpu.arch.interrupt.pending || >> + svm->vcpu.arch.exception.pending) >> + kvm_mmu_unprotect_page_virt(&svm->vcpu, fault_address); >> + } >> > > Without understanding yet why kvm_mmu_unprotect_page_virt is required > here, That is needed in case interrupt injection failed because the process of injecting the interrupt (usually pushing data on the stack) writes to a write-protected page table. I guess we need nmi_pending here as well. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.