From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8B44606A323 for ; Sat, 31 Oct 2026 00:14:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=FnDg2AWQ; dkim=pass (1024-bit key, unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=Qkjkp2nz 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-Unsubscribe-Post: List-Owner; bh=F0MO/r8a7BDsMhBk/mJgC+1OZlbLoLJX/Mq8zb5p8N0=; b=FnDg2AWQ6oqdvq 3S4RViwX0JE4cc/IdeZ0DLRsq06jw7RnyoTbwc64BAnXko3tl9IxBfLX/mED2++GL9TBkBPoXZRjm swGpXck8rqfz+JCnKTdEGnNJYpIsEf6dqj4MSgtxVWz/lSxeNvWX91NonuCapzCS/H7AnsMnNmZlL //FB5VcxT4uGe8R1OHSFJRLO2dVhl0+FWBzVIagXhyGjQYvSTgCTPf5DPaYQ2ErzKFPgaHehvoBqY wnLUT5/rpn9O79ql5+tqCJ1HhTvg7+5hL+grhgbBn7rUQ701CrpJChWBfAxjW7T8jCNDPPYAJQVI9 UiyoECjDUhr7npiXnTZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xMwkH-0000000CliO-3lyp; Sat, 31 Oct 2026 00:14:53 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xMwk3-0000000ClcT-3clU for linux-arm-kernel@lists.infradead.org; Sat, 31 Oct 2026 00:14:41 +0000 Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 3635020B7167; Fri, 30 Oct 2026 17:14:25 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3635020B7167 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1793405665; bh=F0MO/r8a7BDsMhBk/mJgC+1OZlbLoLJX/Mq8zb5p8N0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qkjkp2nzb58p4oICzVWbFicUYCtdPx1YoR/WfLfHUOpuM+/o0d/ETLxeajUlc+u5Q 7WrNZk+P0DwLzDM2SBEMCzuX0Le8FXPmLzmesXQ83lZjAT+95/GwGM1fhlOvRfpSuN 6TaOsDYmhwaEYoDuTEzQ9JwcdahwNE5A8W87XJC8= From: Kameron Carr To: decui@microsoft.com, haiyangz@microsoft.com, mhklinux@outlook.com, wei.liu@kernel.org Cc: arnd@arndb.de, catalin.marinas@arm.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, lpieralisi@kernel.org, mark.rutland@arm.com, sudeep.holla@kernel.org, thuth@redhat.com, will@kernel.org Subject: [PATCH v6 1/6] arm64: rsi: Add RSI host call structure and helper function Date: Fri, 30 Oct 2026 17:14:07 -0700 Message-ID: <20261031001412.4150488-2-kameroncarr@linux.microsoft.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20261031001412.4150488-1-kameroncarr@linux.microsoft.com> References: <20261031001412.4150488-1-kameroncarr@linux.microsoft.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261030_171439_927292_3296C061 X-CRM114-Status: GOOD ( 10.92 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Add struct rsi_host_call to arm-smccc-rsi.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 arm-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. Reviewed-by: Michael Kelley Signed-off-by: Kameron Carr --- include/linux/arm-rsi-cmds.h | 22 ++++++++++++++++++++++ include/linux/arm-smccc-rsi.h | 7 +++++++ 2 files changed, 29 insertions(+) diff --git a/include/linux/arm-rsi-cmds.h b/include/linux/arm-rsi-cmds.h index 3f7a6a8..01d292e 100644 --- a/include/linux/arm-rsi-cmds.h +++ b/include/linux/arm-rsi-cmds.h @@ -236,4 +236,26 @@ static inline unsigned long rsi_attestation_token_continue(phys_addr_t granule, return res.a0; } +/** + * rsi_host_call - Make a Host call. + * @host_call_struct: IPA of host call structure + * + * This call will fail if the IPA of the host call structure: + * * is not aligned to 256 bytes, + * * is not protected / encrypted, + * * is RIPAS_EMPTY + * + * Returns: + * On success, returns RSI_SUCCESS. + * Otherwise, returns an error code. + */ +static inline unsigned 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 /* __LINUX_ARM_RSI_CMDS_H_ */ diff --git a/include/linux/arm-smccc-rsi.h b/include/linux/arm-smccc-rsi.h index fddb779..4c8530b 100644 --- a/include/linux/arm-smccc-rsi.h +++ b/include/linux/arm-smccc-rsi.h @@ -142,6 +142,13 @@ struct realm_config { */ } __aligned(0x1000); +struct rsi_host_call { + u16 immediate; + u8 _padding[6]; + u64 gprs[31]; +} __aligned(256); +static_assert(sizeof(struct rsi_host_call) == 256); + #endif /* __ASSEMBLER__ */ /* -- 2.45.4