From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E6920C3DA41 for ; Wed, 10 Jul 2024 15:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zm900Bk/72FnghC4fkXJaQBDQjIMkM5HgszL6mEXY0Q=; b=Euq8QdpKF5lpSImsJxLjNUMGaL 8jiR5l/rWUMofpX+0RNecASaUP9ethhKTJr7tlfJcDauhC3P6kuRDXuTjpUYSkRD+MfCrYVkey4vH EpVSdi+rFa3yC1JMV5FERa27MY8lz5wNBVi8e/Z2D3qOiPW4E29Q8akXaFbf/WGbdcLYv/dYxmP19 PMOjdWnpgrg9OYzfKJO9Hb35aK7zX903EhdF3Yz/XYyryuKbhWr5lx9Egc0ENK4jqf6UoEC79+xJR g8JD+7SX6Gj9kpSf3VVaz91uyrSWiV1r2FTjw8ggs+6NTl9h7zt/9+C2U3o0duxFsPF7DiqWDqnDk IJVtvLMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRZL3-0000000AyDO-20Hw; Wed, 10 Jul 2024 15:34:37 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRZKk-0000000Ay6v-11x0 for linux-arm-kernel@lists.infradead.org; Wed, 10 Jul 2024 15:34:21 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 33A21106F; Wed, 10 Jul 2024 08:34:40 -0700 (PDT) Received: from [10.57.8.115] (unknown [10.57.8.115]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6A60F3F766; Wed, 10 Jul 2024 08:34:11 -0700 (PDT) Message-ID: <3b2ddd79-c7f0-4d41-8795-13d1305e3d08@arm.com> Date: Wed, 10 Jul 2024 16:34:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 01/15] arm64: rsi: Add RSI definitions To: Gavin Shan , kvm@vger.kernel.org, kvmarm@lists.linux.dev Cc: Suzuki K Poulose , Catalin Marinas , Marc Zyngier , Will Deacon , James Morse , Oliver Upton , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Gouly , Alexandru Elisei , Christoffer Dall , Fuad Tabba , linux-coco@lists.linux.dev, Ganapatrao Kulkarni References: <20240701095505.165383-1-steven.price@arm.com> <20240701095505.165383-2-steven.price@arm.com> <3b1c8387-f40f-4841-b2b3-9e4dc1e35efc@redhat.com> From: Steven Price Content-Language: en-GB In-Reply-To: <3b1c8387-f40f-4841-b2b3-9e4dc1e35efc@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240710_083418_538104_77EF801E X-CRM114-Status: GOOD ( 14.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 09/07/2024 06:19, Gavin Shan wrote: > On 7/1/24 7:54 PM, Steven Price wrote: >> From: Suzuki K Poulose >> >> The RMM (Realm Management Monitor) provides functionality that can be >> accessed by a realm guest through SMC (Realm Services Interface) calls. >> >> The SMC definitions are based on DEN0137[1] version A-eac5. >> >> [1] https://developer.arm.com/documentation/den0137/latest >> >> Signed-off-by: Suzuki K Poulose >> Signed-off-by: Steven Price >> --- >> Changes since v3: >>   * Drop invoke_rsi_fn_smc_with_res() function and call arm_smccc_smc() >>     directly instead. >>   * Rename header guard in rsi_smc.h to be consistent. >> Changes since v2: >>   * Rename rsi_get_version() to rsi_request_version() >>   * Fix size/alignment of struct realm_config >> --- >>   arch/arm64/include/asm/rsi_cmds.h |  38 ++++++++ >>   arch/arm64/include/asm/rsi_smc.h  | 142 ++++++++++++++++++++++++++++++ >>   2 files changed, 180 insertions(+) >>   create mode 100644 arch/arm64/include/asm/rsi_cmds.h >>   create mode 100644 arch/arm64/include/asm/rsi_smc.h >> > > [...] > >> --- /dev/null >> +++ b/arch/arm64/include/asm/rsi_smc.h >> @@ -0,0 +1,142 @@ >> +/* SPDX-License-Identifier: GPL-2.0-only */ >> +/* >> + * Copyright (C) 2023 ARM Ltd. >> + */ >> + >> +#ifndef __ASM_RSI_SMC_H_ >> +#define __ASM_RSI_SMC_H_ >> + >> +/* >> + * This file describes the Realm Services Interface (RSI) Application >> Binary >> + * Interface (ABI) for SMC calls made from within the Realm to the >> RMM and >> + * serviced by the RMM. >> + */ >> + >> +#define SMC_RSI_CALL_BASE        0xC4000000 >> + > > These fields have been defined in include/linux/arm-smccc.h. Those definitions > can be reused. Otherwise, it's not obvious to reader what does 0xC4000000 represent. > > #define SMC_RSI_CALL_BASE    ((ARM_SMCCC_FAST_CALL << ARM_SMCCC_TYPE_SHIFT)   | \ >                                  (ARM_SMCCC_SMC_64 << ARM_SMCCC_CALL_CONV_SHIFT) | \ >                                  (ARM_SMCCC_OWNER_STANDARD << ARM_SMCCC_OWNER_SHIFT)) > > or > > #define SMC_RSI_CALL_BASE       ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL,            \ >                                                    ARM_SMCCC_SMC_64,               \ >                                                    ARM_SMCCC_OWNER_STANDARD,       \ >                                                    0) Good point, even better is actually to just drop SMC_RSI_CALL_BASE and just redefine SMC_RSI_FID() in terms of ARM_SMCCC_CALL_VAL(). Thanks, Steve