From patchwork Sat Feb 18 21:14:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgecombe, Rick P" X-Patchwork-Id: 59004 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp555317wrn; Sat, 18 Feb 2023 13:20:49 -0800 (PST) X-Google-Smtp-Source: AK7set8Q0t1FlKYDxh+Kpx9m9T2n582qaq9sUnQjVoXVUNH6UzPB6SEhNK09y8/siOGhfFQ1chLS X-Received: by 2002:a17:903:41cd:b0:19a:c23c:37ff with SMTP id u13-20020a17090341cd00b0019ac23c37ffmr1043640ple.32.1676755249633; Sat, 18 Feb 2023 13:20:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676755249; cv=none; d=google.com; s=arc-20160816; b=ZRh86PrP8jKyYZ/2RzPCd4NNr9FddOLSNZOlmjCi6oH4rzEsHN23Vpuf+7NcgHDkqx 8nPRz0trwPJMniSqRc42Rb8X5Sr3dE60kyPrbUj0ZCZ9jdeSNSlIbHIYzEFyd8uOi/OD JUgNy/cuJvEEW2a2fJMPAMOfHDBq6KVWfggprtu9I+7h5A5pI2+HwhySygwnj4RqqQvD dtR49rZK+irebk7CyStetueRJO2Yl/9JJAOz5Wigw9uCwGwLKQ+hmtdhvakjHVHqvbZ/ RIqa/sWMy5s9+0L1YCXtmbNIe6a1/Us02lwpjLkO1gk9S4or+uU3DcWfN5BfnwCinZ+J R4TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=1K7hWixcu0DRP0TOxVYSNvsFGJbVf7pw+XfQxdSR7lc=; b=qqCv76f5SXQkeeMEFu2CYpQWIhQ4zc5rl0j6i9YJEy3QElfhe07jQ7AkqbQzo58fyQ MWyV1V9d2NZ1DNWTZGryz1OJff2r8GdOfvqrZF+y88A7nuIufP5hphbavEcPbUXgjKN5 UH3S8v83dHjMD+DVwy1OvWO2nTJH8qncqEO1CPuAYgxmz/ERYDMC2XUUfv4zB9utEwLB YhXprdWaC7N6qR1XTfgIjh7bNRfcTaHDSkUn840jz9cOUT2XnldWW6W63MmQblbfEvgN UyNxZTi7Ecaf+V3HGPRk092kasp9Y0qCJULUYdYOLC+DdvjSBXOI9CA6i97PnTv/NUnG h7oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CYQNe2Kj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iz5-20020a170902ef8500b0019a733b2ae9si3845055plb.561.2023.02.18.13.20.37; Sat, 18 Feb 2023 13:20:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CYQNe2Kj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229988AbjBRVUB (ORCPT + 99 others); Sat, 18 Feb 2023 16:20:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230128AbjBRVTH (ORCPT ); Sat, 18 Feb 2023 16:19:07 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1A151A67D; Sat, 18 Feb 2023 13:17:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676755035; x=1708291035; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=o/D1WjgTvHa+RZFY0t2cOsdLZJ4ujw/CAZDldCJEJW8=; b=CYQNe2Kj07Y4Vr6hAyjLj7UWnek7drWp/dDDSJlnMX+TDukBjZGm1b+U x/emMHTx7FYm0OQ/XprERdHEuZyjZAl3AqzqgNU9+bEPGD2L4VfGf41Lu /yltU/3e/u8S2xpv/+2Ab3Xzs5bsO8+YCzXKYxxsUovHlyKtVsDuD6E+4 mutJAnKeZlPhEPOGVkLuSJY18Dl/U1fsrNHK+LvxCqpbpg5PGNm3LK131 qEGRb1wGdPml70kb2dYejdLaQMpbRLyIAj1zG65GiuDXLRyAs89e6UOTW L0qmFRH67wOF1CIBi1y+1vdfariOehhoeExqC4czWaCp/d1z0Tj2AeC6P Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10625"; a="418427458" X-IronPort-AV: E=Sophos;i="5.97,309,1669104000"; d="scan'208";a="418427458" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2023 13:16:11 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10625"; a="664241653" X-IronPort-AV: E=Sophos;i="5.97,309,1669104000"; d="scan'208";a="664241653" Received: from adityava-mobl1.amr.corp.intel.com (HELO rpedgeco-desk.amr.corp.intel.com) ([10.209.80.223]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2023 13:16:10 -0800 From: Rick Edgecombe 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 , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H . J . Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , Weijiang Yang , "Kirill A . Shutemov" , John Allen , kcc@google.com, eranian@google.com, rppt@kernel.org, jamorris@linux.microsoft.com, dethoma@microsoft.com, akpm@linux-foundation.org, Andrew.Cooper3@citrix.com, christina.schimpe@intel.com, david@redhat.com, debug@rivosinc.com Cc: rick.p.edgecombe@intel.com, Yu-cheng Yu , Peter Xu Subject: [PATCH v6 17/41] mm: Move VM_UFFD_MINOR_BIT from 37 to 38 Date: Sat, 18 Feb 2023 13:14:09 -0800 Message-Id: <20230218211433.26859-18-rick.p.edgecombe@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230218211433.26859-1-rick.p.edgecombe@intel.com> References: <20230218211433.26859-1-rick.p.edgecombe@intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758205312542452854?= X-GMAIL-MSGID: =?utf-8?q?1758205312542452854?= From: Yu-cheng Yu The x86 Control-flow Enforcement Technology (CET) feature includes a new type of memory called shadow stack. This shadow stack memory has some unusual properties, which requires some core mm changes to function properly. Future patches will introduce a new VM flag VM_SHADOW_STACK that will be VM_HIGH_ARCH_BIT_5. VM_HIGH_ARCH_BIT_1 through VM_HIGH_ARCH_BIT_4 are bits 32-36, and bit 37 is the unrelated VM_UFFD_MINOR_BIT. For the sake of order, make all VM_HIGH_ARCH_BITs stay together by moving VM_UFFD_MINOR_BIT from 37 to 38. This will allow VM_SHADOW_STACK to be introduced as 37. Tested-by: Pengfei Xu Tested-by: John Allen Reviewed-by: Kees Cook Acked-by: Peter Xu Signed-off-by: Yu-cheng Yu Reviewed-by: Axel Rasmussen Signed-off-by: Rick Edgecombe Cc: Peter Xu Cc: Mike Kravetz --- include/linux/mm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 4650e2580d60..e6f1789c8e69 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -366,7 +366,7 @@ extern unsigned int kobjsize(const void *objp); #endif #ifdef CONFIG_HAVE_ARCH_USERFAULTFD_MINOR -# define VM_UFFD_MINOR_BIT 37 +# define VM_UFFD_MINOR_BIT 38 # define VM_UFFD_MINOR BIT(VM_UFFD_MINOR_BIT) /* UFFD minor faults */ #else /* !CONFIG_HAVE_ARCH_USERFAULTFD_MINOR */ # define VM_UFFD_MINOR VM_NONE