Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3213748img; Mon, 25 Mar 2019 06:08:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxoniw+7kYz6CG4JRhH+4rMwe4wqe4EcVC8VXB5pHjIpeNl/94W/kW96StqlfNaeXyFbY7l X-Received: by 2002:a17:902:f084:: with SMTP id go4mr25405052plb.15.1553519303371; Mon, 25 Mar 2019 06:08:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553519303; cv=none; d=google.com; s=arc-20160816; b=jZvM8OjMuG7ESMCQ5Pip6ykT5bBCsT2BCZgCp6wYRDCXZjsmXJUMqV3bLQZiwYH1a1 OmXLMGmUcCHs9rgDeSzDRzpvMZzNuuEL/agyqwKebQX35losTt4a1j6g8FqVwetMiI16 bHyvkQFz+6lawczH0rKQUCOUyeJw8EzIbGfZ0TaZwrMhWhb3cCAvQ+xTdCmGwNhmT67r PqvSrvdCwUL3qlO22pRqu7U65fH9PMnMueQk0pMiCjL6y9Dgc+8iILW+djd/sL6AWQIO 5FeFqlTHc3Zl9YITSseX4cdgRHmc33aX69QrB3cdmPZJXd+MXSyPHGOmmfA1WQ2khzCT NdaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=r3JeA3sJwKbdKe8YMTK2R18qL5PPjx5lQvvZhhRiIp4=; b=SwaD8zUd4t6XGCWPSOZWAB0Lucsb+Ea3IAk5VO8Fn7GM4SNPm0s4kAa8oYOAJB5ALo +TkcU9uO4CYq1FnS+DwwNSFr1yiYckWgqQa0TR0pVfSbRpUdfyt2MLWhGvs+fGJELl29 CqECsM5AGM/5q+Drc3GgQepwiI1vjMLzNOzUP6YfHbXJ55RdomUApo4lVQP+dWsXF7sV giiX+G20tvrlc1dzWLDg4o5JviK3kJMOx5ituKK3H2h9qXCSHOdQiZ62NCE76Al4PcuO OupapLc9tXKNZHH71W4iA4AvTX8bnU+MIqDEg5nn6+Y68epRp40mD+J7uMrCV2TQlm28 IpPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m15si13788016pls.433.2019.03.25.06.08.08; Mon, 25 Mar 2019 06:08:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731302AbfCYNFy (ORCPT + 99 others); Mon, 25 Mar 2019 09:05:54 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:45796 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731076AbfCYNFy (ORCPT ); Mon, 25 Mar 2019 09:05:54 -0400 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1h8PIK-0004fJ-Sv; Mon, 25 Mar 2019 14:05:41 +0100 Date: Mon, 25 Mar 2019 14:05:40 +0100 (CET) From: Thomas Gleixner To: "Chang S. Bae" cc: Ingo Molnar , Andy Lutomirski , "H . Peter Anvin" , Andi Kleen , Ravi Shankar , LKML , Andrew Cooper , x86@kernel.org Subject: Re: [RESEND PATCH v6 04/12] x86/fsgsbase/64: Enable FSGSBASE instructions in the helper functions In-Reply-To: Message-ID: References: <1552680405-5265-1-git-send-email-chang.seok.bae@intel.com> <1552680405-5265-5-git-send-email-chang.seok.bae@intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 25 Mar 2019, Thomas Gleixner wrote: > On Mon, 25 Mar 2019, Thomas Gleixner wrote: > > The whole point of FSGSBASE support is performance, right? > > > > So can please someone explain why having the following in the context > > switch path when it can be completely avoided is enhancing performance: > > > > - 4 x SWAPGS > > - 1 x RDMSR > > - 1 x WRMSR > > Corrrecting myself. That should be: > > RDGSBASE > WRGSBASE > > obviously. Still the point remains. > > > - 2 x local_irq_save() > > - 2 x local_irq_restore() > > > > Of course the local_irq_save/restore() pairs are utterly pointless because > > switch_to() runs with interrupts disabled already. > > > > SWAPGS instead needs: > > > > 1 x WRMSR > > > > and nothing else. > > > > So trading the single WRMSR against the above in the context switch path is > > gaining performance, right? And even IF the sequences are faster than the single WRMSR, this does not justify the mixed bag of SWAPGS/FSGSBASE usage at all. Thanks, tglx