From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [KVM paravirt issue?] Re: vsyscall=emulate regression Date: Thu, 16 Feb 2012 19:14:03 +0200 Message-ID: <4F3D395B.1000708@redhat.com> References: <20120203082748.GB782@amit.redhat.com> <20120214122205.GA29418@amit.redhat.com> <20120215110122.GA3136@amit.redhat.com> <4F3D2C09.1020803@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Amit Shah , tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, kvm list To: Andy Lutomirski Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 02/16/2012 06:45 PM, Andy Lutomirski wrote: > > > >> So I could have messed up, or there could be a subtle > >> bug somewhere. Any ideas? > > > > What's the code trying to do? Execute an instruction from an > > non-executable page, trap the #PF, and emulate? And what are the > > symptoms? wrong error code for the #PF? That could easily be a kvm bug. > > > > The symptom is that some kind of access to a page that's supposed to > be readable, NX is reporting error 5. I'm not quite sure what kind of > access is causing that. Might it be a fetch access, with kvm forgetting to set bit 4 correctly? > > > > Can you point me at the code in question? > > The setup code is in arch/x86/kernel/vsyscall_64.c in map_vsyscall. > The bad access is to the vsyscall page. The bad access is on purpose, yes? >>From fault.c: #ifdef CONFIG_X86_64 /* * Instruction fetch faults in the vsyscall page might need * emulation. */ if (unlikely((error_code & PF_INSTR) && ((address & ~0xfff) == VSYSCALL_START))) { if (emulate_vsyscall(regs, address)) return; } #endif so it seems like kvm doesn't set PF_INSTR? I thought we unit tested that, but maybe not this exact scenario. -- error compiling committee.c: too many arguments to function