Thread (64 messages) 64 messages, 6 authors, 2021-08-24

Re: [PATCH V3 03/13] x86/HV: Add new hvcall guest address host visibility support

From: Tianyu Lan <hidden>
Date: 2021-08-10 13:09:35
Also in: linux-hyperv, linux-iommu, linux-scsi, lkml, netdev, xen-devel

On 8/10/2021 6:12 AM, Dave Hansen wrote:
On 8/9/21 10:56 AM, Tianyu Lan wrote:
quoted
From: Tianyu Lan <redacted>

Add new hvcall guest address host visibility support to mark
memory visible to host. Call it inside set_memory_decrypted
/encrypted(). Add HYPERVISOR feature check in the
hv_is_isolation_supported() to optimize in non-virtualization
environment.
 From an x86/mm perspective:

Acked-by: Dave Hansen <redacted>
Thanks for your ACK.

A tiny nit:
quoted
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index 0bb4d9ca7a55..b3683083208a 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -607,6 +607,12 @@ EXPORT_SYMBOL_GPL(hv_get_isolation_type);
  
  bool hv_is_isolation_supported(void)
  {
+	if (!cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
+		return 0;
+
+	if (!hypervisor_is_type(X86_HYPER_MS_HYPERV))
+		return 0;
+
  	return hv_get_isolation_type() != HV_ISOLATION_TYPE_NONE;
  }
This might be worthwhile to move to a header.  That ensures that
hv_is_isolation_supported() use can avoid even a function call.  But, I
see this is used in modules and its use here is also in a slow path, so
it's not a big deal
I will move it to header in the following version.


Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help