From nobody Sat Feb 7 23:24:34 2026 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 419EF301489 for ; Thu, 22 Jan 2026 02:39:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769049546; cv=none; b=bAhoAwUUuh5fz/I8ddkbj+MxU9FdTukjRzWfyMaLZ7IFbieNNrJye22idaIms6e9qe7jV6yWI1UPZQnC6xHWlEkwUEszPE7GERIp2xdMaZysTRJXCphnR3iUPrNI1yfnFZOhxUMA59CK9OEwhRRj+rP/juL3aYmb36X/uLSfX7o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769049546; c=relaxed/simple; bh=1XMP0IfBdfF5Bm2el3/2Y4sZnmPUXu0z4DzbLos0y7g=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=sNVahxQ+DmNhlO2m6EAwi2iysnHmONaaNk4v2t+IOjO3wDH3K1zPkcIK0BjHz/vsJxM4wW6adnhzP824gwpHZa21Mil+eVqJDVOaztEiNDFYLgfJ5UUVgGCwNhjAbxuKb3T7h7zJCD4BfspfdJQnGrTNigVSmG2Ngxgee1dqV3c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MmOiqAKZ; arc=none smtp.client-ip=209.85.216.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MmOiqAKZ" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-352f00d0e83so243324a91.2 for ; Wed, 21 Jan 2026 18:39:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769049541; x=1769654341; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=v084SR4XwOmmqxRC5THZforzHquboYBfTr+cYOzRODw=; b=MmOiqAKZcmtdTMqJ8pKgU27rsohVvLseef9WAZEFiKqRUuRcRm2qyb+CBRfwfwNFhr EtEGIBDnL8vWhAcWZPR+D609eoJpce+7d3+XwUOv1fNJxRfiHGknD3utHsnZ8obYbrSh MzvSRXj1L2lPYa9gddzPiEQTMaH3Bi5oWhPamtSXhoWHGGB6t/fMdqhs8uIyOy0E4OLo m+mTB/4uTsGshr9Wac5XqTlCl0rBde4D9tdU0DxgkZPKeLnfYe50EwAsBRi7y6ENAAHe lTSiCeRopEAkwcK/+cVNhZiRpoBltr761R3OwQJlEF41ZJUu00HHkaYI1QNrcHLQXL/S wRUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769049541; x=1769654341; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=v084SR4XwOmmqxRC5THZforzHquboYBfTr+cYOzRODw=; b=sR8zWZBgSbByGiA3nqJtx3shLj3YaOmpx49lMYJlNi3k8KzIhPCXecmNe938VZXqhl FmjwttRXtPI9SBI+A3JbAuDsVWuFqj1lZmWut4hccO37G2fBO9x4CuRYSQQH6V5jon9r BHo+9kaIPPLpEjiBTAHswn67J5DtHeP0o+Aed56m8Gp65I852fbhayDQVK8oYj9YpdpN ceT6yjH+AWWQBkjNzqHD3shm5hmHtc5Q9QGdWDSPdNvlYNwOUZOHN9VpyFabyWopMGJ2 GWQmUr+ipxcA32mUoky75MnoBJrQ0KrPYA7n+h9s3cQwakcb0l3syLER8HwXn3inFj5o ILBQ== X-Gm-Message-State: AOJu0YzJsxWV2FmqFJgJuezgxN5qT6kjbhUbQwgRzKLHgOhVOueb0ozS 0312SIN30zEwGKQmCxkjN7z8raseLubcuyJWHr6r8D04ZzPEcD5i+FTn X-Gm-Gg: AZuq6aKhBY9n+UfVlGF+3TfUIyqlQK+5fjc8N3JRfzAbgHjb0A/B9vJbCcNat/U79KE wTV/iBy/CCQS0AcJrPbT4S1k8RnVyjFKfZlTP56albkxoYMnNiL2UVIhunufr2TgScy+sGADxzn h9gok2qk5geTswWOpi4ctiWqEMBa3tMHHEITLaVGGJOjKHisle+tiOavoNrEXhhud9l/XYmAk5y Z44SnwWmcK1tvD/oWUKwDT9WlfxOsyvXRAlWvIN9fZ13cC2YXr6zf9sEaxZg32kbT/5GNgLKh5E e8WI8HHoGPUtYW3QkGAs1FMJ3cwk0XXUF9ryUJjGgDoxCihQ/POH6Kvi/d5A4ForGGmDrud9o/d AEOphxK6vO8P551wyIurk5OCsDUHaDG/vSUOnpDT5fgFuH5Y3lhSFAbWbOdNU1A4yzj84zvvgbD viynEU/uTKnIrt5dbjkvpowhqyQY4= X-Received: by 2002:a17:90b:2b4d:b0:32e:6fae:ba52 with SMTP id 98e67ed59e1d1-352c3e56b82mr6006512a91.6.1769049541212; Wed, 21 Jan 2026 18:39:01 -0800 (PST) Received: from adminpc-PowerEdge-R7525 ([27.122.242.81]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c5edf130f1csm15841091a12.0.2026.01.21.18.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jan 2026 18:39:00 -0800 (PST) Date: Thu, 22 Jan 2026 11:38:56 +0900 From: Austin Kim To: Paul Walmsley , Palmer Dabbelt , Alexandre Ghiti , Albert Ou Cc: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, austindh.kim@gmail.com Subject: [PATCH] riscv: Add macros for software check and hardware error exception codes Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The latest RISC-V Privileged specification defines new synchronous exception codes in the scause register: 18: Software check 19: Hardware error Link: https://docs.riscv.org/reference/isa/priv/supervisor.html - 12.1.8. Supervisor Cause (scause) Register Add these macros for future use. Signed-off-by: Austin Kim --- arch/riscv/include/asm/csr.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/riscv/include/asm/csr.h b/arch/riscv/include/asm/csr.h index 4a37a9839..5ea875813 100644 --- a/arch/riscv/include/asm/csr.h +++ b/arch/riscv/include/asm/csr.h @@ -108,6 +108,8 @@ #define EXC_INST_PAGE_FAULT 12 #define EXC_LOAD_PAGE_FAULT 13 #define EXC_STORE_PAGE_FAULT 15 +#define EXC_SOFTWARE_CHECK 18 +#define EXC_HARDWARE_ERROR 19 #define EXC_INST_GUEST_PAGE_FAULT 20 #define EXC_LOAD_GUEST_PAGE_FAULT 21 #define EXC_VIRTUAL_INST_FAULT 22 --=20 2.34.1