Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 13 Feb 2003 22:57:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 13 Feb 2003 22:57:22 -0500 Received: from tenor.CodeGen.COM ([204.62.145.147]:57100 "EHLO tenor.codegen.com") by vger.kernel.org with ESMTP id ; Thu, 13 Feb 2003 22:57:20 -0500 Message-Id: <200302140407.h1E477oP041875@tenor.codegen.com> To: Peter Tattam cc: linux-kernel@vger.kernel.org, discuss@x86-64.org Subject: Re: [discuss] Re: [Bug 350] New: i386 context switch very slow compared to 2.4 due to wrmsr (performance) Organization: CodeGen, Inc., San Francisco, CA In-reply-to: Your message of Fri, 14 Feb 2003 13:01:30 +1100. Date: Thu, 13 Feb 2003 20:07:07 -0800 From: "Thomas J. Merritt" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2537 Lines: 52 |<><><><><> Original message from Peter Tattam <><><><><> |On Thu, 13 Feb 2003, Eric Northup wrote: | |> On Thursday 13 February 2003 07:14 pm, Peter Tattam wrote: |> > On Thu, 13 Feb 2003, Andi Kleen wrote: |> > > [Hmm, this is becomming a FAQ] |> > > |> > > > Switching in and out of long mode is evil enough that I don't think it |> > > > is worth it. And encouraging people to write good JIT compiling |> > > |> > > Forget it. It is completely undefined in the architecture what happens |> > > then. You'll lose interrupts and everything. Nothing for an operating |> > > system intended to be stable. |> > > |> > > I have no plans at all to even think about it for Linux/x86-64. |> [snip] |> > |> > The only other unknown quantity is the time it takes for the CPU to |> > enable/disable long mode, but with modern CPU speeds, the interrupt latency |> > may only be mildy affect by such a process, unless the CPU is broken in |> > some way. I see no discussion in the AMD manuals regarding the cost of the |> > mode switch, only what AMD engineers have hinted at. |> |> I think the real issue is that AMD neither recommends nor supports this |> strategy. ( http://www.x86-64.org/lists/discuss/msg02964.html ... there were | |> better posts but I couldn't find them) People with real hardware can't talk |> about it right now, but it seems to me this is just begging to get hit by |> errata -- how much effore do you think team Hammer spent testing a subtle |> mode transition which is marked "Don't do that!" ? |> | |well, I guess AMD need to come out & explicitly state this somewhere other than |on a mailing list. I wouldn't be only one tempted to see if it can be done, |and if it becomes "necessary" for some OSes, AMD will get locked into a |backward compatibility minefield. Anyone know what Windows 64 does about this |issue? If Microsoft considers that it is sufficient to warp the CPU for v86 |emulation, it may just be a done deal. The only way to get from long-mode back to legacy-mode is to reset the processor. It can be done in software but you will likely lose interrupts. Attempting to switch out of long-mode by modifying EFER will just get you a #GP fault. You might want to read Volume 2 section 14.6.2. TJ Merritt tjm@codegen.com 1-925-462-4300 x115 - 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/