diff mbox series

UBUNTU: SAUCE: Drivers: hv: vmbus: Fix the boot issue for VBS Isolated VMs

Message ID 20220711135342.22188-2-tim.gardner@canonical.com
State New
Headers show
Series UBUNTU: SAUCE: Drivers: hv: vmbus: Fix the boot issue for VBS Isolated VMs | expand

Commit Message

Tim Gardner July 11, 2022, 1:53 p.m. UTC
From: Dexuan Cui <decui@microsoft.com>

BugLink: https://bugs.launchpad.net/bugs/1981328

In the case of VBS VMs, we also need to call the hypercall
hv_mark_gpa_visibility() to expose the vmbus_connection.monitor_pages
to Hyper-V, otherwise the VM fails to boot as a VBS VM.

The change doesn't affect SNP VMs and regular VMs.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 drivers/hv/connection.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ian May Aug. 16, 2022, 9:21 p.m. UTC | #1
Acked-by: Ian May <ian.may@canonical.com>

On 2022-07-11 07:53:42 , Tim Gardner wrote:
> From: Dexuan Cui <decui@microsoft.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1981328
> 
> In the case of VBS VMs, we also need to call the hypercall
> hv_mark_gpa_visibility() to expose the vmbus_connection.monitor_pages
> to Hyper-V, otherwise the VM fails to boot as a VBS VM.
> 
> The change doesn't affect SNP VMs and regular VMs.
> 
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
> ---
>  drivers/hv/connection.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
> index 8314cce7fe5d..252c5b7a69eb 100644
> --- a/drivers/hv/connection.c
> +++ b/drivers/hv/connection.c
> @@ -232,7 +232,7 @@ int vmbus_connect(void)
>  		goto cleanup;
>  	}
>  
> -	if (hv_isolation_type_snp()) {
> +	if (hv_is_isolation_supported()) {
>  		pfn[0] = virt_to_hvpfn(vmbus_connection.monitor_pages[0]);
>  		pfn[1] = virt_to_hvpfn(vmbus_connection.monitor_pages[1]);
>  		if (hv_mark_gpa_visibility(2, pfn,
> @@ -319,7 +319,7 @@ void vmbus_disconnect(void)
>  		vmbus_connection.int_page = NULL;
>  	}
>  
> -	if (hv_isolation_type_snp()) {
> +	if (hv_is_isolation_supported()) {
>  		if (vmbus_connection.monitor_pages_va[0]) {
>  			vunmap(vmbus_connection.monitor_pages[0]);
>  			vmbus_connection.monitor_pages[0]
> -- 
> 2.37.0
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Marcelo Henrique Cerri Aug. 16, 2022, 9:36 p.m. UTC | #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512


Acked-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>

On Mon, Jul 11 2022, Tim Gardner wrote:
> From: Dexuan Cui <decui@microsoft.com>
>
> BugLink: https://bugs.launchpad.net/bugs/1981328
>
> In the case of VBS VMs, we also need to call the hypercall
> hv_mark_gpa_visibility() to expose the vmbus_connection.monitor_pages
> to Hyper-V, otherwise the VM fails to boot as a VBS VM.
>
> The change doesn't affect SNP VMs and regular VMs.
>
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
> ---
>  drivers/hv/connection.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
> index 8314cce7fe5d..252c5b7a69eb 100644
> --- a/drivers/hv/connection.c
> +++ b/drivers/hv/connection.c
> @@ -232,7 +232,7 @@ int vmbus_connect(void)
>  		goto cleanup;
>  	}
>
> -	if (hv_isolation_type_snp()) {
> +	if (hv_is_isolation_supported()) {
>  		pfn[0] = virt_to_hvpfn(vmbus_connection.monitor_pages[0]);
>  		pfn[1] = virt_to_hvpfn(vmbus_connection.monitor_pages[1]);
>  		if (hv_mark_gpa_visibility(2, pfn,
> @@ -319,7 +319,7 @@ void vmbus_disconnect(void)
>  		vmbus_connection.int_page = NULL;
>  	}
>
> -	if (hv_isolation_type_snp()) {
> +	if (hv_is_isolation_supported()) {
>  		if (vmbus_connection.monitor_pages_va[0]) {
>  			vunmap(vmbus_connection.monitor_pages[0]);
>  			vmbus_connection.monitor_pages[0]
> --
> 2.37.0


- --
Regards,
Marcelo
-----BEGIN PGP SIGNATURE-----

iQHQBAEBCgA6FiEExJjLjAfVL0XbfEr56e82LoessAkFAmL8DdUcHG1hcmNlbG8u
Y2VycmlAY2Fub25pY2FsLmNvbQAKCRDp7zYuh6ywCb4CDACLO9+WTl2lnbony4uN
54kzpMGNso0WOVaMgEwiydGLsYbvzdcS8PO4Iv0YCH75ET61R9xbPv6nUydum8dC
3AbuTHY7t2T+5WwL7K5Nl2AbcuAkhdR9aJNqxPP+y5ou1uZUSjksrn2goyOqpkFa
bin/6lSAao0NsS2fzLNNx1qyNl9k7CjXieDbiCMch1cpwl1HwppfqrVJ8Z96ojKf
+EVXiwISf2WLviLsxTHBQ+igGnMx2C44/0hpis1dFBKzD2ntUApVgQHwMOM1sxxt
+9GZNU7aav5haCtWiUFJRsrdB6ZUHaoToPxNpMTeynQ7LEd9VpqlSUS8puIJXKrh
4TzM9laRuh7hnkaBjFjhLMewIn7znTs6NnZKqV8uXjDL8KPaezrHL+TlV84SUAMg
0zr70di5vQySCOgvLsSAq1nqm1GCrW2E3pRGTcy1C5mHIAT2tv69aR6ydLMdcvEF
ebMi3qNl2Vhz2NOyIqb/ozn2m8z/3ykVkEb7X1yNklwwiPY=
=tr8a
-----END PGP SIGNATURE-----
diff mbox series

Patch

diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index 8314cce7fe5d..252c5b7a69eb 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -232,7 +232,7 @@  int vmbus_connect(void)
 		goto cleanup;
 	}
 
-	if (hv_isolation_type_snp()) {
+	if (hv_is_isolation_supported()) {
 		pfn[0] = virt_to_hvpfn(vmbus_connection.monitor_pages[0]);
 		pfn[1] = virt_to_hvpfn(vmbus_connection.monitor_pages[1]);
 		if (hv_mark_gpa_visibility(2, pfn,
@@ -319,7 +319,7 @@  void vmbus_disconnect(void)
 		vmbus_connection.int_page = NULL;
 	}
 
-	if (hv_isolation_type_snp()) {
+	if (hv_is_isolation_supported()) {
 		if (vmbus_connection.monitor_pages_va[0]) {
 			vunmap(vmbus_connection.monitor_pages[0]);
 			vmbus_connection.monitor_pages[0]