Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2AC7FE7E0B9 for ; Mon, 9 Feb 2026 09:52:21 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1225091.1531549 (Exim 4.92) (envelope-from ) id 1vpNw5-00023V-Pj; Mon, 09 Feb 2026 09:52:05 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1225091.1531549; Mon, 09 Feb 2026 09:52:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vpNw5-00023O-LG; Mon, 09 Feb 2026 09:52:05 +0000 Received: by outflank-mailman (input) for mailman id 1225091; Mon, 09 Feb 2026 09:52:04 +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 1vpNw4-00023I-6c for xen-devel@lists.xenproject.org; Mon, 09 Feb 2026 09:52:04 +0000 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [2a00:1450:4864:20::42d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f9ca622d-059c-11f1-9ccf-f158ae23cfc8; Mon, 09 Feb 2026 10:51:59 +0100 (CET) Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-43284ed32a0so2818018f8f.3 for ; Mon, 09 Feb 2026 01:51:59 -0800 (PST) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4376accfc58sm10384106f8f.16.2026.02.09.01.51.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Feb 2026 01:51:58 -0800 (PST) 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: f9ca622d-059c-11f1-9ccf-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1770630718; x=1771235518; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=CFemyBGgeUstEbpkJJOJGGd9yi/2M0injES8NM4DbJY=; b=gI9vk1QKeHaRJFo99dwROwvRWYacIvFjWYykuKDw8+uTwl5VVDmcuDOnxmnVUwvCQB N8jH1sY7QKB6CprgJOtNsk8uO3roxny1HY4iGqNMe6Ng6PeU8Ejt8r/afH/V7F15/yj2 jFy2MUJim4jaQERhviKq6rc5XjPXVbVdH0vOCTcydQGaWaKCatbAVZ4bTiKKmd31o4XK MSDI/ZM9wxLEoiOWoPcAjZL2JWsqVQNTSv6fglYiUH/7BOaYYWhS7Qi34H3UcRJxYnZZ hpTrj45+9nqZmekVCWo2Z2DBqrorX2T0Z40y4s3Ij/iyNxzrnu4Sx8rWqx8hOPHoCz5K hRbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770630718; x=1771235518; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CFemyBGgeUstEbpkJJOJGGd9yi/2M0injES8NM4DbJY=; b=CISZrmeoKgEW0UPUhs/qIGpsk/4zRsdqwb/0+blWw5ZXATePZDxHB/5mBhTdjcQLto JAx7swIHHz70nU4pngkZARGIEyUPn0oszi++EfNMqbFd174xMdAgDDNZ1L8Sz0AB9zyu L4kylEIvXxqvSeOOV1omaSxbwguCkha4MMEzMEzQRGaz7RUuI976CByu4fJya2dUMLhf jZc9uGTd/Jy9PWt3VDZmn6nTTeuv4NiZJN0VTXvcIcl7QuPHJWTDHLx02X9Hpc0MptUL p8WxhmmscVAeQ2urVsId+Wt9yjFGopPbAjFFT1UzOlkib+SsycPATwD+rBJkFr/q57Ez U3DQ== X-Forwarded-Encrypted: i=1; AJvYcCXR6YOpitC2ReKUr/GGBlQVq9XUCKAeA98gzsHjoalKSgKNUv33o//n1hIcch1KeG9EJg5ZCC6eAyA=@lists.xenproject.org X-Gm-Message-State: AOJu0Yw0PLlsgv69nSrCvDvGMO7E8n9HqpLhkpWNjyQKJzlsIAcPwR5+ TofFqLlvuBupKfQhFs+yuCfC7NTqfG371LQgbHLpi75+xGgbC2GLH0NMPWXrcdccWg== X-Gm-Gg: AZuq6aKX7i+m0Hmu1mJHDJ1Q7yMtEEreig25ysl4xGX6k0leOiUiROcVWH/mIxdvdFI 5LYBiDywmrEAXjBwIy+dvC5OyjdAS+Qmci+2pU2wN5UMGlgimYbVnDPg0B8t+XLNamgEj+chYnz n3pz6YlWbS8KLf3MWpSw2BXPxcvWJuXdqr2m7E6JuuufGEtXRrDtqJ27deEXIGuodDIMMp2X2lX dDCHn7hIhmWfGxUPGD2fifPVv+IxZwKjPmcKwXSAy7CN0eM0DzlOXPkXG7tPlLEecKILGvn5Tld nN249ttEL8kK243Ca8JjkLS9rIJ/X8oZLH+2F1K61rz/v5CKtVkPS1f/xXabSYyxQRUqDpB+wEG BQ2uy1UJI95l9eoePD7ziCP6XgcjWpDPJwtqv25sDSWpcMXDuqTZELRm0lwTxou897DdylVITNe rm16iP7A1+JSJkcded6xEspZKr+vbdH6+U9pSVRMTrbvFLVITVZmF84TOn0NEvkBkvdEg8BPaEy IU= X-Received: by 2002:adf:e3ca:0:b0:436:307c:b756 with SMTP id ffacd0b85a97d-436307cb85dmr9404908f8f.47.1770630718313; Mon, 09 Feb 2026 01:51:58 -0800 (PST) Message-ID: <87533cdf-c8cc-4a86-9946-a999e8d31b82@suse.com> Date: Mon, 9 Feb 2026 10:51:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 09/16] xen/riscv: introduce vcpu_kick() implementation To: Oleksii Kurochko Cc: Alistair Francis , Connor Davis , Andrew Cooper , Anthony PERARD , Michal Orzel , Julien Grall , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Romain Caritey , xen-devel@lists.xenproject.org References: <0335a7db0343d81ce4256482a464e7ba5df1c204.1769099885.git.oleksii.kurochko@gmail.com> <14d19350-0de8-4496-99e5-0ba76e421684@gmail.com> <4a12e652-5b53-40d0-b701-d1f5b749dfa7@suse.com> <29006d8a-e003-4451-99af-0eef8f7d1c08@gmail.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQ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Content-Transfer-Encoding: 7bit On 09.02.2026 10:40, Oleksii Kurochko wrote: > > On 2/9/26 10:07 AM, Jan Beulich wrote: >> On 06.02.2026 17:36, Oleksii Kurochko wrote: >>> On 1/22/26 5:47 PM, Oleksii Kurochko wrote: >>>> 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. >>>> >>>> Signed-off-by: Oleksii Kurochko >>>> Acked-by: Jan Beulich >>>> --- >>>> Changes in v2: >>>> - Add Acked-by: Jan Beulich . >>>> --- >>>> xen/arch/riscv/domain.c | 14 ++++++++++++++ >>>> xen/arch/riscv/stubs.c | 5 ----- >>>> 2 files changed, 14 insertions(+), 5 deletions(-) >>>> >>>> diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c >>>> index e38c0db62cac..13ac384c4b76 100644 >>>> --- a/xen/arch/riscv/domain.c >>>> +++ b/xen/arch/riscv/domain.c >>>> @@ -1,8 +1,10 @@ >>>> /* SPDX-License-Identifier: GPL-2.0-only */ >>>> >>>> +#include >>>> #include >>>> #include >>>> #include >>>> +#include >>>> #include >>>> >>>> #include >>>> @@ -240,3 +242,15 @@ void vcpu_sync_interrupts(struct vcpu *v) >>>> # error "Update vsieh" >>>> #endif >>>> } >>>> + >>>> +void vcpu_kick(struct vcpu *v) >>>> +{ >>>> + bool running = v->is_running; >>>> + >>>> + vcpu_unblock(v); >>>> + if ( running && v != current ) >>>> + { >>>> + perfc_incr(vcpu_kick); >>> Because of this it is needed to introduce: >>> PERFCOUNTER(vcpu_kick, "vcpu: notify other vcpu") >>> Otherwise randconfig build will fail when CONFIG_PERF_COUNTERS=y. >>> >>> I would like to ask if it would be okay to add it xen/include/xen/perfc_defn.h >>> just after PERFCOUNTER(need_flush_tlb_flush,...) or would it be better to have >>> it in arch specific perfc_defn.h? >> Arch-specific please - it's not used by x86 nor ppc. > > Then I will do the following changes: > > diff --git a/xen/arch/riscv/include/asm/Makefile b/xen/arch/riscv/include/asm/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 += hypercall.h > generic-y += iocap.h > generic-y += irq-dt.h > generic-y += percpu.h > -generic-y += perfc_defn.h > generic-y += random.h > generic-y += softirq.h > generic-y += vm_event.h > diff --git a/xen/arch/riscv/include/asm/perfc_defn.h b/xen/arch/riscv/include/asm/perfc_defn.h > new file mode 100644 > index 000000000000..4fc161f1abad > --- /dev/null > +++ b/xen/arch/riscv/include/asm/perfc_defn.h > @@ -0,0 +1,7 @@ > +/* This file is intended to be included multiple times. */ > +/*#ifndef __XEN_PERFC_DEFN_H__*/ > +/*#define __XEN_PERFC_DEFN_H__*/ > + > +PERFCOUNTER(vcpu_kick, "vcpu: notify other vcpu") > + > +/*#endif*/ /* __XEN_PERFC_DEFN_H__ */ > > and add the following to commit message: > Since vcpu_kick() calls perfc_incr(vcpu_kick), add perfcounter for > vcpu_kick to handle the case when CONFIG_PERF_COUNTERS=y. Although > CONFIG_PERF_COUNTERS is not enabled by default, it can be enabled, > for example, by randconfig what will lead to CI build issues. > > Note that I keep __XEN_PERFC_DEFN_H__ as other archictectures use the same, > not something like ASM____PERFC_DEFN_H. Please don't copy this mistake. I actually question the commented-out pre- processor directives altogether: Misra also has a rule against commented- out code (directive 4.4, which we didn't accept [yet], but which exists nevertheless). Yet at the very least what's commented out should not be obviously wrong. Jan