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 9863FE91298 for ; Thu, 5 Feb 2026 08:56:49 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1221636.1529816 (Exim 4.92) (envelope-from ) id 1vnvA4-0006oE-QB; Thu, 05 Feb 2026 08:56:28 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1221636.1529816; Thu, 05 Feb 2026 08:56:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vnvA4-0006o7-M8; Thu, 05 Feb 2026 08:56:28 +0000 Received: by outflank-mailman (input) for mailman id 1221636; Thu, 05 Feb 2026 08:56:26 +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 1vnvA2-0006o1-Sr for xen-devel@lists.xenproject.org; Thu, 05 Feb 2026 08:56:26 +0000 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [2a00:1450:4864:20::32e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 8d35f34a-0270-11f1-b161-2bf370ae4941; Thu, 05 Feb 2026 09:56:25 +0100 (CET) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-47ee2715254so4059125e9.3 for ; Thu, 05 Feb 2026 00:56:25 -0800 (PST) Received: from [192.168.1.6] (user-109-243-67-101.play-internet.pl. [109.243.67.101]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4831d0b5b31sm14514165e9.4.2026.02.05.00.56.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Feb 2026 00:56:24 -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: 8d35f34a-0270-11f1-b161-2bf370ae4941 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770281785; x=1770886585; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+IX5G5FK8ZKsLCPCdcCYVvvPMN5D61IxxVz3Nkm5eZw=; b=LUo1hPAmzRIz0l/DecXUvaQ7WnMRf2oQpFdvKO2ngY6ixadb/o83/UNChnnxjWa+vW OtlLhlKMG+plRjw+75nbq8Qfz7imqbzA9k5Up/WA5YM+/MowE+d21lI+JMumjKsuMcDt SAKqrjzaxzEw6TVn2ieJGn+nK0MFeM8v8rlcx/u+cxK6T+DdLgug57bpARgGIXeKjP7I ZD5OGwaa8QUDQx/J4lD8lfi2i3XFKO8rPbuQ11hrQ/586a/YN+/cr8IC9X56j1dnw/af HJ1xAIce+Q0kud1qqYJZDMoYu3fVuB12Hv1Z99mKjiD8qzW7s+x1NyEyC2pSnV5t2hMn 7PfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770281785; x=1770886585; h=content-transfer-encoding:in-reply-to: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=+IX5G5FK8ZKsLCPCdcCYVvvPMN5D61IxxVz3Nkm5eZw=; b=EKlp4vMMaWdyuxPudNqeFzAs64yd+Mx9Qtikx+OugAedPU0TZLa8t82w6Hw7w/RCn5 P8audwC5uqAcOyrzPv5wh3zSZlm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4830e948cf0mr81176205e9.10.1770281784769; Thu, 05 Feb 2026 00:56:24 -0800 (PST) Message-ID: <060f4338-d6ac-41a1-8036-ab506cd54bf4@gmail.com> Date: Thu, 5 Feb 2026 09:56:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 2/3] xen/riscv: add support for local guest TLB flush using HFENCE.VVMA To: Jan Beulich Cc: Romain Caritey , Alistair Francis , Connor Davis , Andrew Cooper , Anthony PERARD , Michal Orzel , Julien Grall , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , xen-devel@lists.xenproject.org References: <89f50ab2c1a1c79abea4db3a53393f974bb9a473.1770036584.git.oleksii.kurochko@gmail.com> <309e4e0d-c2a3-4f56-ab6f-f648da313bb6@suse.com> Content-Language: en-US From: Oleksii Kurochko In-Reply-To: <309e4e0d-c2a3-4f56-ab6f-f648da313bb6@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/4/26 12:09 PM, Jan Beulich wrote: > On 02.02.2026 13:57, Oleksii Kurochko wrote: >> @@ -14,6 +15,12 @@ static inline void local_hfence_gvma_all(void) >> asm volatile ( "hfence.gvma zero, zero" ::: "memory" ); >> } >> >> +/* Flush VS-stage TLB for current hart. */ >> +static inline void flush_tlb_guest_local(void) >> +{ >> + HFENCE_VVMA(0, 0); > For this use, ... > >> --- /dev/null >> +++ b/xen/arch/riscv/include/asm/insn-defs.h >> @@ -0,0 +1,10 @@ >> +/* SPDX-License-Identifier: GPL-2.0-only */ >> + >> +#ifndef ASM_RISCV_INSN_DEFS_H >> +#define ASM_RISCV_INSN_DEFS_H >> + >> +#define HFENCE_VVMA(vaddr, asid) \ >> + asm volatile ("hfence.vvma %0, %1" \ >> + :: "r"(vaddr), "r"(asid) : "memory") > ... don't you want to use "rJ" as the constraints here? Even without "rJ" it is using x0 when argument 0 is passed. Just to be on a safe side I don't mind to add "J". ~ Oleksii