From nobody Fri Jan 9 09:08:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1766595866; cv=none; d=zohomail.com; s=zohoarc; b=C1Brw2r7SSDZHAdqwQIJxUiMEt7ga5keBd+Cgct5W6Ag/BTfoB95rXOZ4JPlFomMymVpTGj2EpwLpnTSRTk0vcJvdC+iIgbfGT3tkR86F5/YrdfQAftEtR6uOqp1eaSbV8ZlMkR8fzczY+0UtRI1SdQ67ZQef/r/S0UvJsjbXp4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1766595866; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xHV6F5htLdht8yZyJ/VwtJxiGcps1XdDoDnEGPAzWMU=; b=V6XCdSCu3DBhzxg28FgMOlqPU0aAb4ZBr/Zaw3FLxiM1PyNervY/FuFQNHszxTQNLzpxugkD973zuvTm86ntgF/aH8I0n6RWWI2zWeMA2M0mkwnJq1P6yve9FDaPPWWhR8w1/dtlwrEjHhr37jRtII9GLvjjoGWxhc0CMEuJm5E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1766595866129933.1127910408997; Wed, 24 Dec 2025 09:04:26 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1192964.1512085 (Exim 4.92) (envelope-from ) id 1vYSHC-0006Tm-UV; Wed, 24 Dec 2025 17:03:54 +0000 Received: by outflank-mailman (output) from mailman id 1192964.1512085; Wed, 24 Dec 2025 17:03:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vYSHC-0006TO-O8; Wed, 24 Dec 2025 17:03:54 +0000 Received: by outflank-mailman (input) for mailman id 1192964; Wed, 24 Dec 2025 17:03:52 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vYSHA-0003b7-BD for xen-devel@lists.xenproject.org; Wed, 24 Dec 2025 17:03:52 +0000 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [2a00:1450:4864:20::535]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 84fad15a-e0ea-11f0-9cce-f158ae23cfc8; Wed, 24 Dec 2025 18:03:50 +0100 (CET) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-64b7a38f07eso7666681a12.0 for ; Wed, 24 Dec 2025 09:03:50 -0800 (PST) Received: from fedora (user-109-243-71-38.play-internet.pl. [109.243.71.38]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8037ab7f7bsm1798927766b.18.2025.12.24.09.03.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Dec 2025 09:03:49 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 84fad15a-e0ea-11f0-9cce-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766595830; x=1767200630; darn=lists.xenproject.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=xHV6F5htLdht8yZyJ/VwtJxiGcps1XdDoDnEGPAzWMU=; b=VYo6zE9bFqe4p5SdBZZ5wLqzpeT98++7+dfo3SZStcT0P5PnWsoegw0dxpZwtmLGW+ 275CsL0O5VIdPqYHt4DKMRW/LFDBepqg+Rz9ZQvbP3FWI/d+CydD33IcHwtYfrFBeRsb hODY3nOlkLT2ES5/wDbSz8NqZjhwoGJH8XYSNRSDkUCdKJcTcYNxsydczEwKUa2dKvFy oK0KEWfzE28cowcAkYWLUqRP5L++VhpZl8iOOPhyTE2jtBJB+Oz26Z7prT6S3kUaYrm/ tMlt4iQ/BTzqA5L0Hk6Q5/jMvlZITDxA0jJW3lC6Qknb8OB9InCdZm5GgPUIW7pPBpNa NRXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766595830; x=1767200630; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=xHV6F5htLdht8yZyJ/VwtJxiGcps1XdDoDnEGPAzWMU=; b=Yu9e0h6S3P8n/tW0dDW2UHuH8j0RsqEw6Q8dSlisjpojbFN0B/MXI0VE3qLNdrxdK/ bT1UJnzGS2zi7lGI8Yt2uCgeYbwT3+mjhhbo/o5HAt0yDF5Ut84Am8qd65SlqGrzQOQ1 bfjU+4t3dEwHPO4M0GP1xox3YDH29NhXpgs0CpHEpzonlxfRNM6uFBwGuupfpF31BmPU hrVNxsF1oYO1/nnH9+yVH6GcjpibtUKBGveS1wYJg1UlJSjPnOwhitajI1+OPYUt3Tag SGMcHkkbmgrXjiP7Y7Mw51m3HafCywqpONbwkpUigmbgGQiFjgko4takBC+NfZ0hZ9jq n3jA== X-Gm-Message-State: AOJu0YyYDs1iC65wRuuWMD1OBTox8qGp2fd6xRpn3H2/73XSRmvgxtrR tvUHyEM3Z9HAqUuVBLhnmTwgfI5nyimkwAzc8EUsugaF98lZY5ZN3Sspy7mKzg== X-Gm-Gg: AY/fxX4mLv7aa6IXJlYQO2RF1df4gNxn8ROYo+YJajzEcF2iPSQYANAbI1z3FPOUSvS c30uPqdwt4atMeCRuTYI22RnmABCu1bJo/C38/0ksqxKA4FQdgf+2Q3f/CI38pySwyrksiv6i3/ hqKxElESUK76OHDftPuSBo9/KqZUzF5chPCAXTe0kyYWD0N+/yUor9uhT56xGenU/bcR+xRAyzg mjX0BILplc96V8FkgXMTtavCxVrNS6aZC1ksaNVYUd6vmVqvw26Khy7UJA3QycSZUDcyoAxcnm8 Y06hTmF5g6LvkRqKPsajVx/gaLAs7F4XRd4cle56qGq7O63NicKtz94Nz792WhvGrJ3oAst9TFM nisH4aRNyF+GoBDgfCviShEKHWPT9pyG2qYTubnLRXNj2uo1XpJDotOTBzMFoWvKWyqtmCegKsP 5NEM5Yj616T1+GvSHt2u+nXFA2yO/v+w1CsEauGaMH/Vd+yzbTUzOsjJo= X-Google-Smtp-Source: AGHT+IGCPZmbf6qTvckKYI4m1PncXD0B+3c5MgjqTyQZjgApVhhOZGr5y4+53c6unhHJQPTgfm0J4Q== X-Received: by 2002:a17:907:97c5:b0:b6d:3fc9:e60c with SMTP id a640c23a62f3a-b8036f10dc8mr1977178266b.20.1766595829888; Wed, 24 Dec 2025 09:03:49 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Alistair Francis , Bob Eshleman , Connor Davis , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [PATCH v1 14/15] xen/riscv: handle hypervisor timer interrupts Date: Wed, 24 Dec 2025 18:03:27 +0100 Message-ID: X-Mailer: git-send-email 2.52.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1766595867711158500 Content-Type: text/plain; charset="utf-8" Introduce timer_interrupt() to process IRQ_S_TIMER interrupts. The handler disables further timer interrupts by clearing SIE.STIE and raises TIMER_SOFTIRQ so the generic timer subsystem can perform its processing. Update do_trap() to dispatch IRQ_S_TIMER to this new handler. Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/traps.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c index e9c967786312..5fd12b1b21c3 100644 --- a/xen/arch/riscv/traps.c +++ b/xen/arch/riscv/traps.c @@ -10,6 +10,7 @@ #include #include #include +#include =20 #include #include @@ -108,6 +109,15 @@ static void do_unexpected_trap(const struct cpu_user_r= egs *regs) die(); } =20 +static void timer_interrupt(unsigned long cause) +{ + /* Disable the timer to avoid more interrupts */ + csr_clear(CSR_SIE, BIT(IRQ_S_TIMER, UL)); + + /* Signal the generic timer code to do its work */ + raise_softirq(TIMER_SOFTIRQ); +} + void do_trap(struct cpu_user_regs *cpu_regs) { register_t pc =3D cpu_regs->sepc; @@ -148,6 +158,10 @@ void do_trap(struct cpu_user_regs *cpu_regs) intc_handle_external_irqs(cpu_regs); break; =20 + case IRQ_S_TIMER: + timer_interrupt(cause); + break; + default: break; } --=20 2.52.0