diff options
Diffstat (limited to 'arch/x86/hyperv/hv_init.c')
| -rw-r--r-- | arch/x86/hyperv/hv_init.c | 26 | 
1 files changed, 17 insertions, 9 deletions
| diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index 24f4a06ac46a..8b392b6b7b93 100644 --- a/arch/x86/hyperv/hv_init.c +++ b/arch/x86/hyperv/hv_init.c @@ -28,6 +28,7 @@  #include <linux/syscore_ops.h>  #include <clocksource/hyperv_timer.h>  #include <linux/highmem.h> +#include <linux/swiotlb.h>  int hyperv_init_cpuhp;  u64 hv_current_partition_id = ~0ull; @@ -36,7 +37,7 @@ EXPORT_SYMBOL_GPL(hv_current_partition_id);  void *hv_hypercall_pg;  EXPORT_SYMBOL_GPL(hv_hypercall_pg); -union hv_ghcb __percpu **hv_ghcb_pg; +union hv_ghcb * __percpu *hv_ghcb_pg;  /* Storage to save the hypercall page temporarily for hibernation */  static void *hv_hypercall_pg_saved; @@ -177,6 +178,9 @@ void set_hv_tscchange_cb(void (*cb)(void))  		return;  	} +	if (!hv_vp_index) +		return; +  	hv_reenlightenment_cb = cb;  	/* Make sure callback is registered before we write to MSRs */ @@ -383,20 +387,13 @@ static void __init hv_get_partition_id(void)   */  void __init hyperv_init(void)  { -	u64 guest_id, required_msrs; +	u64 guest_id;  	union hv_x64_msr_hypercall_contents hypercall_msr;  	int cpuhp;  	if (x86_hyper_type != X86_HYPER_MS_HYPERV)  		return; -	/* Absolutely required MSRs */ -	required_msrs = HV_MSR_HYPERCALL_AVAILABLE | -		HV_MSR_VP_INDEX_AVAILABLE; - -	if ((ms_hyperv.features & required_msrs) != required_msrs) -		return; -  	if (hv_common_init())  		return; @@ -502,6 +499,17 @@ void __init hyperv_init(void)  	/* Query the VMs extended capability once, so that it can be cached. */  	hv_query_ext_cap(0); + +#ifdef CONFIG_SWIOTLB +	/* +	 * Swiotlb bounce buffer needs to be mapped in extra address +	 * space. Map function doesn't work in the early place and so +	 * call swiotlb_update_mem_attributes() here. +	 */ +	if (hv_is_isolation_supported()) +		swiotlb_update_mem_attributes(); +#endif +  	return;  clean_guest_os_id: |