From patchwork Thu Jun 7 14:38:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu-cheng Yu X-Patchwork-Id: 10452325 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9BB0A60146 for ; Thu, 7 Jun 2018 14:42:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BC87294DB for ; Thu, 7 Jun 2018 14:42:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8096129508; Thu, 7 Jun 2018 14:42:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20F94294DB for ; Thu, 7 Jun 2018 14:42:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2A6776B0008; Thu, 7 Jun 2018 10:42:32 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 12A826B0296; Thu, 7 Jun 2018 10:42:32 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D83716B0293; Thu, 7 Jun 2018 10:42:31 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f197.google.com (mail-pf0-f197.google.com [209.85.192.197]) by kanga.kvack.org (Postfix) with ESMTP id 896B66B0291 for ; Thu, 7 Jun 2018 10:42:31 -0400 (EDT) Received: by mail-pf0-f197.google.com with SMTP id p29-v6so4668481pfi.19 for ; Thu, 07 Jun 2018 07:42:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=KfKcgW2UQWgHEN482vbTcUqEanEfKEbmjeagJ6HIEDw=; b=W+pKfuKpAEdubJpINnb17AoDCxgNCU1CeHizt2hRkDrp1ma42rhWcJMI3KTJRWr+IZ uOB/Kgh1roHCKbRfpaHEGBCs7IcbG9eY9KZ0hGsSn4erVY9dv8ZlAYX/yBfF27qVmimp 6feoZgj00RDFPfX2cLpoCYhFb33Mn0JqpxEha2kWAud3ZKsnoBWIwdW8scwUQZgidwEY VseYnY84vPFtRaNAv/PhqSCGXkaaLHXhVIJL0GyRiaK3b0ILyG3SdrDqUe4NdabT/3Oh XWxL37EtSVxKMF9VAIJhTZcI7fYttqwgnGZGDKHCP0xMpF1SrbumWhuUD9PoxS7GPwrO MouA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of yu-cheng.yu@intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=yu-cheng.yu@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Gm-Message-State: APt69E3k/NIfBeB2XiSSHwhdGgXPh/4HalJTipfXuoJnI6sdt8i9URBI ue/rrIgGLXwFouR53ATlkfkZ4gs0tFhjshHA9aJwCveMyxCP1hFxroXjJtH6okfLpXiIzgcVW9X QZiMQw45nuTDzT61J4CCPz2IS0m0OtcdMHplPNK/WepgF5+7O4Sze4bseckkiHGuBOA== X-Received: by 2002:a65:5844:: with SMTP id s4-v6mr1850155pgr.417.1528382551241; Thu, 07 Jun 2018 07:42:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJDgX6cnvJDq7Ix/0DbHcg0bUS6vpg5NxZdyw/G+ukm+HJD15rTxSD2Gs9ToyuUXjwLk4s7 X-Received: by 2002:a65:5844:: with SMTP id s4-v6mr1850119pgr.417.1528382550566; Thu, 07 Jun 2018 07:42:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528382550; cv=none; d=google.com; s=arc-20160816; b=ffSGJ34iHFxrnEOD9zlt6lQChKHSFc0HK9rZaVT3wuzJkDx6JvSGjg1cx8js7VphKA XtfxL0TtOHNeJ/jlqm+z2sMS+WiHVm2Rm7xsPOgiAWZ2kRwijPVoSFjNHneqsERapV7T ppqNxSgvi4Jp0byenwdL/Xqyjk1/89E95Gxh89xuIqpeOH1zIJGSmd71FNG1Jxt8fx0X FkTO4Y02DUKcAt1M7cKfxXVFABlQYzg8E3FrcRaBErVviMa+l7IQpDUafb/4ao0z+IoS CZ+VUsV2HqM5jvUyiOn+qyCLNZmUYMGnJIdcC/C3Xsg4c2Gk8DPp85hwab4ji3zUjYvy HSag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=KfKcgW2UQWgHEN482vbTcUqEanEfKEbmjeagJ6HIEDw=; b=GShW+6A1FZKD2UedlcAOaLWJS9PFhqCMmew0hkNsuj11SlAQrbHnKac/KS7uF4ffZa 5/XhorY9KccawSk0U40JLKaS28o9rErNCQ3rOxN408qg1zAr9uOMzb1c/TSr8eIntzOX lmbZZFwiwWWFd8vYWCFF1I2mT/0kN0BwjKuJB/EFJODQwX6NTliIIdgCi0bUiSWY03EF F7Ohw7IJYrvUDLkhXH+E3GClrziir3+BnZcOsApLABPPtNWm4+VB3r1BDn6DA521ZkPn klJ4bV+4ZxHL0q7iwDyBrFiGV9TkffTC2dtDvnM5cBBnJWczJ3ILwv5KPgWHe5edW3CP spUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of yu-cheng.yu@intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=yu-cheng.yu@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga03.intel.com (mga03.intel.com. [134.134.136.65]) by mx.google.com with ESMTPS id l22-v6si26243115pgu.353.2018.06.07.07.42.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 07:42:30 -0700 (PDT) Received-SPF: pass (google.com: domain of yu-cheng.yu@intel.com designates 134.134.136.65 as permitted sender) client-ip=134.134.136.65; Authentication-Results: mx.google.com; spf=pass (google.com: domain of yu-cheng.yu@intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=yu-cheng.yu@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jun 2018 07:42:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,486,1520924400"; d="scan'208";a="235505938" Received: from 2b52.sc.intel.com ([143.183.136.51]) by fmsmga006.fm.intel.com with ESMTP; 07 Jun 2018 07:42:29 -0700 From: Yu-cheng Yu To: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , "H.J. Lu" , Vedvyas Shanbhogue , "Ravi V. Shankar" , Dave Hansen , Andy Lutomirski , Jonathan Corbet , Oleg Nesterov , Arnd Bergmann , Mike Kravetz Cc: Yu-cheng Yu Subject: [PATCH 1/7] x86/cet: Add Kconfig option for user-mode Indirect Branch Tracking Date: Thu, 7 Jun 2018 07:38:49 -0700 Message-Id: <20180607143855.3681-2-yu-cheng.yu@intel.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180607143855.3681-1-yu-cheng.yu@intel.com> References: <20180607143855.3681-1-yu-cheng.yu@intel.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The user-mode indirect branch tracking support is done mostly by GCC to insert ENDBR64/ENDBR32 instructions at branch targets. The kernel provides CPUID enumeration, feature MSR setup and the allocation of legacy bitmap. Signed-off-by: Yu-cheng Yu --- arch/x86/Kconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 24339a5299da..27bfbd137fbe 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1953,6 +1953,18 @@ config X86_INTEL_SHADOW_STACK_USER If unsure, say y. +config X86_INTEL_BRANCH_TRACKING_USER + prompt "Intel Indirect Branch Tracking for user-mode" + def_bool n + depends on CPU_SUP_INTEL && X86_64 + select X86_INTEL_CET + select ARCH_HAS_PROGRAM_PROPERTIES + ---help--- + Indirect Branch Tracking provides hardware protection against return-/jmp- + oriented programing attacks. + + If unsure, say y + config EFI bool "EFI runtime service support" depends on ACPI