From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: kvm_amd BUG: unable to handle kernel NULL pointer dereference at 00000014 Date: Mon, 07 Mar 2011 15:20:42 +0200 Message-ID: <4D74DBAA.7020901@redhat.com> References: <4D736090.1000300@redhat.com> <20110307121138.GD17719@amd.com> <4D74D486.2080206@redhat.com> <20110307131649.GF17719@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: IVAN ANGELOV , "kvm@vger.kernel.org" , Ingo Molnar , "x86@kernel.org" To: "Roedel, Joerg" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:1082 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752918Ab1CGNVx (ORCPT ); Mon, 7 Mar 2011 08:21:53 -0500 In-Reply-To: <20110307131649.GF17719@amd.com> Sender: kvm-owner@vger.kernel.org List-ID: On 03/07/2011 03:16 PM, Roedel, Joerg wrote: > On Mon, Mar 07, 2011 at 07:50:14AM -0500, Avi Kivity wrote: > > On 03/07/2011 02:11 PM, Roedel, Joerg wrote: > > > > There is no access to per_cpu variables at the start of x86_decode_insn. > > > I did a bit of investigation and it turns out that the faulting > > > instruction is inserted into the code by the gcc because the > > > CONFIG_CC_STACKPROTECTOR is enabled. > > > The user tested this is Ubuntu 11.04 alpha-something i386 and this > > > distro uses gcc 4.5.2. So CC_STACKPROTECTOR seems to be harmful with > > > this gcc version but I am not sure whether this counts as a gcc bug. > > > > Ah, looks like %gs is the expected segment on i386 with > > -fstack-protector. So we must disable lazy gs reload in that scenario. > > According to the comments in stackprotector.h its the same on amd64 (the > difference is that gcc expects the canary value at a different offset > from %gs). > So we should probably unlazy %gs reload alltogether. On x86_64 we don't do lazy %gs reload (lazy %fs instead), so it should work as is. -- error compiling committee.c: too many arguments to function