From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Rodel Subject: Re: [PATCH] KVM: SVM: fix random segfaults with NPT enabled Date: Wed, 27 Aug 2008 15:53:26 +0200 Message-ID: <20080827135326.GB26059@amd.com> References: <1219839523-25677-1-git-send-email-joerg.roedel@amd.com> <48B55266.4000300@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: kvm@vger.kernel.org, stable@kernel.org, Alexander Graf To: Avi Kivity Return-path: Received: from outbound-dub.frontbridge.com ([213.199.154.16]:31064 "EHLO IE1EHSOBE004.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757441AbYH0NyX (ORCPT ); Wed, 27 Aug 2008 09:54:23 -0400 Content-Disposition: inline In-Reply-To: <48B55266.4000300@qumranet.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Aug 27, 2008 at 04:11:02PM +0300, Avi Kivity wrote: > Joerg Rodel wrote: > >From: Joerg Roedel > > > >This patch introduces a guest TLB flush on every NPF exit in KVM. This fixes > >random segfaults and #UD exceptions in the guest seen under some workloads > >(e.g. long running compile workloads or tbench). A kernbench run with and > >without that fix showed that it has a slowdown lower than 0.5% > > > > > > hm. tbench doesn't allocate memory, so there shouldn't be any npt faults. I don't > see how this can make a difference. Base for the fix was this bugreport: http://sourceforge.net/tracker/index.php?func=detail&aid=2019053&group_id=180599&atid=893831 We found out that the same crash occur on long running compile workloads and that stale tlb-entries cause it. Until we find the real location of the missing tlb flush in the mmu code, i think its best to flush the TLB every time the mapping/unmapping code for the nested page table is executed. This fixes at least the crashes in the guest and has only minimal performance impact. > It can only change something if X is started and we're tracking writes to the > framebuffer. Is this the case? No, X is not running in the guest. Joerg -- | AMD Saxony Limited Liability Company & Co. KG Operating | Wilschdorfer Landstr. 101, 01109 Dresden, Germany System | Register Court Dresden: HRA 4896 Research | General Partner authorized to represent: Center | AMD Saxony LLC (Wilmington, Delaware, US) | General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy