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=1772106717; cv=none; d=zohomail.com; s=zohoarc; b=eAFaiHcrVIaqMtngTYyWMIyFO1d2qXqPn/MCVm8woqFN/DQp+bWjrJpwCdi4OdGV7ZA9xZI9mqcI99pLo0wwlmO8za4hO7kry+WeokhIYvdjpP6159zcVPhFjPKnKLZs3XkqtfRgZW1O7jmk4DmY7RZ+HX2jkRgJ48kQLZdprrc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772106717; 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=Y1ZCln4LGxYbhh7EA/lAbVEGbnMzo0d9tLUWjs8DB5k=; b=eb33tp/epnsqsQlLRos9VH+l84sY9+XgtmLpDH3n6p5OlPtOHUJrKWe+h2TrKSJ3sD7cx0O5Mjtbu9CcBz61TXXXSOcuZOhYiglpp7NDIczRgVQjaaiVQHG0L06lfIGna7rUgK3eWi7paW1sBLuR8WfkD+RfvE8u/82cmZaKG+o= 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 1772106717242886.9200048783016; Thu, 26 Feb 2026 03:51:57 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1241458.1542544 (Exim 4.92) (envelope-from ) id 1vvZu6-0007uS-2G; Thu, 26 Feb 2026 11:51:38 +0000 Received: by outflank-mailman (output) from mailman id 1241458.1542544; Thu, 26 Feb 2026 11:51:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vvZu5-0007uE-SC; Thu, 26 Feb 2026 11:51:37 +0000 Received: by outflank-mailman (input) for mailman id 1241458; Thu, 26 Feb 2026 11:51:36 +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 1vvZu4-0006EH-L0 for xen-devel@lists.xenproject.org; Thu, 26 Feb 2026 11:51:36 +0000 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [2a00:1450:4864:20::331]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7fee7579-1309-11f1-9ccf-f158ae23cfc8; Thu, 26 Feb 2026 12:51:34 +0100 (CET) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4837f27cf2dso6970105e9.2 for ; Thu, 26 Feb 2026 03:51:34 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 03:51:33 -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: 7fee7579-1309-11f1-9ccf-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772106694; x=1772711494; 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=Y1ZCln4LGxYbhh7EA/lAbVEGbnMzo0d9tLUWjs8DB5k=; b=eG2HjWeSENtDPApqBcBWK2jpmataLLKC6cZ4NeqLfxqspG2mlw9dQinywOb05UDLqj nzlP9zuzAtslAYo1pP0jHiCJRyT43HSiBMn8gMzKR62IFiTXZWAwYSHmyr8U+6rN37JY 88GMVCYDw2mPtk3+6OVjVp0CflmygO1Q8/DWum1DaWe3Q4gpJtZd+RCile2VSTub67rD jwvYZxkAp1HWEEb2/kX/wJtr3MplsGBcu6DZzTgEPM2BiOze122EqQlOiGLKsmWVvK6z oxJuUmvxSaktKl0iWKBAuLHtEpJyEmOwrkuBPm0G84htLnV/pLDNhCqe/xoDPsSPOkj/ EgVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772106694; x=1772711494; 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=Y1ZCln4LGxYbhh7EA/lAbVEGbnMzo0d9tLUWjs8DB5k=; b=Enqva28TnEHqbLARebVIfr6FviGa/LCWpWBrsNQ9cPdLv/dzjV/ymR/9iREIgceA/D SToceblLQi3RHkXehsCZHM8KLe5C3052wqf65Kv61CIgaA3ICd3uprdve83q22jtOzQJ WA57mmhlNT7Druy5xrnTbRg/5HaWB986YX7F3Ogti7A/BqEoJwnbM1UbK4KeUYMTy3Ke iKi25mP35IhV0/uBaOZoaVMKi3OtDK03NT/Rts6OaS/Pzb6PoOTuLonZo1eor9D2Fi4X Gw89w8IA0AvuwyTo+mc/xWebN+kIMNIFhCVmAZlEops4LloF7/wu07U+UWvFFOvmmN5i XSjg== X-Gm-Message-State: AOJu0YwdI6X1loYif8CjIbJdSX6Cf5MWys+TEhCd8SoeZbtEHQj85LI0 g8IOTYcKUx+x/krhgkfH1kxl6p1CK9cdAHKd/zHdVDlauCTRSRlNXSIKHu7W3A== X-Gm-Gg: ATEYQzzJxUkV6+hALaa5ld5euAlanFGq8GuPtFqHFcZO24Ol2CT+rKhyNV7zcbexFsd quOkCJ8VFnmX8pgDX9Miu1z2r3wS8LYEAI/722F0OMc4+K80K07Tl9JpNXA6oQqZ5wozMLyRtAE M0TKbP3nSa/YP2U4Y8M06d3bOJW/pDv9i7AHxN8Py+xr4YudgdlkhL1OflVe38QZ4mbJx1fhO6F UiqCnAQAyQ+If/k3nAPJw9XM2+aZAHnGN3Y+6/pPs3sQvkhyHigHP02CELmSfo9OAtogAP1E5DD qUYAq9VwqQtTQr9CQJPMwrdgaTrl688q3xsiCxd6ac1/3zotb/qjUCfPfCcKmA0Hk4a1O6BV5oP Vuv5uZw0lCC4tiNPC3f68kiCcJHY9TLYqlfqGtV9dSS8c6zQbBbTq/h2lai7v7YesNzNaRYwiHZ lVJPhb0Q4VeTU9X3LSshx2ssImp06BOG8g1V5fDKoQf08/QltGrkcepcasL5mD4FOEzA== X-Received: by 2002:a05:600c:8b16:b0:480:68ed:1e70 with SMTP id 5b1f17b1804b1-483a963de73mr420137245e9.35.1772106693973; Thu, 26 Feb 2026 03:51:33 -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 07/14] xen/riscv: introduce vcpu_kick() implementation Date: Thu, 26 Feb 2026 12:51:07 +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: 1772106719155158500 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-v6: - 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 56b28750d3aa..fda8cff90f6a 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 @@ -265,6 +267,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