From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756654AbbDJUqM (ORCPT ); Fri, 10 Apr 2015 16:46:12 -0400 Received: from mga01.intel.com ([192.55.52.88]:5520 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754994AbbDJUqI (ORCPT ); Fri, 10 Apr 2015 16:46:08 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,558,1422950400"; d="scan'208";a="554299884" Date: Fri, 10 Apr 2015 13:46:07 -0700 From: Andi Kleen To: Andy Lutomirski Cc: Andi Kleen , X86 ML , Andrew Lutomirski , "linux-kernel@vger.kernel.org" , Borislav Petkov Subject: Re: [PATCH 7/8] x86: Add documentation for rd/wr fs/gs base Message-ID: <20150410204607.GT15335@tassilo.jf.intel.com> References: <1428681033-1549-1-git-send-email-andi@firstfloor.org> <1428681033-1549-8-git-send-email-andi@firstfloor.org> <20150410202249.GR15335@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > If user code programs fs != 0 and fsbase != whatever is implied by fs > and the GDT/LDT, what happens? We load the value from the LDT/GDT. > There's already a minor buglet in that > area without wrfsbase, but fixing it would be a big performance hit > because we don't have rdfsbase and rdgsbase to read the state > efficiently. (Specifically, if we have gs == 0, gsbase == 0, but > *saved* gsbase != 0, then we corrupt gsbase on context switch.) > > But, with the new instructions, we can do it simply, efficiently, and > correctly in all cases. Let's do so. We would need an instruction to write the index without changing the base. That's not what the new instructions do. -Andi -- ak@linux.intel.com -- Speaking for myself only