Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261586AbTIRPjG (ORCPT ); Thu, 18 Sep 2003 11:39:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261602AbTIRPjG (ORCPT ); Thu, 18 Sep 2003 11:39:06 -0400 Received: from mail.jlokier.co.uk ([81.29.64.88]:46997 "EHLO mail.jlokier.co.uk") by vger.kernel.org with ESMTP id S261586AbTIRPjE (ORCPT ); Thu, 18 Sep 2003 11:39:04 -0400 Date: Thu, 18 Sep 2003 16:38:31 +0100 From: Jamie Lokier To: Andi Kleen Cc: 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: <20030918153831.GA7548@mail.jlokier.co.uk> References: <20030917202100.GC4723@wotan.suse.de> <20030917211200.GA5997@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030917211200.GA5997@wotan.suse.de> User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1015 Lines: 25 Andi Kleen wrote: > I added a check for LDT entries now. This means prefetch exceptions > inside non standard code segments will be not handled (I will fix > that in a follow up patch) > + /* 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)". One way to add in the correct base would be to use the real segment register. Don't call __get_user: call your own special function which uses %gs, and temporarily load regs->xcs into %gs. Alternatively you can just calculate the base and add it. -- Jamie - 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/