Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757622AbcCUW6B (ORCPT ); Mon, 21 Mar 2016 18:58:01 -0400 Received: from mail-oi0-f47.google.com ([209.85.218.47]:33216 "EHLO mail-oi0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755683AbcCUW6A (ORCPT ); Mon, 21 Mar 2016 18:58:00 -0400 MIME-Version: 1.0 In-Reply-To: <20160321225248.GI5083@two.firstfloor.org> References: <1458576969-13309-1-git-send-email-andi@firstfloor.org> <20160321190322.GZ5083@two.firstfloor.org> <20160321194027.GB5083@two.firstfloor.org> <20160321221148.GF5083@two.firstfloor.org> <20160321224152.GH5083@two.firstfloor.org> <20160321225248.GI5083@two.firstfloor.org> From: Andy Lutomirski Date: Mon, 21 Mar 2016 15:57:40 -0700 Message-ID: Subject: Re: Updated version of RD/WR FS/GS BASE patchkit To: Andi Kleen Cc: X86 ML , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1146 Lines: 38 On Mon, Mar 21, 2016 at 3:52 PM, Andi Kleen wrote: >> No. My objection is that there needs to be an explicit statement what >> the semantics are. If the agreed-upon semantics are "undefined >> behavior if GS != 0 and GSBASE doesn't match the descriptor", so be >> it, but this needs to be a conscious decision and needs to be weighed >> against the alternatives. > > Documentation/x86/fsgs.txt already has this statement: > >>>> > Another requirement is that the FS or GS selector has to be zero > (is normally true unless changed explicitly). When it is non-zero > the context switch assumes the bases were loaded through the LDT/GDT, > and will reload that. > <<< > > Is that sufficient? > Maybe. Are there better options? Could we, for example, actually try to preserve the state if this happens? Would it be worth it? >> >> The actual implementation details are just details. They need to >> match the intended semantics, of course. > > I believe my implementation matches the paragraph above. > > -Andi > > -- > ak@linux.intel.com -- Speaking for myself only. -- Andy Lutomirski AMA Capital Management, LLC