From nobody Wed Feb 11 04:18:55 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=1770655990; cv=none; d=zohomail.com; s=zohoarc; b=e/sUddjQ9jlynHtDv+xfvTS7IY6TN7PFEziGaZtY3N7UIzYwqnaytIapiEFi5BI+ngtSzWmwUURws3S1kcjqQ7h8/mms58lZQ7vpTiu6LDtXftdncVZc/rSobXF1Qk4jlxSDKboCTF8c72hEiiKqtuibEwI+FenoHMORnToaEho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770655990; 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=im3bd0BlqxTSOv1iNEV5B1CvJvcf5KKLgXBheRE/42Y=; b=gkWcrHjECSgGL8KUopKimrBhWbe6Z/8cez6kd+t2/IgDcU1JPqBr4qD7fut8OSNKlam7rJU0n57jPvIrZUs+tUyZIzEpJPVOnzAv/lEaxKNiVApCpnKcoQx3WHwVc5FP+sbRZjfbXm3fJu+z0YQlPh/8NujxMD+lQoa6676A518= 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 1770655990370370.03004905524483; Mon, 9 Feb 2026 08:53:10 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1225793.1532438 (Exim 4.92) (envelope-from ) id 1vpUVG-00012U-MU; Mon, 09 Feb 2026 16:52:50 +0000 Received: by outflank-mailman (output) from mailman id 1225793.1532438; Mon, 09 Feb 2026 16:52:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vpUVG-00011Z-Bw; Mon, 09 Feb 2026 16:52:50 +0000 Received: by outflank-mailman (input) for mailman id 1225793; Mon, 09 Feb 2026 16:52:49 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vpUVF-0007Zo-1S for xen-devel@lists.xenproject.org; Mon, 09 Feb 2026 16:52:49 +0000 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [2a00:1450:4864:20::629]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c3a33c6d-05d7-11f1-b162-2bf370ae4941; Mon, 09 Feb 2026 17:52:48 +0100 (CET) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-b8838339fc6so424017066b.0 for ; Mon, 09 Feb 2026 08:52:48 -0800 (PST) Received: from fedora (user-109-243-67-101.play-internet.pl. [109.243.67.101]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8edacf1564sm415776866b.52.2026.02.09.08.52.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Feb 2026 08:52:47 -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: c3a33c6d-05d7-11f1-b162-2bf370ae4941 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770655967; x=1771260767; 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=im3bd0BlqxTSOv1iNEV5B1CvJvcf5KKLgXBheRE/42Y=; b=PJHtPXX6qJ0eRTAIywvaJmnSR1WAmdxWgRkeZAidTE2UVxnqNU3YWxn+qoO7gjTBIG xUwpcix/UqYkCnW1SmViUQK4L6Zf6gvcfuK3xgd+Kh9r97hjVPD24wOVLc/7SxXTqyhV /brfbiSUd/gjt7JVEif9JoTpulJ7fpjrccvoCpauMsNue4eDb3sb5BlHBzP1FHw4w4zn ZkM7cQ+pZZldcU9h446reJlKsjeGw68lMpadQfwVdQvvFpKW7tOQ467rfC5rXpEQIWyV /uM1+M2Y6rL7vNqTyeuQNJnl4Lxl/52jo01QD4sBMuq+/PbyAvt8dKQ8In1h0fIkGsjm U/rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770655967; x=1771260767; 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=im3bd0BlqxTSOv1iNEV5B1CvJvcf5KKLgXBheRE/42Y=; b=tvykNYZ05s1R4+Jegw9mOyed7jH+QmUYAnxo2ifrKsOJBapOvv5nC7lcm9cvbj7/ja cXIrReifSraYoGXt1P3M25YU/rj9HUxOP5yJSevk4XJsb6R7JNtqYxyQvSRw4H1tOfDV Cc8afVFctW+2Xt2QFrL7FzmoeGF6HX3bHCzt4CK/Xh7M/W7LD3MIW6KyhdYt92+/3Lb6 gpqVpxXIkRP/ky/Y9q0wZleoY4sOLeE6sJXlDF42AR1LfL7MdX+Zfw2sdWRK96IflG57 db6hevWIWUJb7gAMVY/EnFTLTtCq+o7a35HLuolzceSr0YZ0o1PAE7wVQJ8fth39sore //oQ== X-Gm-Message-State: AOJu0YxbLSo5mQraKakH+am87n2eBtf9JeAy3KbCT0pWpUXrnEh+VORM 4AL/HwTkoZHd7YPqGr5rG2DsfJn1a0H3uVZrh0G7+50ZxlnxXFlDsrCJpypi94Q2 X-Gm-Gg: AZuq6aIhDjNe+hO17dhYVdQ6oievestFi/dXgKFZpCdxcA8SrIcDuEioC88OeDXX6wQ IyDfdtUpGHLzHItOJXmp9NAQwV2KX+mZ0liy4+H/k1Dl91t19ed3bf43Cg2cXylXXBNSNx8brav zcFVGFIg72Whnzc/UItxpmCBMJUahcjsdiPCXiVrAg0id4cW8ojhC2DVaQV6kCiVwSo7DjDVmwb WKriYlNfa5ql30VnS2Kgd0t3t1ZSJ3YlIbKNtVjrMpOfHKfep1356/uSB7w0My/pMWmXMG4KgUv s7jlXjIIUpaS6VZcmMoHPBwIVtm9k3byjxT9r9VtcKfBr8ofHgEahvjrzeRJDd8AvaiOxPpBWU1 wKWToFz7hmqoemu5U2mDTq6bKFqAlV7DyeX7g6cTbjMfjHDFKgqXuF1TWcoFMastW7XmoJtj8Cb rsEDP/GGU67AXHDqE5Z02XjhQ5/yg2o2icCbxfrx74LwgV8KVMbLoDcxcOkqlu0jOp X-Received: by 2002:a17:907:94d3:b0:b88:4224:8168 with SMTP id a640c23a62f3a-b8f4d57e4aemr4055766b.22.1770655967365; Mon, 09 Feb 2026 08:52:47 -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 v3 09/16] xen/riscv: introduce vcpu_kick() implementation Date: Mon, 9 Feb 2026 17:52:22 +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: 1770655992906154100 Content-Type: text/plain; charset="utf-8" Add a RISC-V implementation of vcpu_kick(), which unblocks the target vCPU and sends an event check IPI if the vCPU was running on another processor. This mirrors the behavior of Arm and enables proper vCPU wakeup handling on RISC-V. Remove the stub implementation from stubs.c, as it is now provided by arch/riscv/domain.c. Since vcpu_kick() calls perfc_incr(vcpu_kick), add perfcounter for vcpu_kick to handle the case when CONFIG_PERF_COUNTERS=3Dy. Although CONFIG_PERF_COUNTERS is not enabled by default, it can be enabled, for example, by randconfig what will lead to CI build issues. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in v3: - Add asm/perfc_defn.h to provide vcpu_kick perfcoounter to cover the case when CONFIG_PERF_COUNTERS=3Dy. --- Changes in v2: - Add Acked-by: Jan Beulich . --- xen/arch/riscv/domain.c | 14 ++++++++++++++ xen/arch/riscv/include/asm/Makefile | 1 - xen/arch/riscv/include/asm/perfc_defn.h | 3 +++ xen/arch/riscv/stubs.c | 5 ----- 4 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 xen/arch/riscv/include/asm/perfc_defn.h diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c index 3f4b062b6ce8..30a966f53c1d 100644 --- a/xen/arch/riscv/domain.c +++ b/xen/arch/riscv/domain.c @@ -1,8 +1,10 @@ /* SPDX-License-Identifier: GPL-2.0-only */ =20 +#include #include #include #include +#include #include =20 #include @@ -231,3 +233,15 @@ void vcpu_flush_interrupts(struct vcpu *v) vcpu_update_hvip(v); } } + +void vcpu_kick(struct vcpu *v) +{ + bool running =3D v->is_running; + + vcpu_unblock(v); + if ( running && v !=3D current ) + { + perfc_incr(vcpu_kick); + smp_send_event_check_mask(cpumask_of(v->processor)); + } +} diff --git a/xen/arch/riscv/include/asm/Makefile b/xen/arch/riscv/include/a= sm/Makefile index 3824f31c395c..86c56251d5d7 100644 --- a/xen/arch/riscv/include/asm/Makefile +++ b/xen/arch/riscv/include/asm/Makefile @@ -7,7 +7,6 @@ generic-y +=3D hypercall.h generic-y +=3D iocap.h generic-y +=3D irq-dt.h generic-y +=3D percpu.h -generic-y +=3D perfc_defn.h generic-y +=3D random.h generic-y +=3D softirq.h generic-y +=3D vm_event.h diff --git a/xen/arch/riscv/include/asm/perfc_defn.h b/xen/arch/riscv/inclu= de/asm/perfc_defn.h new file mode 100644 index 000000000000..8a4b945df662 --- /dev/null +++ b/xen/arch/riscv/include/asm/perfc_defn.h @@ -0,0 +1,3 @@ +/* This file is intended to be included multiple times. */ + +PERFCOUNTER(vcpu_kick, "vcpu: notify other vcpu") diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c index c5784a436574..1f0add97b361 100644 --- a/xen/arch/riscv/stubs.c +++ b/xen/arch/riscv/stubs.c @@ -208,11 +208,6 @@ void vcpu_block_unless_event_pending(struct vcpu *v) BUG_ON("unimplemented"); } =20 -void vcpu_kick(struct vcpu *v) -{ - BUG_ON("unimplemented"); -} - unsigned long hypercall_create_continuation(unsigned int op, const char *format, ...) { --=20 2.52.0