From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77C68ECDE44 for ; Wed, 24 Oct 2018 19:01:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 22DB6207DD for ; Wed, 24 Oct 2018 19:01:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="XR2w3pRT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 22DB6207DD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727452AbeJYDbL (ORCPT ); Wed, 24 Oct 2018 23:31:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:48628 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727010AbeJYDbL (ORCPT ); Wed, 24 Oct 2018 23:31:11 -0400 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9B79D2083E for ; Wed, 24 Oct 2018 19:01:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540407716; bh=sfj+8vC2u6Lyt+aGG+gsemYrFWVJlZ/4gQs4hvBp0rg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=XR2w3pRTbPHP9niWGbciU4VYYHEJeniE01M06A6Zo+rNZ8kmNpbHVyelxASA3tqjQ 0tyVRZJmwoQyZTPYk5/u9aQkOdFpKiiGTWdXr2/MwszUteqCtN7gmO1tEb5SSUJApF cTQf+ZCf/rwqr8cwtEDD23ZyobvyEHLf7LNtLtxU= Received: by mail-wr1-f52.google.com with SMTP id w5-v6so6755389wrt.2 for ; Wed, 24 Oct 2018 12:01:56 -0700 (PDT) X-Gm-Message-State: AGRZ1gK7hA68rXZwpl8VUh4cYs1OkjBNAfbZlKwQlPi7rm+36Qql8JzX 5lLeLxQbMg3hOEBclBGj3251Fa02AlELhxNBUwJZFQ== X-Google-Smtp-Source: AJdET5foaZfDNc81G6KZ/8L5clR2Q7dy4FHqxGVn8T7AC4VXxLZPEN8TcGZt0pp8D6eeCXRPHV6uKpzjGUFvQK/JTUU= X-Received: by 2002:adf:b1db:: with SMTP id r27-v6mr1003633wra.95.1540407715056; Wed, 24 Oct 2018 12:01:55 -0700 (PDT) MIME-Version: 1.0 References: <1537312139-5580-1-git-send-email-chang.seok.bae@intel.com> <1537312139-5580-3-git-send-email-chang.seok.bae@intel.com> In-Reply-To: <1537312139-5580-3-git-send-email-chang.seok.bae@intel.com> From: Andy Lutomirski Date: Wed, 24 Oct 2018 12:01:43 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: [regression in -rc1] Re: [PATCH v6 2/8] x86/fsgsbase/64: Introduce FS/GS base helper functions To: "Bae, Chang Seok" Cc: Ingo Molnar , Thomas Gleixner , Andrew Lutomirski , "H. Peter Anvin" , Andi Kleen , Dave Hansen , "Metzger, Markus T" , "Ravi V. Shankar" , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 18, 2018 at 4:09 PM Chang S. Bae wrote: > > With new helpers, FS/GS base access is centralized. > Eventually, when FSGSBASE instruction enabled, it will > be faster. Sorry for not catching this during review, but: > +void x86_fsbase_write_cpu(unsigned long fsbase) > +{ > + /* > + * Set the selector to 0 as a notion, that the segment base is > + * overwritten, which will be checked for skipping the segment load > + * during context switch. > + */ > + loadseg(FS, 0); ^^^ what? > + wrmsrl(MSR_FS_BASE, fsbase); > +} I don't understand what the comment is trying to say, but the sole caller so far of this function is x86_gsbase_write_task(), and the code looks incorrect. Ingo, I think we need to address this during this merge window, probably by removing the comment and the loadseg() call (and the same for gsbase...inactive). But first, Chang, can you explain what exactly your intent is here?