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 47FCACD98C9 for ; Tue, 9 Jun 2026 18:11:04 +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: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jmx5UcOrpux4d1MrThN9O+kCWai0Xlxr7nWB+bA954s=; b=LBSZm2LAdF95upcbucyCTmqfnu oPAARlqWnPcbfbDkDZ2mCUGr6ra4et6GQkljG7hJa/JAIYm7FEDwIgrRmSWJBBMkbct1EkfbRiqRY uAjseK1iE6hYiA7zTEW7NNoMNDHpi4ODPmKZysV1l0/wBtJmx3/1dF6z4LxX96QGlhhrk6RxKRmT2 vn97C8DPDO6k65bIMCpf1NjCXg49v8Yx6eLPN+LndYgDGtZ/rjIn5Qgg7dE+hSUQzydpOvkoYl/CT O/kK8Q37hW+lX3dbwrzQ501iaF2gj9WBnIbBzLyCy1qBoXAZpIrKftOkuRHru1dDUGIcIUUJHqgGj tI+wdbXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wX0uf-00000006Ai0-1fSJ; Tue, 09 Jun 2026 18:10:57 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wX0ub-00000006AeM-1KBI for linux-arm-kernel@lists.infradead.org; Tue, 09 Jun 2026 18:10:54 +0000 Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 70A1020B716A; Tue, 9 Jun 2026 11:10:31 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 70A1020B716A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1781028631; bh=jmx5UcOrpux4d1MrThN9O+kCWai0Xlxr7nWB+bA954s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=flAMBILgJKbjXrzYbl8Y3HanKjS+aZMiU6Py9nK9hVO3T8/Bn4kLLfOI541WKjmdJ n1+qzlT4JM4ExR9QYTh0wlY6wYrPnMVe0ohWv6B6gPZrtMDzEcT+GBrWPmdAsdsA1l 5CYCS0kq4MrHLuyoZ5/B0jCh5uS11M1XkQpyslBI= From: Kameron Carr To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com Cc: catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, lpieralisi@kernel.org, sudeep.holla@kernel.org, arnd@arndb.de, thuth@redhat.com, linux-hyperv@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, mhklinux@outlook.com Subject: [RFC PATCH 1/6] arm64: rsi: Add RSI host call structure and helper function Date: Tue, 9 Jun 2026 11:10:25 -0700 Message-ID: <20260609181030.2378391-2-kameroncarr@linux.microsoft.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260609181030.2378391-1-kameroncarr@linux.microsoft.com> References: <20260609181030.2378391-1-kameroncarr@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260609_111053_434935_E6AF3807 X-CRM114-Status: GOOD ( 10.57 ) 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 Add struct rsi_host_call to rsi_smc.h, which represents the host call data structure used by the Realm Management Monitor (RMM) for the RSI_HOST_CALL interface. The structure contains a 16-bit immediate field and 31 general-purpose register values, aligned to 256 bytes as required by the CCA RMM specification. Add rsi_host_call() static inline wrapper in rsi_cmds.h that invokes SMC_RSI_HOST_CALL with the physical address of the host call structure. This will be used by Hyper-V guest code to route hypercalls through the RSI interface when running inside an Arm CCA Realm. Signed-off-by: Kameron Carr --- arch/arm64/include/asm/rsi_cmds.h | 9 +++++++++ arch/arm64/include/asm/rsi_smc.h | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/arch/arm64/include/asm/rsi_cmds.h b/arch/arm64/include/asm/rsi_cmds.h index 2c8763876dfb7..83b4b1f598454 100644 --- a/arch/arm64/include/asm/rsi_cmds.h +++ b/arch/arm64/include/asm/rsi_cmds.h @@ -159,4 +159,13 @@ static inline unsigned long rsi_attestation_token_continue(phys_addr_t granule, return res.a0; } +static inline long rsi_host_call(phys_addr_t host_call_struct) +{ + struct arm_smccc_res res; + + arm_smccc_smc(SMC_RSI_HOST_CALL, host_call_struct, 0, 0, 0, 0, 0, 0, + &res); + return res.a0; +} + #endif /* __ASM_RSI_CMDS_H */ diff --git a/arch/arm64/include/asm/rsi_smc.h b/arch/arm64/include/asm/rsi_smc.h index e19253f96c940..ffea93340ed7f 100644 --- a/arch/arm64/include/asm/rsi_smc.h +++ b/arch/arm64/include/asm/rsi_smc.h @@ -142,6 +142,12 @@ struct realm_config { */ } __aligned(0x1000); +struct rsi_host_call { + u16 immediate; + u64 gprs[31]; +} __aligned(256); +static_assert(sizeof(struct rsi_host_call) == 256); + #endif /* __ASSEMBLER__ */ /* -- 2.45.4