Message ID | 20240125062739.1339782-7-debug@rivosinc.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D2ADC48260 for <linux-mm@archiver.kernel.org>; Thu, 25 Jan 2024 06:29:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B41216B008A; Thu, 25 Jan 2024 01:29:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AC9A86B008C; Thu, 25 Jan 2024 01:29:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F5476B0092; Thu, 25 Jan 2024 01:29:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 763C06B008A for <linux-mm@kvack.org>; Thu, 25 Jan 2024 01:29:00 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 37D94A21F3 for <linux-mm@kvack.org>; Thu, 25 Jan 2024 06:29:00 +0000 (UTC) X-FDA: 81716855640.03.A92BE6C Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by imf07.hostedemail.com (Postfix) with ESMTP id 6858D40011 for <linux-mm@kvack.org>; Thu, 25 Jan 2024 06:28:58 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=r0zcwiwN; dmarc=none; spf=pass (imf07.hostedemail.com: domain of debug@rivosinc.com designates 209.85.210.170 as permitted sender) smtp.mailfrom=debug@rivosinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706164138; a=rsa-sha256; cv=none; b=BtRAzhLR9BegsACA7xcFJ3Qg/0492LrpcBzk7fQtAI4dbWao709aORry0pLWbwtN5phl/G 1Vq8tuUtgCEs+e35mHTKl+RnyWOAyw2IJl1xBHQkrndTB2IBvPtAJqGgojhDCGAzLypVtt n0RC6KsYQiRMW7OO9KD13vdz/3zt8sw= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=r0zcwiwN; dmarc=none; spf=pass (imf07.hostedemail.com: domain of debug@rivosinc.com designates 209.85.210.170 as permitted sender) smtp.mailfrom=debug@rivosinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706164138; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=EvIQkZQQe0K7W+Tn30d/DsUxvdwzfahlImuX+CJcznc=; b=DANoE1bbWwxm5+x97mDgXtPC0KQwBt3q0Cf0Z1I+UZd85SXXbYFuvzoejth/r+UtKceWAX 3YtiIynGGS1myc8hawgTlw1Zpfr+TKJySmGV0cBvdXwKK/h/iFcq2HacPLzvzPmxiksRGa oy92NL8VLN3SI4uF8l0eX6mQ7Z9WtfY= Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6ddc1fad6ddso959248b3a.0 for <linux-mm@kvack.org>; Wed, 24 Jan 2024 22:28:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1706164137; x=1706768937; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EvIQkZQQe0K7W+Tn30d/DsUxvdwzfahlImuX+CJcznc=; b=r0zcwiwNgBUS2EbYzpTM1g9+C2cYZfGMTmPhN8B+/FJfLO3PyD9WgII+X0oTH1f5f/ f8SP6RhNEZiuoc7sjKIgocbB2ebqBAPNuo1dmS7Wwbtp/OX/ST6tgcrJtJpQR4LldoTj 6zC/B7XZHksToKcQvzTTdI4eB6ZODlp2rau789Ru2/9IQgbEs2ELlIB93anN6JWdIauk S735dmX3N0/Vgr2rB34eIYwVBdA3634bfBZMbYGHB5/Hf2987ikENZN0AQ7Cmv5IumLc H9iwEG8Qp/SGxZycwUvIuaTOKAXKJ/GTOvxFhPfj0OdAOUPGpZt4k5EnhJnb8YnkZSxm bX9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706164137; x=1706768937; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EvIQkZQQe0K7W+Tn30d/DsUxvdwzfahlImuX+CJcznc=; b=v99e3MfNER58myj87ptworySAqTs2QqvcwFpvSm80/5dtvYAb/Mq2tm6sHA+oiu7UF HhYYNh/l44caXwGjjrHa75ql+Js70yYT7pPbFKq0EFUn9kcrrOm9v84TeKAQu4yFB1FQ MDS5P3HcOL8OT6tSPOzaVXCK8g02wY7aWA/Q9c3WASNFukDv/cHzC4Fd7AJOeZNIpRwf QHRfbcYD0dIfUrsEaPJc9lxiW9gjZ+u8IxpL5zNYMWQsgsLF/3gpP/jqWi6FY4sNQmTd jgNW6LqKH3fxfHGW0FaLjOPWQIWmX2NJdtaJpcUe3QNy1AR+nrwyeszg+h9KNy34TcSf Ytjg== X-Gm-Message-State: AOJu0Yw3pwiFrAgrzHgLka97XnR2a6RGYjxblkR/GlSGpBQqxufqIv35 cBXsQ7/2SmcWkTcIO9cug+4bYjnORjqin+lKyxdtMpqceXYJ/9XkR/Li6rkPrfY= X-Google-Smtp-Source: AGHT+IG62+/0zfbVEYbfQN+QJI5rZ4lnUWc92boKfqE+8XigV4+ljqSZM4hwNuU+ih2eIoSJ6cAqUg== X-Received: by 2002:a05:6a00:2d12:b0:6dd:a004:c193 with SMTP id fa18-20020a056a002d1200b006dda004c193mr601959pfb.12.1706164137214; Wed, 24 Jan 2024 22:28:57 -0800 (PST) Received: from debug.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id t19-20020a056a00139300b006dd870b51b8sm3201139pfg.126.2024.01.24.22.28.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 22:28:56 -0800 (PST) From: debug@rivosinc.com To: rick.p.edgecombe@intel.com, broonie@kernel.org, Szabolcs.Nagy@arm.com, kito.cheng@sifive.com, keescook@chromium.org, ajones@ventanamicro.com, paul.walmsley@sifive.com, palmer@dabbelt.com, conor.dooley@microchip.com, cleger@rivosinc.com, atishp@atishpatra.org, alex@ghiti.fr, bjorn@rivosinc.com, alexghiti@rivosinc.com Cc: corbet@lwn.net, aou@eecs.berkeley.edu, oleg@redhat.com, akpm@linux-foundation.org, arnd@arndb.de, ebiederm@xmission.com, shuah@kernel.org, brauner@kernel.org, debug@rivosinc.com, guoren@kernel.org, samitolvanen@google.com, evan@rivosinc.com, xiao.w.wang@intel.com, apatel@ventanamicro.com, mchitale@ventanamicro.com, waylingii@gmail.com, greentime.hu@sifive.com, heiko@sntech.de, jszhang@kernel.org, shikemeng@huaweicloud.com, david@redhat.com, charlie@rivosinc.com, panqinglin2020@iscas.ac.cn, willy@infradead.org, vincent.chen@sifive.com, andy.chiu@sifive.com, gerg@kernel.org, jeeheng.sia@starfivetech.com, mason.huo@starfivetech.com, ancientmodern4@gmail.com, mathis.salmen@matsal.de, cuiyunhui@bytedance.com, bhe@redhat.com, chenjiahao16@huawei.com, ruscur@russell.cc, bgray@linux.ibm.com, alx@kernel.org, baruch@tkos.co.il, zhangqing@loongson.cn, catalin.marinas@arm.com, revest@chromium.org, josh@joshtriplett.org, joey.gouly@arm.com, shr@devkernel.io, omosnace@redhat.com, ojeda@kernel.org, jhubbard@nvidia.com, linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [RFC PATCH v1 06/28] riscv: zicfiss/zicfilp extension csr and bit definitions Date: Wed, 24 Jan 2024 22:21:31 -0800 Message-ID: <20240125062739.1339782-7-debug@rivosinc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240125062739.1339782-1-debug@rivosinc.com> References: <20240125062739.1339782-1-debug@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 6858D40011 X-Stat-Signature: yngtbpcnu8aaen47drf7x3djgm76jc96 X-HE-Tag: 1706164138-949730 X-HE-Meta: U2FsdGVkX1+g8z9y8u1F0gw61fLxaC1dK/yvTDgpc6WeOFnlH6SvYfvqZv0OzTksVFMUW6B8LVk6Y1eFWrAFrH5ch58E1hIVtRDaU1h3+rChRTPZnQGMclzVkUl7jBlZkOj3eeyXf1IfjrPRb90UerjKkpq5Zndrt9H8jSRgB6uqoGixzA7pM4b0xFfB5YMQxs7+M58Ys1NkXXwijp5tqRE0Mkv0BLutpoRuO+HY+GPodlsHmSDjtE0Xu3JL1ATlZRnV3shbC1HMTysRW7BqqrUY7nx1jXeLM3pJgQdPUGA9z4JCOx1eaotDmwrfUi8WlyNvidn4e29rqxkx07UhYkgMvM8N0HLnz/epBCrW0BgdWwjYnofoaZH2O46talF4eCZR8l9fy0VRm/wyJVSkr9ljZD1/WGUesaBFRzFKNlpqf8G+9NcWh2IXxs6pTsvoJhISHEUD1P0b/x+bjOTvrrbC3gOrsVBOUMd9Afk8WmXytdWsIxm/+iGio1xb2fDkhOGn3WJ0oe+5vkFKBKWJaQav8fYI99kQjXThaOv1sstq8qzt7qqXEZCu3Un35OzV0rNb3fkiDTlEJqAMXw1n7K2+rKWwhP4/3j50sq8UIZN9ssYi1E3NwMlVMCxdMhvmXNEOmkJ9JXsX+0wCOnQ/9NKi+ARXpKyZTi71/jTr7eewEex5gHK4RTOtf1Ov7g+3UjkXogFGx0iOragVcYufzO0qcm4pzm1LBhXZCGnuG+X4NebcQdMlhmEp2+uofScUttHTRg498fe9YEeEtBF1S6oKvRUwTbzybfwk4ExzP/H2ILWaMNvkrw4ooAqxlw+F+jcFajGbZyEHC8xb9vbZYR0Xlg7c2Q8wv66mzqt4SGxyUNgCSRHUx6J0WpAS0dM5KyVdbVyyHsgXRC17DjCRiRZuHtBxiJGhUmdop5DC0/DuyFA37aD5gEaNxBSpoIBjXd579UcaA0azjtKIxTS s+c/YWBb iKiM3pGqJkd+ZEDd5Lxu+DDEcQb/+4u3IeGsk5zFqAUtZjjIAOZNIIT02+O8zTDNV26/C8Zl3DsqvyRWDE09Lc9/o5xlu/IZv4CXpZLiLIWI5PwHl6ntzQ2AOu9Ii/0PEGsv45HcnYM+/Sxdl6x7PwjGEVqyxWfu1B4rJVTJSxgJQaB3L+gYTdfK6j61nV1kla53fXJJl83ZrCEHP2CBHGlgd+S3XcYE32kDuiKm0n4TQ2keqDjSesUnhVrJ3HmQ/9WJJ1SCCWMBMgL3MzRiA18rHRmVCfDuabvhH0VLsBH2FlooeSAKJ8eN5UJHpl0MiBaV7duWb56vsFbtY70t811bp4LpKaL/ZXggf4umjcFcpOBNWVVGHBAWcWSnaFSxM9bCUxyDhTwL8vfnWSJE3NKFCEui0UXEbMjQ8OVtVvTto0dSOnKWrBjz+AL0NhdarxMkb X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
riscv control-flow integrity for usermode
|
expand
|
diff --git a/arch/riscv/include/asm/csr.h b/arch/riscv/include/asm/csr.h index 01ba87954da2..80fe38d5de4a 100644 --- a/arch/riscv/include/asm/csr.h +++ b/arch/riscv/include/asm/csr.h @@ -18,6 +18,15 @@ #define SR_MPP _AC(0x00001800, UL) /* Previously Machine */ #define SR_SUM _AC(0x00040000, UL) /* Supervisor User Memory Access */ +/* zicfilp landing pad status bit */ +#define SR_SPELP _AC(0x00800000, UL) +#define SR_MPELP _AC(0x020000000000, UL) +#ifdef CONFIG_RISCV_M_MODE +#define SR_ELP SR_MPELP +#else +#define SR_ELP SR_SPELP +#endif + #define SR_FS _AC(0x00006000, UL) /* Floating-point Status */ #define SR_FS_OFF _AC(0x00000000, UL) #define SR_FS_INITIAL _AC(0x00002000, UL) @@ -196,6 +205,8 @@ #define ENVCFG_PBMTE (_AC(1, ULL) << 62) #define ENVCFG_CBZE (_AC(1, UL) << 7) #define ENVCFG_CBCFE (_AC(1, UL) << 6) +#define ENVCFG_LPE (_AC(1, UL) << 2) +#define ENVCFG_SSE (_AC(1, UL) << 3) #define ENVCFG_CBIE_SHIFT 4 #define ENVCFG_CBIE (_AC(0x3, UL) << ENVCFG_CBIE_SHIFT) #define ENVCFG_CBIE_ILL _AC(0x0, UL) @@ -216,6 +227,11 @@ #define SMSTATEEN0_HSENVCFG (_ULL(1) << SMSTATEEN0_HSENVCFG_SHIFT) #define SMSTATEEN0_SSTATEEN0_SHIFT 63 #define SMSTATEEN0_SSTATEEN0 (_ULL(1) << SMSTATEEN0_SSTATEEN0_SHIFT) +/* + * zicfiss user mode csr + * CSR_SSP holds current shadow stack pointer. + */ +#define CSR_SSP 0x011 /* symbolic CSR names: */ #define CSR_CYCLE 0xc00