From nobody Tue Mar 3 04:56:07 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; 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=1772106727; cv=none; d=zohomail.com; s=zohoarc; b=GwC0d5mVPNVTVECe2la1w46AKaMXVELQVjCdjYRdKEiYUjAKDW2TBMWKqiM32VPSAPp1+AkOQUWYJAmqtSnzV3u+NV7FYQGUcUINy5toiQcN0dq0L5KQanlMdEzRHGzanhW1kkEgGglYzZGGyYDukj7x6I6wy/DHQYBvltbRjSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772106727; 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=ZhCTeImiDeyxrLk5y++AZ4LSK5JxMOQ72SQ4iMIQuPE=; b=HlDKR6tUr7TjqTZapHPo0m5Dm9DQUOZCIVovR5Uyd1uKKMVosVlLCOXUfkEgagY8uQRGzSb3m7bsMIEfgWPMT7PyPdaVDanmMA7Y8u1APIHjgARadUUKkwmg+q4zb8OE9TPr/cWunYA6rwmUxMlzkQxYxpbihs1Bn+UMBnc2Tsg= 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 1772106727926811.6236256856338; Thu, 26 Feb 2026 03:52:07 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1241468.1542590 (Exim 4.92) (envelope-from ) id 1vvZuB-0000hs-S6; Thu, 26 Feb 2026 11:51:43 +0000 Received: by outflank-mailman (output) from mailman id 1241468.1542590; Thu, 26 Feb 2026 11:51:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vvZuB-0000go-MK; Thu, 26 Feb 2026 11:51:43 +0000 Received: by outflank-mailman (input) for mailman id 1241468; Thu, 26 Feb 2026 11:51:42 +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 1vvZuA-0006EH-Gy for xen-devel@lists.xenproject.org; Thu, 26 Feb 2026 11:51:42 +0000 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [2a00:1450:4864:20::32c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 83963750-1309-11f1-9ccf-f158ae23cfc8; Thu, 26 Feb 2026 12:51:41 +0100 (CET) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4806cc07ce7so9144315e9.1 for ; Thu, 26 Feb 2026 03:51:41 -0800 (PST) Received: from fedora (user-109-243-67-101.play-internet.pl. [109.243.67.101]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd68826asm220079295e9.0.2026.02.26.03.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 03:51:39 -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: 83963750-1309-11f1-9ccf-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772106700; x=1772711500; 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=ZhCTeImiDeyxrLk5y++AZ4LSK5JxMOQ72SQ4iMIQuPE=; b=F/EEqUfcybXwb2hgT9H4Ld3nXSWhkvMO1Gi6J75HHGasOF/Ut4Vgg4GRqnxWFUGpu3 tMeOeQbRKLNkjWUvTccYmosum6x9fmyBwj93MsvnqS5SxMmcbvoyPzT0SW80M6PAXD4L tzb50ckOPqe0A8YR1JSRMiuk0o7a87W0riqn7KrDAFwmIJJ/nAzMmqxeakN3cA2nfgRj if1/92uW283t3oKwCsK2ACFGSPZpb0tPjZ2dardPrSwk4HRl1pN1m2vn+Pr+orgzG4iy Dy36eUGbge3Sb/83DQdfaJK/l2QNc19IwBGlud7E/JYdXvqSzbc6br2tgW3ik24hl22+ XODg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772106700; x=1772711500; 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=ZhCTeImiDeyxrLk5y++AZ4LSK5JxMOQ72SQ4iMIQuPE=; b=fiFBuYwNy9iYmdXNuGRw6gaWMoLzsqVvhLJ88Lqryob4N7qaShwxT+mMa7Em8mS7dO lohILxN1zt5d59z0/HP0CbOQi3vJpdWNUy+65fv05OGsq1chfIBfY2I7t56orgdmANTq nEjQbyqxGFtYijldf38zpMuCywijb5ow5ZAXX19l7jSIG/JLB47hDS9qjXwqIvrmAaNW N3pR8YnV/BAAVCZrdiBBWKdEbHgPlAqBVz9MLYCsGWFNQTucHmzJvjhHUTLCvPfP52j2 PEivGlyFUZNG9lzbTR05PCt/8Y6nTx4g2ybG1yiqBSWELvJsp0wKKLYt43iLRuDKo7WO +4Fg== X-Gm-Message-State: AOJu0Yw0P0jR45zL/l+M/WM/11cyqQ5EDFaRKKJijVAE3D5Fj+jq2C+l cWFjBhtMQvTRjOf56nAE2gRZMMlWZPv+nqLitZEFvRM0FxdTrt97gC9PFMN7eQ== X-Gm-Gg: ATEYQzzlIaA0dpEIOkm5wbjA+4W8+mE4G+UEdFjBcMwhiJOzGrK+PNklnsByU2uSe60 XrZYIvElAaojFhjDa5e8YCKWW/ru+VyeodABM0YBQuJ3KIPSGV7HgH2BAK9qCHkLYz4vdwoXlaF vWWdrip/aYhm7VuJ5mf3gagaRjjkOgTXy+fkn5HdCCkbAtOfD+j4vbnrdea7rsOyQXjs9V6uu/j Oztdy68KYs1+BVU1swsZrQRsNzogds5Tzjlbp0uXqnNqaT70ag3dsYYmBcmIjfaYMTIaZ+o/7Xg 67jQVsahYapxWdNSPQtKlsunjACTc0jl4vVXhaP6JqOYPASPh+a4Ah3wpaXyomNtVXK9ngbtusl UEsOV+S+KXFPssxKnjh/ZiNaIFvjeBmrKm9jWC+bhWHCdY3kT0uxnBG/KLR13UwnnL3JcAJBPNL 78AzMEGIsc5MIYIPW6+dffkxYKktDZyIxrMPDXvx61OabhDCV7W2LEmOz/lnSu82HSpw== X-Received: by 2002:a05:600c:a009:b0:483:b505:9db4 with SMTP id 5b1f17b1804b1-483c3df45e6mr36296915e9.31.1772106700147; Thu, 26 Feb 2026 03:51:40 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Romain Caritey , Oleksii Kurochko , Alistair Francis , Connor Davis , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [PATCH v6 12/14] xen/riscv: handle hypervisor timer interrupts Date: Thu, 26 Feb 2026 12:51:12 +0100 Message-ID: X-Mailer: git-send-email 2.53.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1772106729146158500 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 Acked-by: Jan Beulich --- Changes in v4-v6: - Nothing changed. Only rebase. --- Changes in v3: - add Acked-by: Jan Beulich . --- Changes in v2: - Drop cause argument of timer_interrupt() as it isn't used inside the function and anyway it is pretty clear what is the cause inside timer_interrupt(). --- 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 244264c92a79..326f2be62823 100644 --- a/xen/arch/riscv/traps.c +++ b/xen/arch/riscv/traps.c @@ -10,6 +10,7 @@ #include #include #include +#include =20 #include #include @@ -180,6 +181,15 @@ static void check_for_pcpu_work(void) p2m_handle_vmenter(); } =20 +static void timer_interrupt(void) +{ + /* 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; @@ -221,6 +231,10 @@ void do_trap(struct cpu_user_regs *cpu_regs) intc_handle_external_irqs(cpu_regs); break; =20 + case IRQ_S_TIMER: + timer_interrupt(); + break; + default: intr_handled =3D false; break; --=20 2.53.0