From nobody Sat Feb 7 06:55:05 2026 Received: from sender4-of-o52.zoho.com (sender4-of-o52.zoho.com [136.143.188.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B9702BCF5; Mon, 5 Jan 2026 12:29:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767616149; cv=pass; b=i1+1xVlEpyDPOO+uaPE3pyZqUZJSmlNNRX+4MJtse84ii0onokqhH28H+n/fIRJFNAMcrwkDpaAaRE/eFY2eTZl/YYGKeAexbhBd6TBGR8tFY8wtgdcLUaICwb0VLjPZCjnB/nQ7dVrrMHrmN8spfNdsDjTUV2T576dVKTJeF8Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767616149; c=relaxed/simple; bh=jOfgYQdOfDQsB+dPsbMOo+d4xs3UOnvcKU7FWQTD8p4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=R/rrVNUj1y1kHwjdxz0GHaKXvR15/OH8yNIpacTcU80/oJbOsJ6EfildjZICJs0/ku7kIrmgIMKDr/WBpRRUHQPgjTK4CZGBmn2uKroaxdzW8m2JOUicP8J8fAdmwsl1+ER8/Ops4IJfMzsUkuLsOrjfIJxIsMjJ37O90v5Dmgk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=anirudhrb.com; spf=pass smtp.mailfrom=anirudhrb.com; dkim=pass (1024-bit key) header.d=anirudhrb.com header.i=anirudh@anirudhrb.com header.b=jIDzPCnP; arc=pass smtp.client-ip=136.143.188.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=anirudhrb.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=anirudhrb.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=anirudhrb.com header.i=anirudh@anirudhrb.com header.b="jIDzPCnP" ARC-Seal: i=1; a=rsa-sha256; t=1767616136; cv=none; d=zohomail.com; s=zohoarc; b=ROtB0eNd4fqW3nFu/mI3Owk54G4ugYSzAt47y2gnqHPHCFbKRcfHEQy8k4T/UGpTHpD3knpMNd5aEBUvdw48rmZIO2AhkRJIFuZI3r8gDd39Nlv5htlOqDha1S/MY32bddyegoM+sCpcUNbWGtb3yh36NBNHjsaefvpgMEog43g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767616136; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=JLfHjh+7Y2apHERse94YUzusZTC4T/ZVTyh0f53oZb8=; b=FgS0gDysHmQET4Ljp95ndS4OoPSCiJNgzov3ejcjuF7xbj7Bb2CKu03PeDVPteLvQotahS5A+DmksFM1Kj4fryJ0FblSEMOtkPgcFKE0EDiBDc6BkG8iKfnewZuZxTyfdM9r2dLsaINmN9ZNbBKrUWcRYJY4Ze9bnsqqRWeY6Cg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=anirudhrb.com; spf=pass smtp.mailfrom=anirudh@anirudhrb.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1767616136; s=zoho; d=anirudhrb.com; i=anirudh@anirudhrb.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=JLfHjh+7Y2apHERse94YUzusZTC4T/ZVTyh0f53oZb8=; b=jIDzPCnPDGFk/L1TOSh3nhD0SqEUiZGKgeeQrLjfw5qMM0aR3Br+FU94QRjAksqR 2hGMke1iCNNykCaISev0ew26CZf0NG3kMg3m6g70rwW9kW0t6JrVG/vGCAA3ncVyzwn 1TI9ywN+2vs4Dy0/vGSM7tIxsGW2tX2RLtj2Fts8= Received: by mx.zohomail.com with SMTPS id 1767616134741875.3494296439226; Mon, 5 Jan 2026 04:28:54 -0800 (PST) From: Anirudh Rayabharam To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Cc: anirudh@anirudhrb.com Subject: [PATCH v2 1/2] hyperv: add definitions for arm64 gpa intercepts Date: Mon, 5 Jan 2026 12:28:36 +0000 Message-Id: <20260105122837.1083896-2-anirudh@anirudhrb.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260105122837.1083896-1-anirudh@anirudhrb.com> References: <20260105122837.1083896-1-anirudh@anirudhrb.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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" From: Anirudh Rayabharam (Microsoft) Add definitions required for handling GPA intercepts on arm64. Signed-off-by: Anirudh Rayabharam (Microsoft) Reviewed-by: Stanislav Kinsburskii --- include/hyperv/hvhdk.h | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/include/hyperv/hvhdk.h b/include/hyperv/hvhdk.h index 469186df7826..08965970c17d 100644 --- a/include/hyperv/hvhdk.h +++ b/include/hyperv/hvhdk.h @@ -800,6 +800,53 @@ struct hv_x64_memory_intercept_message { u8 instruction_bytes[16]; } __packed; =20 +#if IS_ENABLED(CONFIG_ARM64) +union hv_arm64_vp_execution_state { + u16 as_uint16; + struct { + u16 cpl:2; /* Exception Level (EL) */ + u16 debug_active:1; + u16 interruption_pending:1; + u16 vtl:4; + u16 virtualization_fault_active:1; + u16 reserved:7; + } __packed; +}; + +struct hv_arm64_intercept_message_header { + u32 vp_index; + u8 instruction_length; + u8 intercept_access_type; + union hv_arm64_vp_execution_state execution_state; + u64 pc; + u64 cpsr; +} __packed; + +union hv_arm64_memory_access_info { + u8 as_uint8; + struct { + u8 gva_valid:1; + u8 gva_gpa_valid:1; + u8 hypercall_output_pending:1; + u8 reserved:5; + } __packed; +}; + +struct hv_arm64_memory_intercept_message { + struct hv_arm64_intercept_message_header header; + u32 cache_type; /* enum hv_cache_type */ + u8 instruction_byte_count; + union hv_arm64_memory_access_info memory_access_info; + u16 reserved1; + u8 instruction_bytes[4]; + u32 reserved2; + u64 guest_virtual_address; + u64 guest_physical_address; + u64 syndrome; +} __packed; + +#endif /* CONFIG_ARM64 */ + /* * Dispatch state for the VP communicated by the hypervisor to the * VP-dispatching thread in the root on return from HVCALL_DISPATCH_VP. --=20 2.34.1 From nobody Sat Feb 7 06:55:05 2026 Received: from sender4-of-o52.zoho.com (sender4-of-o52.zoho.com [136.143.188.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64DF533BBD6; Mon, 5 Jan 2026 12:29:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767616158; cv=pass; b=hvSJQoBf8qET07aU6DQvjmV4wXQ7jOBh8lopQTZrYrtBA3D/NFPXKDdyF+6mmK5InTd9rYpiYEKthpHML6MmKZvtcqPSgLlvnUcUOoZLZj38ym49zDceTCXsIDrkYpksMMIpnmY0bqAQFFtrY4YcVLCmrf+4gENcnrWBO1X4Sh0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767616158; c=relaxed/simple; bh=GGPXvC2qVvhjV6soKdPKL88SGkOq4Fh/Abkd32uQe4U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SGLTrPZbO4ihltrCodKjoYPP3IkkUW7gu9zFyNVSkyLtS12cHBdhSjtC7G0gaoj4UU+udEhM7x+lWteAXCtGkOmHzYoFpzzUTRexAO7DY2Qeev2Qo2z/XfyHJlVJS5aotZ0ieoscbHivbf1D4KjXSAOk78QNKkx5CtURlwKdDmg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=anirudhrb.com; spf=pass smtp.mailfrom=anirudhrb.com; dkim=pass (1024-bit key) header.d=anirudhrb.com header.i=anirudh@anirudhrb.com header.b=nSiKLJrb; arc=pass smtp.client-ip=136.143.188.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=anirudhrb.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=anirudhrb.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=anirudhrb.com header.i=anirudh@anirudhrb.com header.b="nSiKLJrb" ARC-Seal: i=1; a=rsa-sha256; t=1767616144; cv=none; d=zohomail.com; s=zohoarc; b=b2M/fSbn767uJraNwO5n1yyogJGcuRWiXfDxmdPJeHsTr+lN6PmhB89f28CEkrSTd574gMXNJ/sLzN7Rik0qfd8LSDq/zPVJQOH7+wPD3wqDsnxUteS0vNhrqbBpWyiqtKTw+Wo1D/vesM3LTIvK1BzicOzVx+xt1Cxy/wxkS9A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767616144; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=C2c1vhOKm50oXDZHbkO2WlrpgJh1RklsPFHVTLTxfqY=; b=cSqsaeL7ZJ6geEspVd0YRxPhlIeZgqKvEQ2y1EGj9r04WUM4HdBqgL0EUwGq4c5f9dsgSYapB8TlH1MP4oBm5pKjtxCZoJuQaH3wwEA7zIXJhzRe/s6/KNc7tjyX3yYZJCT7c87x6kF23hk2Cu3LyAmsxSxssqe61/Tsj9FV2X8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=anirudhrb.com; spf=pass smtp.mailfrom=anirudh@anirudhrb.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1767616144; s=zoho; d=anirudhrb.com; i=anirudh@anirudhrb.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=C2c1vhOKm50oXDZHbkO2WlrpgJh1RklsPFHVTLTxfqY=; b=nSiKLJrbDiyFeU67YD429CIHO0oxBupNwC67uCiG+XCnkk4W2XSF0wypX0W4VHhi lVQSvxoERfevwBerbCn5j1Pw4CLY+q4bTf0O85HUEwfR+iZ97TjxBwBbOjdNVRaN2ss EGLHIONzezRGN2oZmpM9z0ZO609qeCNFt0mHsOaI= Received: by mx.zohomail.com with SMTPS id 1767616141147155.20323072971576; Mon, 5 Jan 2026 04:29:01 -0800 (PST) From: Anirudh Rayabharam To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Cc: anirudh@anirudhrb.com Subject: [PATCH v2 2/2] mshv: handle gpa intercepts for arm64 Date: Mon, 5 Jan 2026 12:28:37 +0000 Message-Id: <20260105122837.1083896-3-anirudh@anirudhrb.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260105122837.1083896-1-anirudh@anirudhrb.com> References: <20260105122837.1083896-1-anirudh@anirudhrb.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 X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" From: Anirudh Rayabharam (Microsoft) The mshv driver now uses movable pages for guests. For arm64 guests to be functional, handle gpa intercepts for arm64 too (the current code implements handling only for x86). Move some arch-agnostic functions out of #ifdefs so that they can be re-used. Fixes: b9a66cd5ccbb ("mshv: Add support for movable memory regions") Signed-off-by: Anirudh Rayabharam (Microsoft) --- drivers/hv/mshv_root_main.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/hv/mshv_root_main.c b/drivers/hv/mshv_root_main.c index 9cf28a3f12fe..f8c4c2ae2cc9 100644 --- a/drivers/hv/mshv_root_main.c +++ b/drivers/hv/mshv_root_main.c @@ -608,7 +608,6 @@ mshv_partition_region_by_gfn(struct mshv_partition *par= tition, u64 gfn) return NULL; } =20 -#ifdef CONFIG_X86_64 static struct mshv_mem_region * mshv_partition_region_by_gfn_get(struct mshv_partition *p, u64 gfn) { @@ -640,12 +639,17 @@ static bool mshv_handle_gpa_intercept(struct mshv_vp = *vp) { struct mshv_partition *p =3D vp->vp_partition; struct mshv_mem_region *region; - struct hv_x64_memory_intercept_message *msg; bool ret; u64 gfn; - - msg =3D (struct hv_x64_memory_intercept_message *) +#if defined(CONFIG_X86_64) + struct hv_x64_memory_intercept_message *msg =3D + (struct hv_x64_memory_intercept_message *) + vp->vp_intercept_msg_page->u.payload; +#elif defined(CONFIG_ARM64) + struct hv_arm64_memory_intercept_message *msg =3D + (struct hv_arm64_memory_intercept_message *) vp->vp_intercept_msg_page->u.payload; +#endif =20 gfn =3D HVPFN_DOWN(msg->guest_physical_address); =20 @@ -663,9 +667,6 @@ static bool mshv_handle_gpa_intercept(struct mshv_vp *v= p) =20 return ret; } -#else /* CONFIG_X86_64 */ -static bool mshv_handle_gpa_intercept(struct mshv_vp *vp) { return false; } -#endif /* CONFIG_X86_64 */ =20 static bool mshv_vp_handle_intercept(struct mshv_vp *vp) { --=20 2.34.1