[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH V3 03/13] x86/HV: Add new hvcall guest address host visibility support
- To: Dave Hansen <dave.hansen@xxxxxxxxx>, kys@xxxxxxxxxxxxx, haiyangz@xxxxxxxxxxxxx, sthemmin@xxxxxxxxxxxxx, wei.liu@xxxxxxxxxx, decui@xxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, bp@xxxxxxxxx, x86@xxxxxxxxxx, hpa@xxxxxxxxx, dave.hansen@xxxxxxxxxxxxxxx, luto@xxxxxxxxxx, peterz@xxxxxxxxxxxxx, konrad.wilk@xxxxxxxxxx, boris.ostrovsky@xxxxxxxxxx, jgross@xxxxxxxx, sstabellini@xxxxxxxxxx, joro@xxxxxxxxxx, will@xxxxxxxxxx, davem@xxxxxxxxxxxxx, kuba@xxxxxxxxxx, jejb@xxxxxxxxxxxxx, martin.petersen@xxxxxxxxxx, arnd@xxxxxxxx, hch@xxxxxx, m.szyprowski@xxxxxxxxxxx, robin.murphy@xxxxxxx, thomas.lendacky@xxxxxxx, brijesh.singh@xxxxxxx, ardb@xxxxxxxxxx, Tianyu.Lan@xxxxxxxxxxxxx, pgonda@xxxxxxxxxx, martin.b.radev@xxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, kirill.shutemov@xxxxxxxxxxxxxxx, rppt@xxxxxxxxxx, sfr@xxxxxxxxxxxxxxxx, saravanand@xxxxxx, krish.sadhukhan@xxxxxxxxxx, aneesh.kumar@xxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, rientjes@xxxxxxxxxx, hannes@xxxxxxxxxxx, tj@xxxxxxxxxx, michael.h.kelley@xxxxxxxxxxxxx
- From: Tianyu Lan <ltykernel@xxxxxxxxx>
- Date: Tue, 10 Aug 2021 21:09:16 +0800
- Cc: iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, linux-hyperv@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, vkuznets@xxxxxxxxxx, parri.andrea@xxxxxxxxx
- Delivery-date: Tue, 10 Aug 2021 13:09:43 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 8/10/2021 6:12 AM, Dave Hansen wrote:
On 8/9/21 10:56 AM, Tianyu Lan wrote:
From: Tianyu Lan <Tianyu.Lan@xxxxxxxxxxxxx>
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 <dave.hansen@xxxxxxxxx>
Thanks for your ACK.
A tiny nit:
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.
|