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 8F23FC48BC4 for ; Sun, 18 Feb 2024 18:22:24 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.682620.1061698 (Exim 4.92) (envelope-from ) id 1rblns-0003xh-AG; Sun, 18 Feb 2024 18:22:16 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 682620.1061698; Sun, 18 Feb 2024 18:22:16 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rblns-0003xa-5t; Sun, 18 Feb 2024 18:22:16 +0000 Received: by outflank-mailman (input) for mailman id 682620; Sun, 18 Feb 2024 18:22:15 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rblnr-0003xU-4A for xen-devel@lists.xenproject.org; Sun, 18 Feb 2024 18:22:15 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rblnq-0007an-TF; Sun, 18 Feb 2024 18:22:14 +0000 Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.193]) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1rblnq-00050x-Np; Sun, 18 Feb 2024 18:22:14 +0000 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" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID; bh=cQFI98VV1YZYGzqepX/tZFMS0fNNz4PeN/G23l495II=; b=Ey/JpORooTusyFnG+8pThaCaAI ZTmR/OFyDjdcnhK7Ac1Qjszs6pl8q1GMrnCJJflxKq0f0Uvm6DWpRxX1QUQN1PqGnf38bHAgak+wI KTtUA2zcNBrcG03rZmjqhynrLxHFrjTDhM8RKKw1BayAp+NxNBSlrH3UldGDHc3hZWxw=; Message-ID: Date: Sun, 18 Feb 2024 18:22:12 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 17/30] xen/riscv: introduce regs.h Content-Language: en-GB To: Oleksii Kurochko , xen-devel@lists.xenproject.org Cc: Alistair Francis , Bob Eshleman , Connor Davis , Andrew Cooper , George Dunlap , Jan Beulich , Stefano Stabellini , Wei Liu References: <13cfdfa01b303d2597124f09c0ec0734859b697d.1707146506.git.oleksii.kurochko@gmail.com> From: Julien Grall In-Reply-To: <13cfdfa01b303d2597124f09c0ec0734859b697d.1707146506.git.oleksii.kurochko@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 05/02/2024 15:32, Oleksii Kurochko wrote: > Signed-off-by: Oleksii Kurochko > Acked-by: Jan Beulich > ------ > Changes in V4: > - add Acked-by: Jan Beulich > - s/BUG()/BUG_ON("unimplemented") > --- > Changes in V3: > - update the commit message > - add Acked-by: Jan Beulich > - remove "include " and use a forward declaration instead. > --- > Changes in V2: > - change xen/lib.h to xen/bug.h > - remove unnecessary empty line > --- > xen/arch/riscv/include/asm/regs.h | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > create mode 100644 xen/arch/riscv/include/asm/regs.h > > diff --git a/xen/arch/riscv/include/asm/regs.h b/xen/arch/riscv/include/asm/regs.h > new file mode 100644 > index 0000000000..c70ea2aa0c > --- /dev/null > +++ b/xen/arch/riscv/include/asm/regs.h > @@ -0,0 +1,29 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +#ifndef __ARM_RISCV_REGS_H__ > +#define __ARM_RISCV_REGS_H__ > + > +#ifndef __ASSEMBLY__ > + > +#include > + > +#define hyp_mode(r) (0) I don't understand where here you return 0 (which should really be false) but ... > + > +struct cpu_user_regs; > + > +static inline bool guest_mode(const struct cpu_user_regs *r) > +{ > + BUG_ON("unimplemented"); > +} ... here you return BUG_ON(). But I couldn't find any user of both guest_mode() and hyp_mode(). So isn't it a bit prematurate to introduce the helpers? Cheers, -- Julien Grall