From nobody Sun Dec 14 11:18:36 2025 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 11043315D4C; Thu, 11 Dec 2025 17:21:06 +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=1765473667; cv=none; b=o9Cf9XEEgsVJTAAbwEy+XvPyuku5uN0JmHRBgmRQKJlkseJWZeTU+1/xYgMsHXz1ZqRJxxhwQL4oXFcPjmEQ6A2RMeG4FLw0M+kJO2yK+YkfTKfSK0Q7L97tnZ2zH627cjWe6iL6vGntbV8zHTfLuhbo5G+OBtg9bOXy5/6uOF4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765473667; c=relaxed/simple; bh=s9Nd8OrIdmTzTe15BEE4fAoU+yUwpq+wRGim3URhRCA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=T02lCeUjhEM0Dy29M2F5Ea5UV+/DBy63RtZ8uH6dR/Qcov+IiDnESyhIYPeNl3i2wTWc2njpVMyb6nVfqem8tr5rDZ4MxMoCx7PsJKrPRMdAgZ0JdWHl6nrW/goZT1bGHBdGefZ37ALAVjq39/CP7t6YdtM1e6G0n89vL9vPMTw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EQyS+uV0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EQyS+uV0" Received: by smtp.kernel.org (Postfix) with ESMTPS id 6E041C19422; Thu, 11 Dec 2025 17:21:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1765473666; bh=s9Nd8OrIdmTzTe15BEE4fAoU+yUwpq+wRGim3URhRCA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=EQyS+uV0U+SCI3XKmW5ij21lzLSY5/r6FFdHK6UdNPWASDaVW7X6vqQy8UFzq7obp xNquXMSvaGbYh+O1Y1QHlYjFVXEVzi/KAT5FtYIO2rbGMIPMDkmOrXouZDFnL2XDQ1 /Pc5oqCur4NqxRbepSYsRcW+7uGBQt6UuIqJQC/H8/7DWCYrdXzeRGz1D2A0ssrDjB Mwr/6tG4ESESK1COpL7kDvI0bKB0+/9jQxFkmlmnbZS2WGk5p5epcH4ik/LdphIQkY e4BIlP9Vd9pTuhZDTsVevQIemhh/kABtvpqK/OKY4M1vzcxnvOtcxh4IG7rYjssZ+U N+TLwFIChvTMw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 522F8D41D6B; Thu, 11 Dec 2025 17:21:06 +0000 (UTC) From: Deepak Gupta via B4 Relay Date: Thu, 11 Dec 2025 09:20:34 -0800 Subject: [PATCH v26 01/28] mm: VM_SHADOW_STACK definition for riscv Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251211-v5_user_cfi_series-v26-1-f0f419e81ac0@rivosinc.com> References: <20251211-v5_user_cfi_series-v26-0-f0f419e81ac0@rivosinc.com> In-Reply-To: <20251211-v5_user_cfi_series-v26-0-f0f419e81ac0@rivosinc.com> To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andrew Morton , "Liam R. Howlett" , Vlastimil Babka , Lorenzo Stoakes , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Arnd Bergmann , Christian Brauner , Peter Zijlstra , Oleg Nesterov , Eric Biederman , Kees Cook , Jonathan Corbet , Shuah Khan , Jann Horn , Conor Dooley , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Andreas Hindborg , Alice Ryhl , Trevor Gross , Benno Lossin Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, alistair.francis@wdc.com, richard.henderson@linaro.org, jim.shu@sifive.com, andybnac@gmail.com, kito.cheng@sifive.com, charlie@rivosinc.com, atishp@rivosinc.com, evan@rivosinc.com, cleger@rivosinc.com, alexghiti@rivosinc.com, samitolvanen@google.com, broonie@kernel.org, rick.p.edgecombe@intel.com, rust-for-linux@vger.kernel.org, Zong Li , David Hildenbrand , Andreas Korb , Valentin Haudiquet , Deepak Gupta X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765473664; l=941; i=debug@rivosinc.com; s=20251023; h=from:subject:message-id; bh=DXRwVlzwdoQZD1P4AgHLEInq/8iOZjrgGgTHzLAJMYU=; b=0Dv74hXBGeBWjfcrTvnDOWwPkPd9Di2kldY2KrnrI7XBDo3LnCyqAM/EE3wTg03KyqefMIxt7 jB5QQy+W8tED+wmP1c2WDSx9gEcyu7GDFvkzXMucAUjsZp+DrZPXcOM X-Developer-Key: i=debug@rivosinc.com; a=ed25519; pk=O37GQv1thBhZToXyQKdecPDhtWVbEDRQ0RIndijvpjk= X-Endpoint-Received: by B4 Relay for debug@rivosinc.com/20251023 with auth_id=553 X-Original-From: Deepak Gupta Reply-To: debug@rivosinc.com From: Deepak Gupta VM_HIGH_ARCH_5 is used for riscv Reviewed-by: Zong Li Reviewed-by: Alexandre Ghiti Acked-by: David Hildenbrand Tested-by: Andreas Korb Tested-by: Valentin Haudiquet Signed-off-by: Deepak Gupta --- include/linux/mm.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index d16b33bacc32..2032d3f195f1 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -380,6 +380,13 @@ extern unsigned int kobjsize(const void *objp); # define VM_SHADOW_STACK VM_HIGH_ARCH_6 #endif =20 +#if defined(CONFIG_RISCV_USER_CFI) +/* + * Following x86 and picking up the same bitpos. + */ +# define VM_SHADOW_STACK VM_HIGH_ARCH_5 +#endif + #ifndef VM_SHADOW_STACK # define VM_SHADOW_STACK VM_NONE #endif --=20 2.43.0