From patchwork Thu Jan 19 21:22:52 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: 45990 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp555964wrn; Thu, 19 Jan 2023 13:35:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXt0QBfTgBJru9bTxjXoV5yj9+5dp4EVTrMWJxV+NkPjpptE/zd1cqcBTPXJrePDBuJDXGy0 X-Received: by 2002:a05:6a20:a598:b0:b3:ed81:9f58 with SMTP id bc24-20020a056a20a59800b000b3ed819f58mr13378218pzb.52.1674164139949; Thu, 19 Jan 2023 13:35:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674164139; cv=none; d=google.com; s=arc-20160816; b=Mo87/TKEYePUdZH0fMot1QBmpMK0+J0CkWLzMygAxpaV8GJL3CSV2YXb4LvXnVc002 vt7cJY+beui7+2Q5bsqv0tpY9hz03KfLqQhR8IhF1SjJAr4xMMvgqrB0Uf9yzLIQjUwp dyZf2+/AmY98Gu5zUufOT5+DzlvyNCMlUUv1jM8SLfYgQJHma6Io5ArcPJj6jZmVRWrv Xp5NshA0yLuGYVJH//1v9Z1q+vDm/QJyDrjuv5tVgahYhpR1cBdR7st9000Egob3DqBU mACUX+EfIdpexrqbVv32czdUOHszbM7k3Uec8FkuMERtM3rjYlVEQnTTEjgFaN7WFKn3 nW8w== 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=Cxz0RFzia4yt8BlCv7dHJItKc83W6pPpciB1MrUhgXc=; b=Sl+FVoCFWONSlRelTFZNv/Oq2eNIsbk8Ebd5fJifGyy6Uj90/YLA7+/Ug8fi9D3zK4 OncGd8wTfyehQlFhp34/W+rZKusfsrZAoNk349vgnOYG4I6513O20JAR7xZvFjATUSzQ UGltgin0eSeYC8UNfNP0SML490ZOwhmBb5o3wYsWM+Sp/IDlNOAaBSXC11GBKigTJHCF MqPwCoQFSsUhEPgonbkt03iYwcEQzNm1BnEwHTvOTJPPwWSmf7/pCVzoD/EKJRbuvXNq 6tZ2CVnz7kwF5SmXt+aeWfzES9U+OXDHo8oMw3kmpU1l1iTVg10GoZ5yP0ZRd8oRoZF4 YZgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WhE8+KXR; 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 c12-20020a631c0c000000b004b1eac7d37bsi35815124pgc.131.2023.01.19.13.35.28; Thu, 19 Jan 2023 13:35:39 -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=WhE8+KXR; 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 S230259AbjASVeQ (ORCPT + 99 others); Thu, 19 Jan 2023 16:34:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230381AbjASVb5 (ORCPT ); Thu, 19 Jan 2023 16:31:57 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08052A9580; Thu, 19 Jan 2023 13:26:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674163581; x=1705699581; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=i0EcBhWDxak7M9Yc3IVuRFqXYd9IgUPiDgl15diefTc=; b=WhE8+KXRZzLkYhRyBiIEwgz12qvjmpYj7S6svL+9/2diq8fFTsAOTfQf 55AzLxK3nGi5Qg/zt/Ef1LFs0S4XouQUzOdJzkdNmT5dh1R29nB8CG4rI NBOsWWfatqsNqfUT9gjeBjPi5L7CG1Rd5tCwC5SVJd9nSOXeMoz090JEO fufhhuWhcX7WfD3/WDzl8AXinHNtMW69yfK/gdolyN516zGoH+T+o6dXo 4qv6CqHikzyVvrAaH85AUEhze5sLvbfjBSdSfbxwqETyo4ePQjrL4JwAw DI6D8ZaW+xFbhV6mfs4TwEE9S4ZrlD69j0/3aR2NDdKE09I6XCD9/roVZ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="323119476" X-IronPort-AV: E=Sophos;i="5.97,230,1669104000"; d="scan'208";a="323119476" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2023 13:23:47 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="989139051" X-IronPort-AV: E=Sophos;i="5.97,230,1669104000"; d="scan'208";a="989139051" Received: from hossain3-mobl.amr.corp.intel.com (HELO rpedgeco-desk.amr.corp.intel.com) ([10.252.128.187]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2023 13:23:45 -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 Cc: rick.p.edgecombe@intel.com, Yu-cheng Yu , Peter Xu Subject: [PATCH v5 14/39] mm: Move VM_UFFD_MINOR_BIT from 37 to 38 Date: Thu, 19 Jan 2023 13:22:52 -0800 Message-Id: <20230119212317.8324-15-rick.p.edgecombe@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230119212317.8324-1-rick.p.edgecombe@intel.com> References: <20230119212317.8324-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?1755488336777698557?= X-GMAIL-MSGID: =?utf-8?q?1755488336777698557?= 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 7afc86d50442..82a9a4903651 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