Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261917AbTIRRGc (ORCPT ); Thu, 18 Sep 2003 13:06:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261921AbTIRRGc (ORCPT ); Thu, 18 Sep 2003 13:06:32 -0400 Received: from ns.suse.de ([195.135.220.2]:2771 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S261917AbTIRRGb (ORCPT ); Thu, 18 Sep 2003 13:06:31 -0400 Date: Thu, 18 Sep 2003 19:06:29 +0200 From: Andi Kleen To: Jamie Lokier Cc: Andi Kleen , Linus Torvalds , Nick Piggin , Andrew Morton , linux-kernel@vger.kernel.org, richard.brunner@amd.com Subject: Re: [PATCH] Athlon/Opteron Prefetch Fix for 2.6.0test5 + numbers Message-ID: <20030918170629.GC7917@wotan.suse.de> References: <20030917202100.GC4723@wotan.suse.de> <20030917211200.GA5997@wotan.suse.de> <20030918153831.GA7548@mail.jlokier.co.uk> <20030918160456.GC7548@mail.jlokier.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030918160456.GC7548@mail.jlokier.co.uk> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1246 Lines: 30 On Thu, Sep 18, 2003 at 05:04:56PM +0100, Jamie Lokier wrote: > Jamie Lokier wrote: > > > + /* Don't check for LDT code segments because they could have > > > + non zero bases. Better would be to add in the base in this case. */ > > > + if (regs->xcs & (1<<2)) > > > + return 0; > > > > It is possible to have a non-standard code segment in the GDT, too. > > Thus a better to check is "unlikely((regs->xcs & 0xffff) != __USER_CS)". > > Ignore me here, I'm being dense - forgetting about __KERNEL_CS :) > > My point is simply that non-zero base GDT segments are possible in > userspace, and whatever code you add later to add the base should > be aware of that. I don't see how a non standard GDT is possible in user space. The GDT is only managed by the kernel. 2.6 offers to change it for NPTL, but that only applies to data segments. In vm86 mode the user can load a different base without LDT, but that should not matter here (although it may be better to check for VM86 mode too) -Andi - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/