From nobody Tue Mar 3 04:56:06 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=1771604387; cv=none; d=zohomail.com; s=zohoarc; b=gFKJucpD1cXuei8+Ro21TQdyTlanxIGZyFTq+J0zYQLwFeYLA05yma2kW/lPzkqeiDvtQDbp7rYinIHNsLd3vAZvB7oaFMdgv8Z5EHHQg0bW0XZwtqI4+NxtgsKwCdJTxueBwRb4EMOou2umAPjgbXHfHVsf35JIh7ao/wpH/yM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771604387; 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=L59NZMHr94doMxHYbooYqU+b+678IT1cbuVKqM3ukd0=; b=QvDtKRQunKpUtF6kjluh3sbJc3MyeUVGduSd5RPuZZaUFA92FSmPa37hrFXUCbPQ3BlIYHkNQNJD6txpcAroLOgrozUJ5ORmqVqJsegJHtzICO+lsmgBrzBj67AkNiCW4R0tOB7M0sL8mXSng9ndyRUEi+hv4WhsWIgFWsx9lo8= 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 1771604387834607.9947095116082; Fri, 20 Feb 2026 08:19:47 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1237339.1539749 (Exim 4.92) (envelope-from ) id 1vtTE1-00025X-S6; Fri, 20 Feb 2026 16:19:29 +0000 Received: by outflank-mailman (output) from mailman id 1237339.1539749; Fri, 20 Feb 2026 16:19:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vtTE1-00025G-Of; Fri, 20 Feb 2026 16:19:29 +0000 Received: by outflank-mailman (input) for mailman id 1237339; Fri, 20 Feb 2026 16:19:28 +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 1vtTE0-0000Q4-7e for xen-devel@lists.xenproject.org; Fri, 20 Feb 2026 16:19:28 +0000 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [2a00:1450:4864:20::329]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ecf522b8-0e77-11f1-9ccf-f158ae23cfc8; Fri, 20 Feb 2026 17:19:26 +0100 (CET) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-483487335c2so21410585e9.2 for ; Fri, 20 Feb 2026 08:19:26 -0800 (PST) Received: from fedora (user-109-243-67-101.play-internet.pl. [109.243.67.101]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43796a6c1bfsm56991068f8f.13.2026.02.20.08.19.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Feb 2026 08:19:25 -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: ecf522b8-0e77-11f1-9ccf-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771604366; x=1772209166; 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=L59NZMHr94doMxHYbooYqU+b+678IT1cbuVKqM3ukd0=; b=S3q7A04RZNKuGVC2lv5LmiXS+HfLUSjRnlEYQSFSd+kY1/djYWxWGOCcCdzZAdC0vf krFp6ARERyCLLJe6K7Wh/wQa1mvJvgZvY89qfqWItbrYRqW27lK4dwN7kUq2Rx0BxNjh Txjd3VtTEmAHVd10ucZASWcLu3YIZwvshGmzlCgE1e5UOzAr6heQcs0oAMbIKQOdtbGw iZRRj4Z0t28xLDnFQEL60NDGD5Tu+JvXnOo0mNi0UGMojlE7AdidHCwBl4Chh7rJjoS7 asb7XttRLkAbhTN2xh9V/KMZE73GHp20+7LWgB/ievKBCT1uRccjeQbcF9Safwili0C6 Z9xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771604366; x=1772209166; 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=L59NZMHr94doMxHYbooYqU+b+678IT1cbuVKqM3ukd0=; b=g30bC4tiGA6TiYCq0AxN7aDpEZDXb1q8biQpzhVqGUMLqI46Hq3YAvMZX72lg1Ozpi fq07J7nPRaxj3353/x3AMbctK5b6ULHtE4BUShaJ63HOpqlAXLvJYE56gIOOqwGbUiDY B1kKSlUretAoa+6cbtt+PVCoxrjZNCnyp4HXQTwJZZ8SwyXqPA2D9zdSo6v63S8usAqc Lb5MB2SzbVglZN6dNKU0AUXDtYpvWRycNwR+IZ1sdgV6QO9jorl0yiLTjJ3mipTjuY70 QiB/XceMmcFbtLThDnUq591Gn+os/iOs79GZaB5uyTkIu9EHSneuoiTuaW0toT1VTjX2 8SMg== X-Gm-Message-State: AOJu0Yy7jQW82Fm2OtdmwhnxG77jsXjdAVkRDJfErR0ykEAmkP4Zm4tD yRCcC3dr+3QF8U5Zc1VPGgHJ9QSmn9HfTCttGwXFPAZXjDrlrM6/C5Gb2EUbDQ== X-Gm-Gg: AZuq6aL04xf1LJdyNmv3B8TQtsKxLQ0IgFJC5Zst/YgHJSDUcFvL1nPCNZrkI+VfLeM yxywsRO7HOVj+HiuCDksuEVSwYXdso2u73vrIEIDp4Hl5P6KddhPD1azGVQ6yc2ppY0f63wrPcM VlD95Nhpoz2stXWWSinOVIy03qFf9BBvqgmcG0svyA2mO9RbArKtI/Jnq5I2PgjvrT0EzHpA6Sr 2gAzglBXfkFoLq+MLd5Ai0vP5EB/2o8FodcXpsYMpu/t4EshPXH7XQayfyBJnxL/5fud/eZ/pj7 acrlVDWrm6ujIyL3vMmiLPO7gM97s3d78bRvH3WotuRC1VJg4XwsmvW0uDQVK00a4itBM0AxX7x jZFiREkFFZl43RO4age6jJoq1+qo1spug/lQ/IPy8JL+kbICmpHldkRt3Th3rlo8Ok1m8pO5lKK gn31U6JBMC7AMgW341ZXJhMOLi2kqROIW//SSjavlhyps4iob+SDdf7kV8cEN6O8JVbw== X-Received: by 2002:a05:600c:3e8d:b0:47e:e9c9:23bc with SMTP id 5b1f17b1804b1-483a95f89b5mr1012965e9.30.1771604365821; Fri, 20 Feb 2026 08:19:25 -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 v5 07/14] xen/riscv: introduce vcpu_kick() implementation Date: Fri, 20 Feb 2026 17:19:02 +0100 Message-ID: <0d0c9a359699240cd812e1ba68385a864666d102.1771590794.git.oleksii.kurochko@gmail.com> 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: 1771604388743154100 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 v4-v5: - Nothing changed. Only rebase. --- 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 7027b5e9aa20..fb5c21078172 100644 --- a/xen/arch/riscv/domain.c +++ b/xen/arch/riscv/domain.c @@ -1,9 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0-only */ =20 +#include #include #include #include #include +#include #include =20 #include @@ -251,6 +253,18 @@ void vcpu_flush_interrupts(struct vcpu *v) #endif } =20 +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)); + } +} + static void __init __maybe_unused build_assertions(void) { /* 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 daadff0138e4..eedf8bf9350a 100644 --- a/xen/arch/riscv/stubs.c +++ b/xen/arch/riscv/stubs.c @@ -203,11 +203,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.53.0