From patchwork Sun Jul 21 07:05:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Raphael Tiovalen X-Patchwork-Id: 1962858 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=QqSXZlhR; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=c88oP783; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WRZGK2ZZTz1xrQ for ; Sun, 21 Jul 2024 17:06:49 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zddro/WZHx/BaI62je1E6TZ0lg4vQwzOiSW9lsLVnr4=; b=QqSXZlhRFp5WQs bn+xikCuLwrDB0dpaHajd6V2WeIvZOzrHGhh+L7wLyAvghplyJnGrAI2GUpw0wHZHj/yUOlPYcyIq XLtGExhifm1zhTKNhXV+eGMwxxWt53S86AX7Cu98nG0zJozkOkbLugbfvi4LgrIadvulKYXEyHQ+j JcC+yUZmPkyMIwl4K5C7015A6R0Xv/Lljd2j/fkmiBzHVi9s+fognIg3jJ6RMl4F3AuY5mL99hsXF zYgTDGwQ2sdclj7nLcuQY58HhVHLC9i2zuki7PSz3WaLoWcK1biw3n+WApgvSXCTQLLhZFm7+4l8z lmSeql2sDaDWLjLuxykg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sVQee-00000006LzA-0cRd; Sun, 21 Jul 2024 07:06:48 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sVQea-00000006LxQ-1S9a for kvm-riscv@lists.infradead.org; Sun, 21 Jul 2024 07:06:46 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-70d1c8d7d95so151563b3a.2 for ; Sun, 21 Jul 2024 00:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721545603; x=1722150403; darn=lists.infradead.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=YOqEXJYpkIexGhOwSJXzU52SvIkIRl2QtZdZCBi6Nm8=; b=c88oP783+V9HNpi+OhBrdXMJ6qpUb0Mhi8qWWdlihFS0ohc4ZzoH9jTJqfQTTmuwPY YvGuvDxMXrGCCD8pMB0JPprGkhbdotDkXEjcg8CGCLpY15hyvg0M5oGuXB0DPAoQe9F+ 0J/Znfollkke/7FpOdllz/2HYVm/N/gXUzEGiDvlZzrSZIdwdRgeb3GRAhCf70xg0djb oMKSZ7d3Dbs2f6PqzlejBqsJeHRKk+PprO12DicPzhppkE0SjkifyKwJ4psEJb6Gf9Jt 3c1BPFQs0x8OOhV7sI23YK52oDe0GzbKKi+dEwhwGzIYPTkj1NMSDyfv3mWXYlogzsyb e+Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721545603; x=1722150403; 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=YOqEXJYpkIexGhOwSJXzU52SvIkIRl2QtZdZCBi6Nm8=; b=o/45qYWoPkBQXqgPqmJb3TXJHA0Rmbp6X7v7lUkDHBFZpC1T/iJm7eJdV2zC/XqY31 R4lOEBZvZUBWLIyt43qMA2Vf8HwJDRg7VkJdnv+NCF3WCaQFjzsXdIJZ8zagLZTqDKWb IyHyunL1ncIiPN4QmPCZJi3cNxVhDJzoElxMT76QXtarfFylGGRho6+9fbgTH2fxJZ2w II+/GutFB90GpxUXfgBGv2KU5eybTQ1zPG3p+CAVBHDm5QaFfA5xHPI6KXwfTJ6jRqtt qWjZqZ6fliowEcO6tylet805cUOrU777BZi4PFQFJIU0oL7MXGGomirQSO3TNLgIUC94 Ktdw== X-Forwarded-Encrypted: i=1; AJvYcCWG+/yYp19Ag+dQVoGVdaLcU/otDauvnD1VqGP+q9N492bZNh1HQ2/VnTb3Nn7GDf3BrJzQKM61wwpbT8b7cBnbQO0o1jPJamYWZE+3ag== X-Gm-Message-State: AOJu0YyatdBDzSr17tlVFesw83MUe0w0Tcm4WlgdTo50Fiwp7Q3sM2rA m4IMl2TY8bGPeIFTtJ41zVzXtaig06bG9Je4TRxrt3ZhLJmhm/3/ X-Google-Smtp-Source: AGHT+IE3oS77IFsILowoEEOxHGX2hEBQPecGS32oyXyjCa+VZh+RcoTDPe3ttc2tgNOV3HU0a/svFA== X-Received: by 2002:a05:6a20:12cb:b0:1c3:b0d6:e496 with SMTP id adf61e73a8af0-1c4285ef1c1mr2301170637.45.1721545573585; Sun, 21 Jul 2024 00:06:13 -0700 (PDT) Received: from JRT-PC.. ([180.255.73.78]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2cb77492bc6sm4891461a91.1.2024.07.21.00.06.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jul 2024 00:06:13 -0700 (PDT) From: James Raphael Tiovalen To: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Cc: andrew.jones@linux.dev, atishp@rivosinc.com, cade.richard@berkeley.edu, James Raphael Tiovalen Subject: [kvm-unit-tests PATCH v4 2/5] riscv: Update exception cause list Date: Sun, 21 Jul 2024 15:05:57 +0800 Message-ID: <20240721070601.88639-3-jamestiotio@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240721070601.88639-1-jamestiotio@gmail.com> References: <20240721070601.88639-1-jamestiotio@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240721_000644_389799_258012A6 X-CRM114-Status: UNSURE ( 9.89 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Update the list of exception and interrupt causes to follow the latest RISC-V privileged ISA specification (version 20240411 section 18.6.1). Reviewed-by: Andrew Jones Signed-off-by: James Raphael Tiovalen --- lib/riscv/asm/csr.h | 10 ++++++++++ lib/riscv/asm/processor.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [jamestiotio(at)gmail.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:433 listed in] [list.dnswl.org] X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Update the list of exception and interrupt causes to follow the latest RISC-V privileged ISA specification (version 20240411 section 18.6.1). Reviewed-by: Andrew Jones Signed-off-by: James Raphael Tiovalen --- lib/riscv/asm/csr.h | 10 ++++++++++ lib/riscv/asm/processor.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/riscv/asm/csr.h b/lib/riscv/asm/csr.h index d6909d93..ba810c9f 100644 --- a/lib/riscv/asm/csr.h +++ b/lib/riscv/asm/csr.h @@ -36,6 +36,16 @@ #define EXC_VIRTUAL_INST_FAULT 22 #define EXC_STORE_GUEST_PAGE_FAULT 23 +/* Interrupt causes */ +#define IRQ_S_SOFT 1 +#define IRQ_VS_SOFT 2 +#define IRQ_S_TIMER 5 +#define IRQ_VS_TIMER 6 +#define IRQ_S_EXT 9 +#define IRQ_VS_EXT 10 +#define IRQ_S_GEXT 12 +#define IRQ_PMU_OVF 13 + #ifndef __ASSEMBLY__ #define csr_swap(csr, val) \ diff --git a/lib/riscv/asm/processor.h b/lib/riscv/asm/processor.h index 6451adb5..4c9ad968 100644 --- a/lib/riscv/asm/processor.h +++ b/lib/riscv/asm/processor.h @@ -4,7 +4,7 @@ #include #include -#define EXCEPTION_CAUSE_MAX 16 +#define EXCEPTION_CAUSE_MAX 24 #define INTERRUPT_CAUSE_MAX 16 typedef void (*exception_fn)(struct pt_regs *);