Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp782996imm; Fri, 21 Sep 2018 08:13:35 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ28tx0RTvD3lh2Wxm6tSadn3QQMLhZOcvWi0ufQ3Nbu+SKz58jXQeZz6EQ5HAhs9Lmfn4h X-Received: by 2002:a17:902:9a83:: with SMTP id w3-v6mr46046797plp.75.1537542815503; Fri, 21 Sep 2018 08:13:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537542815; cv=none; d=google.com; s=arc-20160816; b=yFY+R6t7AWGtI/lAH196ydFXiYfalhgPUvLf/OTM33EiZTmGWWVM+wejz/GFD6Rwr7 CPuyZAqvbPHGH71HTSlmzf0hDjdkkX2yeXoHXT+vlKDDS3giKiEaEghCCJVP2pPPcTm8 SmVcfd5q/joGbHDAn/8MlQ+WIr78B/Dd7xQs1hoLIdfr/LR3IswJC0zZBSds9mAIw5Cf dgjhG9e4KOl6dWWFtaV5DoK/8lykPSRhLAmNKOKGHQuL/N3d+35rXPQL+6ZhlFPZCA73 aWzkyH7qQiGOxSF/gDkBxOi0TMy/Nh5w4bY7ohoJQZv+LZ7Cpf9BeguTODj9tqWAwobh Fe5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=g+8VbSksYbQBAeUV/pGpbdGejDXNcTltJ5zVBXaYRSU=; b=dW427V+rM/4iEWplhff7kofC3mgM/AT/LsMD+wmCTf8rpnqCnmzxqS7l5UchMhgNI6 INQlbR38Y9JK4rnu2nsKT7PyyAlcfav4qUMnu9wvuxZDaR+mi4xaNofODJ3pb8vrXxp+ lWQcCLtKSocfUT532Lb3y15H/Mo7M7BGThtisrkI/XbbBt3RC1ZZoFKY1VMbrVzd90eC woVrsik4G1CFJYYjD8h41XlV3oriBiLakhUNMPDIJAtiDfU2LcgqsAIyMvLP8RO2JKpI /br4uNt34YWJyI5gdSXwK3WwoYNt1wr6APFpwHQgcat5pnmtUhLpedksJ7+mwsCHxtFh pBdg== 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 u29-v6si26075634pga.29.2018.09.21.08.13.18; Fri, 21 Sep 2018 08:13:35 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390614AbeIUVBi (ORCPT + 99 others); Fri, 21 Sep 2018 17:01:38 -0400 Received: from mga07.intel.com ([134.134.136.100]:47290 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390383AbeIUU6I (ORCPT ); Fri, 21 Sep 2018 16:58:08 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Sep 2018 08:08:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,285,1534834800"; d="scan'208";a="71856552" Received: from 2b52.sc.intel.com ([143.183.136.51]) by fmsmga007.fm.intel.com with ESMTP; 21 Sep 2018 08:08:48 -0700 From: Yu-cheng Yu To: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Cyrill Gorcunov , Dave Hansen , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue Cc: Yu-cheng Yu Subject: [RFC PATCH v4 08/27] mm: Introduce VM_SHSTK for shadow stack memory Date: Fri, 21 Sep 2018 08:03:32 -0700 Message-Id: <20180921150351.20898-9-yu-cheng.yu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180921150351.20898-1-yu-cheng.yu@intel.com> References: <20180921150351.20898-1-yu-cheng.yu@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org VM_SHSTK indicates a shadow stack memory area. The shadow stack is implemented only for the 64-bit kernel. Signed-off-by: Yu-cheng Yu --- include/linux/mm.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index a61ebe8ad4ca..f40387ecd920 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -224,11 +224,13 @@ extern unsigned int kobjsize(const void *objp); #define VM_HIGH_ARCH_BIT_2 34 /* bit only usable on 64-bit architectures */ #define VM_HIGH_ARCH_BIT_3 35 /* bit only usable on 64-bit architectures */ #define VM_HIGH_ARCH_BIT_4 36 /* bit only usable on 64-bit architectures */ +#define VM_HIGH_ARCH_BIT_5 37 /* bit only usable on 64-bit architectures */ #define VM_HIGH_ARCH_0 BIT(VM_HIGH_ARCH_BIT_0) #define VM_HIGH_ARCH_1 BIT(VM_HIGH_ARCH_BIT_1) #define VM_HIGH_ARCH_2 BIT(VM_HIGH_ARCH_BIT_2) #define VM_HIGH_ARCH_3 BIT(VM_HIGH_ARCH_BIT_3) #define VM_HIGH_ARCH_4 BIT(VM_HIGH_ARCH_BIT_4) +#define VM_HIGH_ARCH_5 BIT(VM_HIGH_ARCH_BIT_5) #endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */ #ifdef CONFIG_ARCH_HAS_PKEYS @@ -266,6 +268,12 @@ extern unsigned int kobjsize(const void *objp); # define VM_MPX VM_NONE #endif +#ifdef CONFIG_X86_INTEL_SHADOW_STACK_USER +# define VM_SHSTK VM_HIGH_ARCH_5 +#else +# define VM_SHSTK VM_NONE +#endif + #ifndef VM_GROWSUP # define VM_GROWSUP VM_NONE #endif -- 2.17.1