From patchwork Mon Feb 27 22:29:33 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: 62164 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2682681wrd; Mon, 27 Feb 2023 14:34:31 -0800 (PST) X-Google-Smtp-Source: AK7set9tl6tzeoHfSpvS2vRvX+oTp1Wi1ByjghU2525LoOTcVykQphHJxUAHALg0RTG3sm0P/DDE X-Received: by 2002:a17:906:b4f:b0:860:c12c:14f9 with SMTP id v15-20020a1709060b4f00b00860c12c14f9mr275674ejg.40.1677537271729; Mon, 27 Feb 2023 14:34:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677537271; cv=none; d=google.com; s=arc-20160816; b=HmKudB4SzO6buzGqdNen0yHZhb7f1Tl79EA9gaku4o8/46rLkmKUUKJLiufBDrdfqM /jJHmvPiVXwA6Cn/78jwrTGa3WTeZ4Rzy6XEe19MBFAwjuGBTsl/630Z5DRumUWJMRmY +MYO2Zg2vh2R6CpsIS7Ge/BJXkMN98WobwuZe7kzVOo037kUC0UzZVEf6R1sGPXu7PtV sbY8U4B+QXFey7UBJOt7ZAFtWPX6+SUIJZz1yU4FegONVxkNNU2eBQTzTQl1BAmXlxlj ssC9PKy8EqqhonxMF/50Sq0U73SYZyhS8Q3yZhhjCAmb9IcwrkpzWN5aXKeiwFqM4OUi V+OQ== 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=/86SfoVQQ8nfu81V3XQo7ipVqL9sa+8xwOyr++XyGK4=; b=l7zq/pfj09dgihWI8iaErUvzq06imRPoQ6Q53s2bEPj2BpS5EL5rNulBAeUKWpXW9U bkYglRINMCtvRLEoNaMMzZ03//D+UcgxZt24x2NpcV4st2IwvB0TV74NMz3YWd9hw6Uk ELk7VjL3VKKkqRdvNFRjUJtD5ztlz35rdC2Q9GgHYvKNffwzQ2tXguca46GbPJ3kQlFt UQBYc6Fxk5F20spb+p8chyHTwcUP5aLK7F6idwc523eyt53ZCI/8scEdBkaw9i1aNXdk 3F/mJbeNbO9rnJLQ13IdPHzCZbVXnb5DiV6PhFkbcn8semjzDGUBHa3jKsG2dRidUMim igKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OoTfc6kd; 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 n22-20020a17090695d600b008ccc0fd3d13si795608ejy.348.2023.02.27.14.34.06; Mon, 27 Feb 2023 14:34:31 -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=OoTfc6kd; 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 S230401AbjB0Wcv (ORCPT + 99 others); Mon, 27 Feb 2023 17:32:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230256AbjB0Wbs (ORCPT ); Mon, 27 Feb 2023 17:31:48 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80D5529E2B; Mon, 27 Feb 2023 14:31:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677537104; x=1709073104; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=CMdfKd48MBBKKroi4bf9lEd66dWh8s6uGF9cifN2Nfs=; b=OoTfc6kdYcKTX4knrc6BeGGYIVKneFnoZmufcJoFBVejcoaZHi8sOKpb FTv4cmyawN2pYlVKiuRX7Mn6SXhCIcve99Z/UOyoyGnORMrHjAjWzmicY 9X1dPyQbBgpVneRQ0GGZjVytsys0k5EOQJyfduign+gdoOKjyQLfN28D1 UUasJGKRLTHsNdJGyYoUQ9sfQmH9L1egr8LBWoY09FlgmacmK/Iyg5sLj +j6ZON/LYcAIpEe+eRQc2h1WTv5yfgjn+PkXLJjr40UMeyHI6wjmIAbx/ jEwstLPEjN+TfX0Z2xhVMsy2h0qdEjtVygfNmM2qls3pL+rJuxwLK5sl0 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10634"; a="313657425" X-IronPort-AV: E=Sophos;i="5.98,220,1673942400"; d="scan'208";a="313657425" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2023 14:31:23 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10634"; a="848024589" X-IronPort-AV: E=Sophos;i="5.98,220,1673942400"; d="scan'208";a="848024589" Received: from leonqu-mobl1.amr.corp.intel.com (HELO rpedgeco-desk.amr.corp.intel.com) ([10.209.72.19]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2023 14:31:19 -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 v7 17/41] mm: Move VM_UFFD_MINOR_BIT from 37 to 38 Date: Mon, 27 Feb 2023 14:29:33 -0800 Message-Id: <20230227222957.24501-18-rick.p.edgecombe@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230227222957.24501-1-rick.p.edgecombe@intel.com> References: <20230227222957.24501-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_PASS,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?1759025321794858485?= X-GMAIL-MSGID: =?utf-8?q?1759025321794858485?= 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 Tested-by: Kees Cook Acked-by: Mike Rapoport (IBM) 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 af652444fbba..a1b31caae013 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -377,7 +377,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