From nobody Sat Jul 25 00:15:20 2026 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53E0B471414; Tue, 21 Jul 2026 20:12:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784664722; cv=none; b=NZaXsRAig22M697+gEsHX4nk7Gx0KmeVCN5ThgnFlkKqgV9r70SUOVII2kUA8DgBZdWaPUcmbQlaOe6wViTTC0rrpk8Zcdhd9iX8F/PvlqmZfeJuCTRPuJhYIhtnZp2+u4/BGJMLUpJbsWPDyD8MqOluZMeoKlLDdP4ecQBLBx8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784664722; c=relaxed/simple; bh=fUUKFmrbIiUef74AOCNqccPziLzJSdWvp3e05UVA26M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZJq0+J2wUACcQhHI9UCiyLBmsQEPdHmuoatfAEFm+OI3Vn4MhdRJkn+dsD0Hrdzvc5oHDufB8pKkMqn7u/P0REZjJmWNT4CWrBU9PdU2rGPjhHp6dX+3SsCyhKr8kUPEW2bD1xSXRjbI6tlnJhion+oSXOQhM6aVWf15PPj5i1A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=UfS1Atu3; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="UfS1Atu3" Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id B733920B7169; Tue, 21 Jul 2026 13:11:48 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B733920B7169 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1784664708; bh=NzRxQvPwzEBTlATkVCaj62V6KcKKHvmr0KtL0Tzs39U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UfS1Atu3Wowgk10zeXgEIgTu37K9NoSb2lkAiXA2hScmc7MkfNud5qkK4vQjfvtPy WLdQIrtHXwNX30i++mrUegeXIpIbuJk4Bx/cbCpzUZgfeep1jGy/iTekgr+zLu/ONc zt8EUnUg7PyXvRDx/HkPWQLnHEyK1Y203XgfnECk= From: Kameron Carr To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com, mhklinux@outlook.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 Subject: [PATCH v3 1/6] arm64: rsi: Add RSI host call structure and helper function Date: Tue, 21 Jul 2026 13:11:43 -0700 Message-ID: <20260721201148.1441143-2-kameroncarr@linux.microsoft.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260721201148.1441143-1-kameroncarr@linux.microsoft.com> References: <20260721201148.1441143-1-kameroncarr@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 | 22 ++++++++++++++++++++++ arch/arm64/include/asm/rsi_smc.h | 7 +++++++ 2 files changed, 29 insertions(+) diff --git a/arch/arm64/include/asm/rsi_cmds.h b/arch/arm64/include/asm/rsi= _cmds.h index 2c8763876dfb7..9daf8008e5da2 100644 --- a/arch/arm64/include/asm/rsi_cmds.h +++ b/arch/arm64/include/asm/rsi_cmds.h @@ -88,6 +88,28 @@ static inline long rsi_set_addr_range_state(phys_addr_t = start, return res.a0; } =20 +/** + * 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; +} + /** * rsi_attestation_token_init - Initialise the operation to retrieve an * attestation token. diff --git a/arch/arm64/include/asm/rsi_smc.h b/arch/arm64/include/asm/rsi_= smc.h index e19253f96c940..9cc57b5be0c02 100644 --- a/arch/arm64/include/asm/rsi_smc.h +++ b/arch/arm64/include/asm/rsi_smc.h @@ -142,6 +142,13 @@ struct realm_config { */ } __aligned(0x1000); =20 +struct rsi_host_call { + u16 immediate; + u8 _padding[6]; + u64 gprs[31]; +} __aligned(256); +static_assert(sizeof(struct rsi_host_call) =3D=3D 256); + #endif /* __ASSEMBLER__ */ =20 /* --=20 2.45.4 From nobody Sat Jul 25 00:15:20 2026 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF923471268; Tue, 21 Jul 2026 20:12:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784664723; cv=none; b=jRDk3/ge0QYFbNomoipSvkjBHD2DvZb0hqHMOjzfDLRlBGguiUf24zU42KCzVvjot+Zrp1AQXXZaVf/MZvesUbKccnrjkBj4XOmXmexJzJFcdiGJev/BLe7Vo4QzGd4tIyF0HQPISSJOAguRQ69fJD33GeUXMPkPLqX81MXwpkU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784664723; c=relaxed/simple; bh=kTuJntn4d9d0VGuQeorErJTBpqNewh53BBll6mgZMLU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SDVi7FbJkA43SRpfqc1dOU+vXGlXmEVWqv5x4chWtujDYhFv+h1AHVMishYAZ2F1nj/FJJ07APdfXhPS4m1aTN1FvO1gF1RlivbB0RadyvGDyEc0M+Mg6Yuj1QGRdE0mL4Y83wufXUbHorLkUr0kwY798yVCz16tbYr6e9zdZtI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=hnpKnP6Z; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="hnpKnP6Z" Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 1B9F820B716A; Tue, 21 Jul 2026 13:11:49 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1B9F820B716A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1784664709; bh=pCGLDie0xV9RJpzuDsm4ooq0RYqsnGfSauPh4xAqSiU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hnpKnP6Z4zrW2K8tIRM/j8EXiwFFtaqRbEJ5pOheySz+xbkbBIul05cTGVe5go2XA 7xdZYAPC9iwhbq3aKXB9sWNeYId3epPSM+bg2ht7daHWf7z3LiYprPFf14finkHt+S iTOr/00eNxCYcZpfmagALucxS6gxwulldG1OPKyQ= From: Kameron Carr To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com, mhklinux@outlook.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 Subject: [PATCH v3 2/6] firmware: smccc: Detect hypervisor via RSI host call in CCA Realms Date: Tue, 21 Jul 2026 13:11:44 -0700 Message-ID: <20260721201148.1441143-3-kameroncarr@linux.microsoft.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260721201148.1441143-1-kameroncarr@linux.microsoft.com> References: <20260721201148.1441143-1-kameroncarr@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Modify arm_smccc_hypervisor_has_uuid() to check is_realm_world() and use rsi_host_call() to query the hypervisor vendor UUID when inside a Realm. The realm path is factored into a helper, arm_smccc_realm_get_hypervisor_uuid(), that owns a file-static rsi_host_call buffer (uuid_hc) serialized by a spinlock. The RSI-specific includes, file-static state and helper are guarded with CONFIG_ARM64 because does not exist on 32-bit ARM. For non-Realm environments, the existing arm_smccc_1_1_invoke() path is unchanged. Signed-off-by: Kameron Carr --- drivers/firmware/smccc/smccc.c | 41 +++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/smccc/smccc.c b/drivers/firmware/smccc/smccc.c index bdee057db2fd3..a876b7aa2dc99 100644 --- a/drivers/firmware/smccc/smccc.c +++ b/drivers/firmware/smccc/smccc.c @@ -12,6 +12,12 @@ #include #include =20 +#ifdef CONFIG_ARM64 +#include +#include +#include +#endif + static u32 smccc_version =3D ARM_SMCCC_VERSION_1_0; static enum arm_smccc_conduit smccc_conduit =3D SMCCC_CONDUIT_NONE; =20 @@ -67,12 +73,45 @@ s32 arm_smccc_get_soc_id_revision(void) } EXPORT_SYMBOL_GPL(arm_smccc_get_soc_id_revision); =20 +#ifdef CONFIG_ARM64 +static struct rsi_host_call uuid_hc; +static DEFINE_SPINLOCK(uuid_hc_lock); + +/* + * Helper function to get the hypervisor UUID via an RsiHostCall. + */ +static void arm_smccc_realm_get_hypervisor_uuid(struct arm_smccc_res *res) +{ + guard(spinlock_irqsave)(&uuid_hc_lock); + + memset(&uuid_hc, 0, sizeof(uuid_hc)); + uuid_hc.gprs[0] =3D ARM_SMCCC_VENDOR_HYP_CALL_UID_FUNC_ID; + + if (rsi_host_call(__pa_symbol(&uuid_hc)) !=3D RSI_SUCCESS) { + res->a0 =3D SMCCC_RET_NOT_SUPPORTED; + return; + } + + res->a0 =3D uuid_hc.gprs[0]; + res->a1 =3D uuid_hc.gprs[1]; + res->a2 =3D uuid_hc.gprs[2]; + res->a3 =3D uuid_hc.gprs[3]; +} +#endif + bool arm_smccc_hypervisor_has_uuid(const uuid_t *hyp_uuid) { struct arm_smccc_res res =3D {}; uuid_t uuid; =20 - arm_smccc_1_1_invoke(ARM_SMCCC_VENDOR_HYP_CALL_UID_FUNC_ID, &res); +#ifdef CONFIG_ARM64 + if (is_realm_world()) + arm_smccc_realm_get_hypervisor_uuid(&res); + else +#endif + arm_smccc_1_1_invoke(ARM_SMCCC_VENDOR_HYP_CALL_UID_FUNC_ID, + &res); + if (res.a0 =3D=3D SMCCC_RET_NOT_SUPPORTED) return false; =20 --=20 2.45.4 From nobody Sat Jul 25 00:15:20 2026 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 25EFD24A078; Tue, 21 Jul 2026 20:12:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784664723; cv=none; b=q/7zVSeyff+YAT9Wxo5hD0c0lyRhb/X7w+MiNMmxDKdFFDjSKQUJddzIfbFeNrRNn5qSi2Vxup1GFCwvaB7gpV2fAf221926L3qo0QByR6vbymazTwCJKdrpV+ypRlXExNg6d8tNXTl3EKK6ZGlnbdY5ySJlIQ/nebtSHbtMtGQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784664723; c=relaxed/simple; bh=xllpSNY07Klwb2QSbfyVOvU4kg1HncEwfluna0fojqc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MDKIfpGkoI8EoUdw7cHpCdwLNYU8HhuykaXg8VrvTM3ocFdZwq5TQECfhoxiRyytcbz5AcrnacpHZSH8grFqRtYREJ+a64fZzd5i0J+9NZRVaxm345ONZA+mkeYSwZP56oS2NUFDBNOkWl6kU5y3R1pRDAw8JBdRX87IF8EKr6A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=OcMZaueP; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="OcMZaueP" Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 7AB6620B716B; Tue, 21 Jul 2026 13:11:49 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7AB6620B716B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1784664709; bh=t7NOYoDMT6olxFGzw60Smpmuq9Zq1rekedT00peWm3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OcMZauePWoDDcioo+fKZkPIg6YsAwq9f2vkYGR9KkPI52rBlLlPReViUvcFVV/OdD f8xbRMLVcXbRvtZLpFsaaRb1B8Oyy851fiI0J5MFAR0r4LvbT9kd5JDXp1hYzpAA2O gJ0FKXQsincFzFuxcP3fXSPsJBfTu7tiOeq/FT5Y= From: Kameron Carr To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com, mhklinux@outlook.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 Subject: [PATCH v3 3/6] arm64: hyperv: Add per-CPU RSI host call infrastructure for CCA Realms Date: Tue, 21 Jul 2026 13:11:45 -0700 Message-ID: <20260721201148.1441143-4-kameroncarr@linux.microsoft.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260721201148.1441143-1-kameroncarr@linux.microsoft.com> References: <20260721201148.1441143-1-kameroncarr@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Arm CCA Realms cannot issue Hyper-V hypercalls via HVC; the guest must route them through the RSI_HOST_CALL interface, which takes the IPA of a per-CPU rsi_host_call structure as its argument. Add hv_hostcall_array as a per-CPU struct array and allocate it during hyperv_init(). The allocation is gated on is_realm_world() so non-Realm arm64 Hyper-V guests pay no memory cost. Signed-off-by: Kameron Carr --- arch/arm64/hyperv/mshyperv.c | 28 ++++++++++++++++++++++++++-- arch/arm64/include/asm/mshyperv.h | 4 ++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/arch/arm64/hyperv/mshyperv.c b/arch/arm64/hyperv/mshyperv.c index 4fdc26ade1d74..d9010e64ddd7c 100644 --- a/arch/arm64/hyperv/mshyperv.c +++ b/arch/arm64/hyperv/mshyperv.c @@ -15,10 +15,15 @@ #include #include #include +#include #include +#include =20 static bool hyperv_initialized; =20 +struct rsi_host_call *hv_hostcall_array; +EXPORT_SYMBOL_GPL(hv_hostcall_array); + int hv_get_hypervisor_version(union hv_hypervisor_version_info *info) { hv_get_vpreg_128(HV_REGISTER_HYPERVISOR_VERSION, @@ -85,6 +90,20 @@ static int __init hyperv_init(void) if (!hyperv_detect_via_acpi() && !hyperv_detect_via_smccc()) return 0; =20 + /* + * The RSI host-call buffers are only ever used when + * is_realm_world() is true. Skip the allocation on non-Realm + * guests. A single contiguous array of nr_cpu_ids entries is + * allocated; each CPU indexes into it by its processor ID. + */ + if (is_realm_world()) { + hv_hostcall_array =3D kcalloc(nr_cpu_ids, + sizeof(struct rsi_host_call), + GFP_KERNEL); + if (!hv_hostcall_array) + return -ENOMEM; + } + /* Setup the guest ID */ guest_id =3D hv_generate_guest_id(LINUX_VERSION_CODE); hv_set_vpreg(HV_REGISTER_GUEST_OS_ID, guest_id); @@ -106,13 +125,13 @@ static int __init hyperv_init(void) =20 ret =3D hv_common_init(); if (ret) - return ret; + goto free_hostcall_mem; =20 ret =3D cpuhp_setup_state(CPUHP_AP_HYPERV_ONLINE, "arm64/hyperv_init:onli= ne", hv_common_cpu_init, hv_common_cpu_die); if (ret < 0) { hv_common_free(); - return ret; + goto free_hostcall_mem; } =20 if (ms_hyperv.priv_high & HV_ACCESS_PARTITION_ID) @@ -125,6 +144,11 @@ static int __init hyperv_init(void) =20 hyperv_initialized =3D true; return 0; + +free_hostcall_mem: + kfree(hv_hostcall_array); + hv_hostcall_array =3D NULL; + return ret; } =20 early_initcall(hyperv_init); diff --git a/arch/arm64/include/asm/mshyperv.h b/arch/arm64/include/asm/msh= yperv.h index b721d3134ab66..aed0aa526c8b4 100644 --- a/arch/arm64/include/asm/mshyperv.h +++ b/arch/arm64/include/asm/mshyperv.h @@ -61,6 +61,10 @@ static inline u64 hv_get_non_nested_msr(unsigned int reg) ARM_SMCCC_OWNER_VENDOR_HYP, \ HV_SMCCC_FUNC_NUMBER) =20 +/* Per-CPU-indexed RSI host call structures for CCA Realms */ +struct rsi_host_call; +extern struct rsi_host_call *hv_hostcall_array; + #include =20 #endif --=20 2.45.4 From nobody Sat Jul 25 00:15:20 2026 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E7C147141F; Tue, 21 Jul 2026 20:12:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784664724; cv=none; b=gKN8P2PjWqhQQ4HlfvtVI1HZunsKN8P/k78Brlq484v1GT1UgxIWle4/SyZZ0pdEbaQeHUyxjZcMIMg4KBrhYD+D77KXfUXQS3N1lzg4A788ZXHZkhLTtwqyHpEerNG8220JFal/c6w+Fqm2CnxePrBoKNaRT6ykPT3XEAaixA0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784664724; c=relaxed/simple; bh=s6wQ9Xl1XfGZZnTw//2J80/dNgNzpgeeCf8LuiQVvTc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uAGOxoS+cjQdGNv1IAa105vArLQdQbcybHnIYOisJx7NhDnMMhDWZU7KzJcdzH6xGn2dRAoJdSDWug3kCnRh04AMopn4wdk5411+ReaKnERuALDfAKRcu94nWfCzaRPhReEiRBEE/9hnTVO2PlAuUC+r+lU1AolXFFV6cziM9fU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=Pf5nWZaI; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="Pf5nWZaI" Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id D086E20B716C; Tue, 21 Jul 2026 13:11:49 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com D086E20B716C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1784664709; bh=Kk/2KkWJzHvubI9offRuTvqOrLc6Xr9BeIC2xwWQOJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pf5nWZaI5QpT5NilcX0u5CHWCDSz9QbY1dAA4/nfhhU9M2F0OI1x1y5pDJ0rLccUc T6ZFG366G3Ro1XTVieGTqe+OMn4iBLL3RgW02S3urr08sVGOmDROOQKASsLymEFKKH GIevpKVeCEQHihpWpyjeodPkTXniP0G6xWWUa6+M= From: Kameron Carr To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com, mhklinux@outlook.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 Subject: [PATCH v3 4/6] Drivers: hv: Mark shared memory as decrypted for CCA Realms Date: Tue, 21 Jul 2026 13:11:46 -0700 Message-ID: <20260721201148.1441143-5-kameroncarr@linux.microsoft.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260721201148.1441143-1-kameroncarr@linux.microsoft.com> References: <20260721201148.1441143-1-kameroncarr@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In hv_common_cpu_init(), the per-CPU hypercall input/output pages need to be marked as decrypted (shared) for confidential VM isolation types. This is already done for SNP and TDX isolation; extend the same handling to Arm CCA Realm guests so that the host hypervisor can access the shared hypercall buffers. is_realm_world() is only declared in arch/arm64/include/asm/rsi.h, so using it directly in the arch-neutral drivers/hv/hv_common.c would break the x86 build. Introduce a Hyper-V-specific helper following the established hv_isolation_type_snp() / hv_isolation_type_tdx() pattern. On architectures other than arm64 the weak default keeps the existing behaviour. Signed-off-by: Kameron Carr --- arch/arm64/hyperv/mshyperv.c | 5 +++++ drivers/hv/hv_common.c | 17 +++++++++++++---- include/asm-generic/mshyperv.h | 1 + 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/arch/arm64/hyperv/mshyperv.c b/arch/arm64/hyperv/mshyperv.c index d9010e64ddd7c..8519f694f2897 100644 --- a/arch/arm64/hyperv/mshyperv.c +++ b/arch/arm64/hyperv/mshyperv.c @@ -158,3 +158,8 @@ bool hv_is_hyperv_initialized(void) return hyperv_initialized; } EXPORT_SYMBOL_GPL(hv_is_hyperv_initialized); + +bool hv_isolation_type_cca(void) +{ + return is_realm_world(); +} diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c index 6b67ac6167891..0f9412fcb9571 100644 --- a/drivers/hv/hv_common.c +++ b/drivers/hv/hv_common.c @@ -476,6 +476,7 @@ int hv_common_cpu_init(unsigned int cpu) u64 msr_vp_index; gfp_t flags; const int pgcount =3D hv_output_page_exists() ? 2 : 1; + const size_t alloc_size =3D ALIGN((size_t)pgcount * HV_HYP_PAGE_SIZE, PAG= E_SIZE); void *mem; int ret =3D 0; =20 @@ -489,7 +490,7 @@ int hv_common_cpu_init(unsigned int cpu) * online and then taken offline */ if (!*inputarg) { - mem =3D kmalloc_array(pgcount, HV_HYP_PAGE_SIZE, flags); + mem =3D kmalloc(alloc_size, flags); if (!mem) return -ENOMEM; =20 @@ -499,14 +500,16 @@ int hv_common_cpu_init(unsigned int cpu) } =20 if (!ms_hyperv.paravisor_present && - (hv_isolation_type_snp() || hv_isolation_type_tdx())) { - ret =3D set_memory_decrypted((unsigned long)mem, pgcount); + (hv_isolation_type_snp() || hv_isolation_type_tdx() || + hv_isolation_type_cca())) { + ret =3D set_memory_decrypted((unsigned long)mem, + alloc_size >> PAGE_SHIFT); if (ret) { /* It may be unsafe to free 'mem' */ return ret; } =20 - memset(mem, 0x00, pgcount * HV_HYP_PAGE_SIZE); + memset(mem, 0x00, alloc_size); } =20 /* @@ -666,6 +669,12 @@ bool __weak hv_isolation_type_tdx(void) } EXPORT_SYMBOL_GPL(hv_isolation_type_tdx); =20 +bool __weak hv_isolation_type_cca(void) +{ + return false; +} +EXPORT_SYMBOL_GPL(hv_isolation_type_cca); + void __weak hv_setup_vmbus_handler(void (*handler)(void)) { } diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h index bf601d67cecb9..1fa79abce743c 100644 --- a/include/asm-generic/mshyperv.h +++ b/include/asm-generic/mshyperv.h @@ -79,6 +79,7 @@ u64 hv_do_fast_hypercall16(u16 control, u64 input1, u64 i= nput2); =20 bool hv_isolation_type_snp(void); bool hv_isolation_type_tdx(void); +bool hv_isolation_type_cca(void); =20 /* * On architectures where Hyper-V doesn't support AEOI (e.g., ARM64), --=20 2.45.4 From nobody Sat Jul 25 00:15:20 2026 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CC99472529; Tue, 21 Jul 2026 20:12:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784664724; cv=none; b=UD2MAcmg9B6k2zgpkxkIRFdHZ7PJg4I1p4wCaE7AOH5mF4oVbVkh4J54iQp5EwUAvHIlt/MI+BxTCggmfkaiddakintCKrgO45x3/qh2URxW6tBtsn8kXT458a/y1ySSfwn8raZlBYRvS7NyT9kJM/sLowsnWwJ9ku7rkS/hH9w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784664724; c=relaxed/simple; bh=wpjck5Ya2DsDfCGJPG4vm+8bcScyNpEpMLWvHxca/Bc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UdRKtSSaV2zpxz/ztDv7cbTPRlvgJpfF+y1lryVSuOdzfccOqqbCMzzD/qF4NDL45qDBiIC0mCceV5mL3yMqp5m0hzdIsW+XZR7VoNGoh5caZVpdi3QL4UeCjBSiypuWcrpct8k2p1GGixgtSS5MH4G4UPdtMbVpqGceRMy6UmA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=fvNRlnir; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="fvNRlnir" Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 3DAEF20B716D; Tue, 21 Jul 2026 13:11:50 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3DAEF20B716D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1784664710; bh=WinnC+elao/6KfT3ISKBQMmx/JrCmROo1EZBJFHsDq8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fvNRlnirBRbbws3W6cxE5ceoed1DgW11HmTsxS9NcApwKuWy1maQu1XUbcfooKktQ q+stYyM4J7nURKyK+dqUY2NUmK0ZB60veKFtvL+VxMEfOdU55URO8+ciclRdkWQPDI oaHsDo/UfQb73IsljmQoKBuv8ohY6iFYCnL72NkY= From: Kameron Carr To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com, mhklinux@outlook.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 Subject: [PATCH v3 5/6] arm64: hyperv: Route hypercalls through RSI host call in CCA Realms Date: Tue, 21 Jul 2026 13:11:47 -0700 Message-ID: <20260721201148.1441143-6-kameroncarr@linux.microsoft.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260721201148.1441143-1-kameroncarr@linux.microsoft.com> References: <20260721201148.1441143-1-kameroncarr@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Modify the five hypercall wrapper functions to check is_realm_world() and use the per-CPU rsi_host_call structure when inside a Realm. Signed-off-by: Kameron Carr --- arch/arm64/hyperv/hv_core.c | 155 ++++++++++++++++++++++++++++-------- 1 file changed, 121 insertions(+), 34 deletions(-) diff --git a/arch/arm64/hyperv/hv_core.c b/arch/arm64/hyperv/hv_core.c index e33a9e3c366a1..77cba08fca132 100644 --- a/arch/arm64/hyperv/hv_core.c +++ b/arch/arm64/hyperv/hv_core.c @@ -13,9 +13,41 @@ #include #include #include +#include #include #include #include +#include + +/* + * hv_do_rsi_hypercall - Helper function to invoke a hypercall from a + * Realm world using the RSI interface. + */ +static u64 hv_do_rsi_hypercall(u64 control, u64 input1, u64 input2) +{ + struct rsi_host_call *hostcall; + unsigned long flags; + u64 ret; + + if (!hv_hostcall_array) + return HV_STATUS_INVALID_HYPERCALL_INPUT; + + local_irq_save(flags); + hostcall =3D &hv_hostcall_array[smp_processor_id()]; + memset(hostcall, 0, sizeof(*hostcall)); + hostcall->gprs[0] =3D HV_FUNC_ID; + hostcall->gprs[1] =3D control; + hostcall->gprs[2] =3D input1; + hostcall->gprs[3] =3D input2; + + if (rsi_host_call(virt_to_phys(hostcall)) =3D=3D RSI_SUCCESS) + ret =3D hostcall->gprs[0]; + else + ret =3D HV_STATUS_INVALID_HYPERCALL_INPUT; + + local_irq_restore(flags); + return ret; +} =20 /* * hv_do_hypercall- Invoke the specified hypercall @@ -29,8 +61,11 @@ u64 hv_do_hypercall(u64 control, void *input, void *outp= ut) input_address =3D input ? virt_to_phys(input) : 0; output_address =3D output ? virt_to_phys(output) : 0; =20 - arm_smccc_1_1_hvc(HV_FUNC_ID, control, - input_address, output_address, &res); + if (is_realm_world()) + return hv_do_rsi_hypercall(control, input_address, output_address); + + arm_smccc_1_1_hvc(HV_FUNC_ID, control, input_address, + output_address, &res); return res.a0; } EXPORT_SYMBOL_GPL(hv_do_hypercall); @@ -48,6 +83,9 @@ u64 hv_do_fast_hypercall8(u16 code, u64 input) =20 control =3D (u64)code | HV_HYPERCALL_FAST_BIT; =20 + if (is_realm_world()) + return hv_do_rsi_hypercall(control, input, 0); + arm_smccc_1_1_hvc(HV_FUNC_ID, control, input, &res); return res.a0; } @@ -65,6 +103,9 @@ u64 hv_do_fast_hypercall16(u16 code, u64 input1, u64 inp= ut2) =20 control =3D (u64)code | HV_HYPERCALL_FAST_BIT; =20 + if (is_realm_world()) + return hv_do_rsi_hypercall(control, input1, input2); + arm_smccc_1_1_hvc(HV_FUNC_ID, control, input1, input2, &res); return res.a0; } @@ -76,24 +117,44 @@ EXPORT_SYMBOL_GPL(hv_do_fast_hypercall16); void hv_set_vpreg(u32 msr, u64 value) { struct arm_smccc_res res; + struct rsi_host_call *hostcall; + unsigned long flags; + u64 status; =20 - arm_smccc_1_1_hvc(HV_FUNC_ID, - HVCALL_SET_VP_REGISTERS | HV_HYPERCALL_FAST_BIT | - HV_HYPERCALL_REP_COMP_1, - HV_PARTITION_ID_SELF, - HV_VP_INDEX_SELF, - msr, - 0, - value, - 0, - &res); + if (is_realm_world()) { + local_irq_save(flags); + hostcall =3D &hv_hostcall_array[smp_processor_id()]; + memset(hostcall, 0, sizeof(*hostcall)); + hostcall->gprs[0] =3D HV_FUNC_ID; + hostcall->gprs[1] =3D HVCALL_SET_VP_REGISTERS | + HV_HYPERCALL_FAST_BIT | + HV_HYPERCALL_REP_COMP_1; + hostcall->gprs[2] =3D HV_PARTITION_ID_SELF; + hostcall->gprs[3] =3D HV_VP_INDEX_SELF; + hostcall->gprs[4] =3D msr; + hostcall->gprs[6] =3D value; + + if (rsi_host_call(virt_to_phys(hostcall)) =3D=3D RSI_SUCCESS) + status =3D hostcall->gprs[0]; + else + status =3D HV_STATUS_INVALID_HYPERCALL_INPUT; + local_irq_restore(flags); + } else { + arm_smccc_1_1_hvc(HV_FUNC_ID, + HVCALL_SET_VP_REGISTERS | + HV_HYPERCALL_FAST_BIT | + HV_HYPERCALL_REP_COMP_1, + HV_PARTITION_ID_SELF, HV_VP_INDEX_SELF, msr, + 0, value, 0, &res); + status =3D res.a0; + } =20 /* - * Something is fundamentally broken in the hypervisor if - * setting a VP register fails. There's really no way to - * continue as a guest VM, so panic. + * Something is fundamentally broken in the hypervisor (or, in a + * Realm, the RMM denied the host call) if setting a VP register + * fails. There's really no way to continue as a guest VM, so panic. */ - BUG_ON(!hv_result_success(res.a0)); + BUG_ON(!hv_result_success(status)); } EXPORT_SYMBOL_GPL(hv_set_vpreg); =20 @@ -108,29 +169,55 @@ void hv_get_vpreg_128(u32 msr, struct hv_get_vp_regis= ters_output *result) { struct arm_smccc_1_2_regs args; struct arm_smccc_1_2_regs res; + struct rsi_host_call *hostcall; + unsigned long flags; + u64 status; =20 - args.a0 =3D HV_FUNC_ID; - args.a1 =3D HVCALL_GET_VP_REGISTERS | HV_HYPERCALL_FAST_BIT | - HV_HYPERCALL_REP_COMP_1; - args.a2 =3D HV_PARTITION_ID_SELF; - args.a3 =3D HV_VP_INDEX_SELF; - args.a4 =3D msr; + if (is_realm_world()) { + local_irq_save(flags); + hostcall =3D &hv_hostcall_array[smp_processor_id()]; + memset(hostcall, 0, sizeof(*hostcall)); =20 - /* - * Use the SMCCC 1.2 interface because the results are in registers - * beyond X0-X3. - */ - arm_smccc_1_2_hvc(&args, &res); + hostcall->gprs[0] =3D HV_FUNC_ID; + hostcall->gprs[1] =3D HVCALL_GET_VP_REGISTERS | + HV_HYPERCALL_FAST_BIT | + HV_HYPERCALL_REP_COMP_1; + hostcall->gprs[2] =3D HV_PARTITION_ID_SELF; + hostcall->gprs[3] =3D HV_VP_INDEX_SELF; + hostcall->gprs[4] =3D msr; + + if (rsi_host_call(virt_to_phys(hostcall)) =3D=3D RSI_SUCCESS) { + status =3D hostcall->gprs[0]; + result->as64.low =3D hostcall->gprs[6]; + result->as64.high =3D hostcall->gprs[7]; + } else { + status =3D HV_STATUS_INVALID_HYPERCALL_INPUT; + } + local_irq_restore(flags); + } else { + args.a0 =3D HV_FUNC_ID; + args.a1 =3D HVCALL_GET_VP_REGISTERS | HV_HYPERCALL_FAST_BIT | + HV_HYPERCALL_REP_COMP_1; + args.a2 =3D HV_PARTITION_ID_SELF; + args.a3 =3D HV_VP_INDEX_SELF; + args.a4 =3D msr; + + /* + * Use the SMCCC 1.2 interface because the results are in + * registers beyond X0-X3. + */ + arm_smccc_1_2_hvc(&args, &res); + status =3D res.a0; + result->as64.low =3D res.a6; + result->as64.high =3D res.a7; + } =20 /* - * Something is fundamentally broken in the hypervisor if - * getting a VP register fails. There's really no way to - * continue as a guest VM, so panic. + * Something is fundamentally broken in the hypervisor (or, in a + * Realm, the RMM denied the host call) if getting a VP register + * fails. There's really no way to continue as a guest VM, so panic. */ - BUG_ON(!hv_result_success(res.a0)); - - result->as64.low =3D res.a6; - result->as64.high =3D res.a7; + BUG_ON(!hv_result_success(status)); } EXPORT_SYMBOL_GPL(hv_get_vpreg_128); =20 --=20 2.45.4 From nobody Sat Jul 25 00:15:20 2026 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4D86A472531; Tue, 21 Jul 2026 20:12:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784664724; cv=none; b=SI1JDsDmcVHOMBm/sKRVcf12kdRN9AkPp0JLxRefH8kvpJF1cGMFlUmibJEVZGC+O94Yzi9vZivyyf0hpPXgFzQgQ5o1tvjPXRhnFu0OKkkAWzBEHYcmykypreMEoq9mNXAvkIPp4qLxGhX7D6SGBTgUSVOQYUtE6TVHM9owS14= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784664724; c=relaxed/simple; bh=OgegJIAodpym/AYW4WR7zSTxosj4X8LUj+bOE7mpQgg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pw8JmHHjssk4qXfDHGEGJLXiszLB5T0Rs/seGAulYovNo8DTnbP11t2w5c50zf62Sp03PKIl5Fx3aF0xVC1zLaxdjjK72sO5O5JkpKVkU0ixMANZTgvb2yRqBA6FXWfIMM6Jx2FRNaHcILBxgHrhUfOV5WcjVfVekw8oms6RWwI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=nbMx/SN+; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="nbMx/SN+" Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id B572420B716E; Tue, 21 Jul 2026 13:11:50 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B572420B716E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1784664710; bh=SQu+X8yGMFJ886Y/6SkzpbvtTHqaWWFjdm8ySRmrIgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nbMx/SN+1OwJBtSN4jVHReLeoKxQfb25mw1vi2YN+4ZxgqcBN8E7WjYyd9g/i4+lS bHBvGZJOdfTgniOEWqSqeTzCZXyQaAHav6G3Gvgetz4DxwiEZXaGO3RGzP3shrdfks WNvEVPvKgbCHdP5Pf4Jf54mZhUo86iWMQ+qI5U2g= From: Kameron Carr To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com, mhklinux@outlook.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 Subject: [PATCH v3 6/6] arm64: hyperv: Implement hv_is_isolation_supported() for CCA Realms Date: Tue, 21 Jul 2026 13:11:48 -0700 Message-ID: <20260721201148.1441143-7-kameroncarr@linux.microsoft.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260721201148.1441143-1-kameroncarr@linux.microsoft.com> References: <20260721201148.1441143-1-kameroncarr@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Provide an arm64 implementation of hv_is_isolation_supported() that overrides the __weak default in drivers/hv/hv_common.c. The implementation deliberately does not depend on hv_is_hyperv_initialized() because hv_common_init() consults hv_is_isolation_supported() before hyperv_initialized is set. Signed-off-by: Kameron Carr --- arch/arm64/hyperv/mshyperv.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/hyperv/mshyperv.c b/arch/arm64/hyperv/mshyperv.c index 8519f694f2897..e28612255a970 100644 --- a/arch/arm64/hyperv/mshyperv.c +++ b/arch/arm64/hyperv/mshyperv.c @@ -163,3 +163,8 @@ bool hv_isolation_type_cca(void) { return is_realm_world(); } + +bool hv_is_isolation_supported(void) +{ + return is_realm_world(); +} --=20 2.45.4