From patchwork Sat Feb 3 00:04:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 196097 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp767776dyc; Fri, 2 Feb 2024 16:06:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IGUtcuxLbFbcErlNkwvS3H0hcp0mLzduR2jfmx8j1dm26w+IoswbO3caVkdLJnxnBGrUCu0 X-Received: by 2002:a17:902:a387:b0:1d9:435b:a6f3 with SMTP id x7-20020a170902a38700b001d9435ba6f3mr168624pla.26.1706918802054; Fri, 02 Feb 2024 16:06:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706918802; cv=pass; d=google.com; s=arc-20160816; b=qUGUTa0C77eaBqTLKl70qPyPfjOQT8NXpWKBhfR4moI7XWu+sHa/7N3DrhrpaLBYIi kRyRPmMoHaAgysAbRwkDRnFWtNSVBuJ6KRl1880oNAjFU0FNffUpzBe/H6kCMs6cHxJU r4puvwmCtqA8e8G7eejX0OEArxEjAGzFezjcW1h25YMxFG8rbgLhRr9cmw9Hdb7etP/0 TpZS8KMAZjDLDrdrVq6HLnqD9iG2sQMIJP4NcwZsiIw5ThzidX4Ern6s95XJDpLx14uq 74t7PA6gfAjW584+Q7syVYVjK2oCEp0j8TEOkE/B+ssoode1uCxiUVw9zYFfDQ+iGV5i hAhQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=VIviiWLj30ZrQSwedCiUOrNlfExcTLxcukEkZwTYEWM=; fh=lPPIfIsiN/TVdwNhFXhfFCmEulRW43jLg46UfEFGbmA=; b=nHYJZhjOHNZAPp62sk3CHywC813ZQ+7f7EOpY13ZMF9Du8kGCqhDSUc2zm7KsAftgm Df87xrFARIhc75LXfzHuFebL1aCm0UBlgUDp8mydQpL1RMtHaVNh9H0Ul3jtY5VS4wyU RkxF0gjm9YxcaK/AUog/P8trExVUMyBp7mhfakNxM2IgPC1slF1tWLAZyaNdUT0feLPm u3RZ3nJlipqyL0/Z5VU7sMXUvfnHXKXNBkYys/cQ4RAlX34vzpZDxXy16tHfcl13z4kd uCpWrAGGT4d1scHCkXc/uRmdxE9n9Rasy3YBpE2fNSvpNFd0uAuseHJVE/lfqTJTDuCs KDQw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FvjfNJJC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50741-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50741-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCVuMzD28Bs2ffISQct24ara0dU1VUL2uYpHIIMOt5rcPUJKU3SZn++DCrR/yABgwmC6xIzGtvBIYr01Lz+y704t08kSRQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d5-20020a170902b70500b001d930ef5c1csi2426184pls.47.2024.02.02.16.06.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 16:06:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50741-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FvjfNJJC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50741-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50741-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CE9AB28AF33 for ; Sat, 3 Feb 2024 00:06:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0E7CB6FBE; Sat, 3 Feb 2024 00:05:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FvjfNJJC" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 526DE6FAD; Sat, 3 Feb 2024 00:05:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706918743; cv=none; b=NnJIAnU7BQyPDvbfcAa6IJrHVOslv8BAbIBWezyOx9/m/ipSXdo6P4CD2tHZdnMrHW7MBxKtkJiR28p6sFRdAH22yILmb3siFzVPKfQOhkVFmhnsyE4sxMUNLYvlYQmRaqT7CnQ7kPbNobLV+LXYed4kZAY59vu73cZWbQ/shuQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706918743; c=relaxed/simple; bh=kiK765H9QFvcPD51NDMimYIoE+CAz43kont3MOS2Ik4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TWQtvxp5/XlatL5F8sAcqJa8mXAZtvepQ90x3BHdot4ZqPZM0nE/XrXRWdL804oKRDwM6djfCoe9n5k2qeZm9UawhZooUohXFL9solBBwdIyGPKOmxnUR/7rs5n6Acj2afzqQwhlVfadfJQcglZmdTuB8tHpwvxGaZdx6GeqqGs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FvjfNJJC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FC7BC43394; Sat, 3 Feb 2024 00:05:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706918742; bh=kiK765H9QFvcPD51NDMimYIoE+CAz43kont3MOS2Ik4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=FvjfNJJC6wgrEPZLZSwTVk0ET1J7SKuJvQvF5GDxDbmYKyChIkB8ymouFyiymLkI9 X/owQnCAjnUc4VHI/ma1JXnlVHAbxCLDStdlMLVKfctz0xvYgYXDXcxQriO+1jGrpj pu8wBs+Xva+81RL/HCsD3jrb6VgJQyFnorhJr2CwQn1TZHhjS480rhX9KQzqGfEa1e C8nC5PHeOsHm1AX/s1HYJ5J4RoiDgcFTeTlYCDO67rieMulRmvT5NQrojOLyUvyYE5 t1JB7ozzM0Ii09hFjUFclDNHRQ/3clwsjnvOWsUZkkSNvEqZsiUeTksns2dNqcoiuA 2onigevkxHXBQ== From: Mark Brown Date: Sat, 03 Feb 2024 00:04:59 +0000 Subject: [PATCH RFT v5 3/7] mm: Introduce ARCH_HAS_USER_SHADOW_STACK Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240203-clone3-shadow-stack-v5-3-322c69598e4b@kernel.org> References: <20240203-clone3-shadow-stack-v5-0-322c69598e4b@kernel.org> In-Reply-To: <20240203-clone3-shadow-stack-v5-0-322c69598e4b@kernel.org> To: "Rick P. Edgecombe" , Deepak Gupta , Szabolcs Nagy , "H.J. Lu" , Florian Weimer , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Christian Brauner , Shuah Khan Cc: linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Kees Cook , jannh@google.com, bsegall@google.com, linux-kselftest@vger.kernel.org, linux-api@vger.kernel.org, Mark Brown , David Hildenbrand X-Mailer: b4 0.13-dev-a684c X-Developer-Signature: v=1; a=openpgp-sha256; l=2344; i=broonie@kernel.org; h=from:subject:message-id; bh=kiK765H9QFvcPD51NDMimYIoE+CAz43kont3MOS2Ik4=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBlvYM6UvdX1xy39P6Ycpi5xqxlbO/j3vEL7OV15CBs w656sDeJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZb2DOgAKCRAk1otyXVSH0J7YB/ 9jR2meWiqMNmTde6tFYxtIM7l52JWZsu1IZdPUbTKAJQS0NnGcrqxkEQjDA8nn2vLD9h78yX3JAa+h po/CqlJ9GD6TXa4uOwbojPl/j3iSOelQFjJtlLw+zwDWRbR94YUpfNf68MLbfIKvcKbGOWIt/qd5cf WmfeeUTbbDFr1JL44Tk7MrDzG7XVFQKEi0HfQL9bW2wrmr1mKJ//a6XEevdWmGUk3YMJc0P8NS8l8K ceNjmQisd2pMYDjwBDlsHg9hgdCs8lZ8mzHzqArsSGz2g7sRNf51LaDbJWbag7xjYgu9UTC0KTICn1 s5vZjVItqQ8P/YOK3KRvImN5Dnr67B X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789834089749609361 X-GMAIL-MSGID: 1789834089749609361 Since multiple architectures have support for shadow stacks and we need to select support for this feature in several places in the generic code provide a generic config option that the architectures can select. Suggested-by: David Hildenbrand Acked-by: David Hildenbrand Signed-off-by: Mark Brown Reviewed-by: Rick Edgecombe Reviewed-by: Deepak Gupta