Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp909266ima; Fri, 1 Feb 2019 12:58:01 -0800 (PST) X-Google-Smtp-Source: AHgI3IbP1coGSO9Ey3d+ivTppPDIs+4C7xMjBOjZDQ2BTA7R0+STe+JD3qMo1X3TYZWmiMo8rbOF X-Received: by 2002:aa7:868f:: with SMTP id d15mr15192658pfo.225.1549054681428; Fri, 01 Feb 2019 12:58:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549054681; cv=none; d=google.com; s=arc-20160816; b=tTC8ul1/w9O5yo5MgIpR2DPU7P1kVXD73QlOdr8ghlKEg1+TAXJ4XIS/2FwRBDUKww 9fiGAFwVaaCZo8deUY4YhLBRhtK1nkJNfpwkUUmYTSqEEmZBNzmS4vAJh2hBEgKy7oE2 L0IG8orFy1rCqINvjVPCesgbutK9Dvt9B22jv5x9y+7QHqxPwznGn/qO6NsUkAasmh+r FD+9H1R0ekarNvvPJUhCqztc6ZVSvS71Xxepp3yvqRSxGz5vLbHfVCzNvSTE632LfBFB K9VahaG4H9J7OzKiWGWP83ZeeTH7dpvawktnC7ZotoKQ6/uTHL/4QlGTq4E2hmW6JQ4r gyaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=uWfnpvzukOXaJjcqNmlbQBvHbV8aNoQUvrHQbyy6wWI=; b=sLNFwYzZsGOjhIaNhoycf2VSdrocqWisisPW/t1VnmsojOL6pOOofy7/6K+v9hT9SL rlqOxmBoCr8J1ubUIloiMV/oyYWW+VfxdWzLggf/kO9mDFdacbRp87VMHF8HOykyu1CJ q9JS3scQ3mxI8E5O/CFyEZeKB1cDGIWFn8eQXhkXPY3xIkqZqyk/FnFPh/YAmCRoQD3n Blztiy3bllEN+L0eVxPGy7zRvDFulH6fSe8mUEQ07zV1N6P68PudIvQgSn7UqfMtiI38 9BQ9KeTcNjNXFI/EaRePCGTO8/Sw7jJgfqhwFJia7IEQ0Rgu0quj7VK5X3hy8sDAOhuI bpIw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si8151929pgd.567.2019.02.01.12.57.46; Fri, 01 Feb 2019 12:58:01 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726825AbfBAUya (ORCPT + 99 others); Fri, 1 Feb 2019 15:54:30 -0500 Received: from mga07.intel.com ([134.134.136.100]:49718 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726506AbfBAUya (ORCPT ); Fri, 1 Feb 2019 15:54:30 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Feb 2019 12:54:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,549,1539673200"; d="scan'208";a="140866293" Received: from chang-linux-2.sc.intel.com ([10.3.52.165]) by fmsmga004.fm.intel.com with ESMTP; 01 Feb 2019 12:54:29 -0800 From: "Chang S. Bae" To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Andi Kleen Cc: Markus T Metzger , Ravi Shankar , "Chang S . Bae" , LKML Subject: [PATCH v5 00/13] x86: Enable FSGSBASE instructions Date: Fri, 1 Feb 2019 12:53:05 -0800 Message-Id: <20190201205319.15995-1-chang.seok.bae@intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org update from v4 [4]: * Remove the FSGSBASE assembly macros Update from v3 [3]: * Raise minimum binutils requirement to use the new instructions directly * Optimize FIND_PERCPU_BASE macro * Rename some helper functions, __{rd,wr}gsbase_inactive() * Use NOKPROBE_SYMBOL instead of __kprobes * Rebase on top of the helper function fix [6] Update from v2 [2]: * Separate out the preparatory patches [5] (merged as of now) * Bisect the paranoid_entry update patch * Edit minor nits Updates from v1 [1]: * Update the GSBASE update mechanism on the paranoid entry/exit. * Exclude ptracer backward compatibility patches. * Include FSGSBASE documentation and enumerating capability for user space * Add the TAINT_INSECURE flag. [1] Version 1: https://lore.kernel.org/patchwork/cover/934843 [2] Version 2: https://lore.kernel.org/patchwork/cover/912063 [3] Version 3: https://lore.kernel.org/patchwork/cover/1002725 [4] Version 4: https://lore.kernel.org/patchwork/cover/1032799 [5] https://lore.kernel.org/patchwork/cover/988180 [6] https://lore.kernel.org/patchwork/patch/1017513 Andi Kleen (3): x86/fsgsbase/64: Add intrinsics for FSGSBASE instructions x86/elf: Enumerate kernel FSGSBASE capability in AT_HWCAP2 x86/fsgsbase/64: Add documentation for FSGSBASE Andy Lutomirski (4): x86/fsgsbase/64: Add 'unsafe_fsgsbase' to enable CR4.FSGSBASE x86/fsgsbase/64: Preserve FS/GS state in __switch_to() if FSGSBASE is on selftests/x86/fsgsbase: Test WRGSBASE x86/fsgsbase/64: Enable FSGSBASE by default and add a chicken bit Chang S. Bae (6): taint: Introduce a new taint flag (insecure) kbuild: Raise the minimum required binutils version to 2.21 x86/fsgsbase/64: Enable FSGSBASE instructions in the helper functions x86/fsgsbase/64: When copying a thread, use the FSGSBASE instructions if available x86/fsgsbase/64: Introduce the FIND_PERCPU_BASE macro x86/fsgsbase/64: Use the per-CPU base as GSBASE at the paranoid_entry .../admin-guide/kernel-parameters.txt | 2 + Documentation/process/changes.rst | 6 +- Documentation/sysctl/kernel.txt | 1 + Documentation/x86/fsgs.txt | 104 +++++++++++++++++ arch/x86/entry/entry_64.S | 71 +++++++++--- arch/x86/include/asm/fsgsbase.h | 100 ++++++++++++++-- arch/x86/include/asm/inst.h | 15 +++ arch/x86/include/uapi/asm/hwcap2.h | 3 + arch/x86/kernel/cpu/common.c | 22 ++++ arch/x86/kernel/process_64.c | 108 ++++++++++++++++-- include/linux/kernel.h | 3 +- kernel/panic.c | 1 + tools/testing/selftests/x86/fsgsbase.c | 102 ++++++++++++++++- 13 files changed, 497 insertions(+), 41 deletions(-) create mode 100644 Documentation/x86/fsgs.txt -- 2.19.1