From nobody Thu Dec 18 23:26:43 2025 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 F2D7B3101AD; Tue, 16 Dec 2025 14:29:26 +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=1765895369; cv=pass; b=GJGeEQajMhSa0KBL8S5JnRkymZ0e3XKTG03UErtbvw8hBYVhGdEKEfLKx7MQ9h8TfM3G2y7qtyO/fj0JvPIndjEPfnCBWCXf1jCvKOJz9XiK/VKwojIfADbDDhDCifRO3sYfoY34b1ekOSKClzE8Jq1Cr6LZLTwi+PjufKGMNF0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765895369; c=relaxed/simple; bh=zcnEiUbrTrjAWPvSfGmCBVqU+Lolp4XTvj1tacfRak0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lYszewAj0smpA7oZ+Y8ALN3aPbc5nCzbJq7glwe39zcfYLe84iyxHjFQ+4lsJn4VUfsCHfhENSQ/SZfdxdIWeE/3xgeNbZJMTIhDvsSyXf9VGRzw3bBO651DlsdxQYLS9jQr4Ur+N6VFm2l1qyKTKqSInKOnpgkgJyRuVTo6SCI= 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=nmP9WKB8; 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="nmP9WKB8" ARC-Seal: i=1; a=rsa-sha256; t=1765895349; cv=none; d=zohomail.com; s=zohoarc; b=ChsumNi9TKevOJ1GsBhyGosukmt00gP2oDK7jdyh9qHzUjyi2Xp/pRdG/+TMylb74sSwNb4aMDSQlOH6Rdw3HaQxgszYtzNsLJ15ZAEEjpOKA+vx+oiKRE7b6bYFKRBR75uSKT6lPFO/Aev0gmPjC1/QC8fuusiLB4EycZSj+9c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765895349; 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=yZ4QmkDSQEPgsBVMbQvcxL4TzoqYmIuNbuF9xkeY7K8=; b=chtSwZv6MXqUpqzMh7d2I/tgDuRRHJhKFh/e8N0cDQq7E7CbADOdnK32VbNAgXPi7UcbXAGAY9qJRc42SupAZaM3C+97Lg8znTdXuWiumpZscTtmVrb++a0Jggz5VmtOve0IOcUSv5W690KB7MptGtzZFCRXwPVttAmK6O0nsFo= 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=1765895349; 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=yZ4QmkDSQEPgsBVMbQvcxL4TzoqYmIuNbuF9xkeY7K8=; b=nmP9WKB8Bqx9gW7QHBBCPqQguYEDdo1lRlrrRc0Er9pbQTnHJBNFXgR0fgfb/CYy dhUG3oAkHX6Um3qRNe3mcBYJQRd609RtoT/rxh5yEPAqGkgKF8FfhcdTA7i52ImxkdM sz7QaMW46rhlRHWM0USBN2PShJmpK0oxBChJd1Qs= Received: by mx.zohomail.com with SMTPS id 1765895348311554.6134755506345; Tue, 16 Dec 2025 06:29:08 -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 1/3] hyperv: add definitions for arm64 gpa intercepts Date: Tue, 16 Dec 2025 14:20:28 +0000 Message-Id: <20251216142030.4095527-2-anirudh@anirudhrb.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251216142030.4095527-1-anirudh@anirudhrb.com> References: <20251216142030.4095527-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) --- include/hyperv/hvhdk.h | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/include/hyperv/hvhdk.h b/include/hyperv/hvhdk.h index 469186df7826..a286f75f0afa 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; + 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 Thu Dec 18 23:26:43 2025 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 5BB2933A9EB; Tue, 16 Dec 2025 14:29:35 +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=1765895376; cv=pass; b=Pk2P0q5z6/vYW1TYRzqDnjeXsS1iXi8YjHstsm/1PCD4l8mUTu5ZZAXMOL2A8QvtgF7maFEFGlCXUd6spbnXDz0imxIPNXeL3SC0AhB2EF1/VvkzHRHz8wpNozaYC9LkTbwifL4psFUrkPGb1LruqY/G0OQHfTxL4zstQKm0cVY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765895376; c=relaxed/simple; bh=WLRuh4s4NIdpCxg4XlikUDvd08oZOqfWwUpJ19c/Vt0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BOY44NeXxoe033jTxbea7+lcNQCIWdcSUqZjLGwET5N3c3wg4jqC+eSwjCbbpN+1cTab/AU7WtRQF4xjqQFDCrDIUkMz+5/OuGBapyO+vXq/QQnfse8pwdnzdcGHyO+GqfQJebo5mOWgG2KewwfTFbgCAaHgmsWdnHN9nKP0oFQ= 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=rj0gW1z3; 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="rj0gW1z3" ARC-Seal: i=1; a=rsa-sha256; t=1765895356; cv=none; d=zohomail.com; s=zohoarc; b=BJfslcbjUyP/ANp3+OIXWYXm5ENu+tjHUFKw74krTiQstEHOFLExqNDFCQkqDl8+pXAoOfJh4kj97eMuzOx0bxsvbdbUu/9zjt2fIOdYybuceyKHz1TbfTaiYm+yuH720hVwfIYUnuc0Ets7YkVZC47mLMn+WshQ0KOkc/As5XI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765895356; 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=p72hboX00ZYXjPvMhyIKAfVKmeA/7k8vW4MCIKUpY+w=; b=QwVoq3eO3g6PI7WF/UFXnwhwSjLVwKpqbjAdvfHx2umUj/4eo2By04SaIGEpUKmF0NHWg7A+p7lpMD9gp8rgyxpLWrSaGms/EYsglIK+crTJqakK9pzwq4l1jrheM6GpelVxCflW5pxybZ9kqah50ZadROpP/8opbO8ogG9dR2M= 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=1765895356; 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=p72hboX00ZYXjPvMhyIKAfVKmeA/7k8vW4MCIKUpY+w=; b=rj0gW1z39BtlkzHFLtg/ItCuppChH9C5hCBxfYkp+Y5Capdgacqf8ohJoy3TXEm+ mQEsZ9ji7ETI/iKNN5dp4JYPpKlrBuYVp0iSacUFTjBCPZGqGLs57DwvOGVyOTE7xkL No7cUHGAMArMc6yYtuj7tPsSQXKusuI6563vB0l4= Received: by mx.zohomail.com with SMTPS id 176589535443157.63328039870237; Tue, 16 Dec 2025 06:29:14 -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 2/3] mshv: handle gpa intercepts for arm64 Date: Tue, 16 Dec 2025 14:20:29 +0000 Message-Id: <20251216142030.4095527-3-anirudh@anirudhrb.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251216142030.4095527-1-anirudh@anirudhrb.com> References: <20251216142030.4095527-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). Without this, arm64 guests are broken. Move some arch-agnostic functions out of #ifdefs so that they can be re-used. Signed-off-by: Anirudh Rayabharam (Microsoft) --- drivers/hv/mshv_root_main.c | 38 ++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/drivers/hv/mshv_root_main.c b/drivers/hv/mshv_root_main.c index 9cf28a3f12fe..882605349664 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) { @@ -625,6 +624,34 @@ mshv_partition_region_by_gfn_get(struct mshv_partition= *p, u64 gfn) return region; } =20 +#ifdef CONFIG_X86_64 +static u64 mshv_get_gpa_intercept_gfn(struct mshv_vp *vp) +{ + struct hv_x64_memory_intercept_message *msg; + u64 gfn; + + msg =3D (struct hv_x64_memory_intercept_message *) + vp->vp_intercept_msg_page->u.payload; + + gfn =3D HVPFN_DOWN(msg->guest_physical_address); + + return gfn; +} +#else /* CONFIG_X86_64 */ +static u64 mshv_get_gpa_intercept_gfn(struct mshv_vp *vp) +{ + struct hv_arm64_memory_intercept_message *msg; + u64 gfn; + + msg =3D (struct hv_arm64_memory_intercept_message *) + vp->vp_intercept_msg_page->u.payload; + + gfn =3D HVPFN_DOWN(msg->guest_physical_address); + + return gfn; +} +#endif /* CONFIG_X86_64 */ + /** * mshv_handle_gpa_intercept - Handle GPA (Guest Physical Address) interce= pts. * @vp: Pointer to the virtual processor structure. @@ -640,14 +667,10 @@ 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; =20 - msg =3D (struct hv_x64_memory_intercept_message *) - vp->vp_intercept_msg_page->u.payload; - - gfn =3D HVPFN_DOWN(msg->guest_physical_address); + gfn =3D mshv_get_gpa_intercept_gfn(vp); =20 region =3D mshv_partition_region_by_gfn_get(p, gfn); if (!region) @@ -663,9 +686,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 From nobody Thu Dec 18 23:26:43 2025 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 181A62D5C7A; Tue, 16 Dec 2025 14:29:40 +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=1765895382; cv=pass; b=JpKlWv0CvUpJj8f+mfYpTN8q9LrhQ//HFFc2IK5a3ovIPkOmi+N3WQV/ru8ZNaz1u00f6aXQufr2iIbxLE+nxYpqcoW4th57evboKwes8BtbFZUQcAt98hL1cLEhdFUqxUxrw8Y5XHFpWgdsLiDoRyfqpNPa+i79iy7lirisOjc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765895382; c=relaxed/simple; bh=YJ4G9r4L0Jx6x414i+Xnd4G2394MxhYpDAU2aQQV3TY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=s6iiPbDwsHIqMt9vVeLRmzy1hjPd4pKbg5+PjULn6QLW6aiXHNJCiliv2jEII8EqyVSuzlml06XCGdwC+5lQ/CaAF77MFb7m3m4zFFYyW6KcrPmC9JtJg1LPM3dNWKS1AA/jCD/Yye2fNG0n2+FO0SkPesNkr3ovedh0msrHBF8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=anirudhrb.com; spf=unknown smtp.mailfrom=anirudhrb.com; dkim=pass (1024-bit key) header.d=anirudhrb.com header.i=anirudh@anirudhrb.com header.b=ZE6GecSM; 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=tempfail 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="ZE6GecSM" ARC-Seal: i=1; a=rsa-sha256; t=1765895362; cv=none; d=zohomail.com; s=zohoarc; b=S7s4NMRuOuPFmqTTY6w5ermGwg6PMpxbOjxVWHdWg9qihR7Lyx46rvsTr2CiP0iP6uDA3h8SpBy87Smbs9SVplmFbfFncZNPRSOpsuvqKSUg3hwnpxvMbXrjEWmOGyEJidPQg/29c82zt9XtLfHQ3LY6tLX46/8DkMmJLjbQgYs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765895362; 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=gDKvsGO9n6po0YoCP8JsZC+13ddLq6bhNGvoxU/02E8=; b=jxityUWaHAnUcquW7QncIgnD2cFBEi2uXbgHw81SsxtvUUIog5tN5MitTkrKyMG8DgHh10g9INItatSE2aDg0PbCaNwTmdvd1/8pk0Vj8zXMs5YCbqd1K7iwO//Bnok3Et0I3UBTEDlbCn9cxl7g0jdSdb5Qxv/By0RXTiy3wrU= 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=1765895362; 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=gDKvsGO9n6po0YoCP8JsZC+13ddLq6bhNGvoxU/02E8=; b=ZE6GecSMCBxDH2B6HpHumnUUjIj5M/TzbIbvsejz7vI746Wlft2SvzcFZgDhm/8Z y6uXYYPENBqypfe866m5hh+bGwFcSzU0BiSWIwVcPMJOrlZOAjwDXzcwqQjGLarn8bh 82ZBuBiYg2S0wvvJVt6uWJ1aG6fFDn75sbzxo3mI= Received: by mx.zohomail.com with SMTPS id 1765895359949149.64783037122322; Tue, 16 Dec 2025 06:29:19 -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 3/3] mshv: release mutex on region invalidation failure Date: Tue, 16 Dec 2025 14:20:30 +0000 Message-Id: <20251216142030.4095527-4-anirudh@anirudhrb.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251216142030.4095527-1-anirudh@anirudhrb.com> References: <20251216142030.4095527-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) In the region invalidation failure path in mshv_region_interval_invalidate(), the region mutex is not released. Fix it by releasing the mutex in the failure path. Signed-off-by: Anirudh Rayabharam (Microsoft) Acked-by: Stanislav Kinsburskii Reviewed-by: Roman Kisel --- drivers/hv/mshv_regions.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hv/mshv_regions.c b/drivers/hv/mshv_regions.c index 8abf80129f9b..30bacba6aec3 100644 --- a/drivers/hv/mshv_regions.c +++ b/drivers/hv/mshv_regions.c @@ -511,7 +511,7 @@ static bool mshv_region_interval_invalidate(struct mmu_= interval_notifier *mni, ret =3D mshv_region_remap_pages(region, HV_MAP_GPA_NO_ACCESS, page_offset, page_count); if (ret) - goto out_fail; + goto out_unlock; =20 mshv_region_invalidate_pages(region, page_offset, page_count); =20 @@ -519,6 +519,8 @@ static bool mshv_region_interval_invalidate(struct mmu_= interval_notifier *mni, =20 return true; =20 +out_unlock: + mutex_unlock(®ion->mutex); out_fail: WARN_ONCE(ret, "Failed to invalidate region %#llx-%#llx (range %#lx-%#lx, event: %u, = pages %#llx-%#llx, mm: %#llx): %d\n", --=20 2.34.1