Commit 66711cfe authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'hyperv-next-signed-20220322' of...

Merge tag 'hyperv-next-signed-20220322' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux

Pull hyperv updates from Wei Liu:
 "Minor patches from various people"

* tag 'hyperv-next-signed-20220322' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
  x86/hyperv: Output host build info as normal Windows version number
  hv_balloon: rate-limit "Unhandled message" warning
  drivers: hv: log when enabling crash_kexec_post_notifiers
  hv_utils: Add comment about max VMbus packet size in VSS driver
  Drivers: hv: Compare cpumasks and not their weights in init_vp_index()
  Drivers: hv: Rename 'alloced' to 'allocated'
  Drivers: hv: vmbus: Use struct_size() helper in kmalloc()
parents 1ebdbeb0 eeda29db
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -310,10 +310,10 @@ static void __init ms_hyperv_init_platform(void)
		hv_host_info_ecx = cpuid_ecx(HYPERV_CPUID_VERSION);
		hv_host_info_edx = cpuid_edx(HYPERV_CPUID_VERSION);

		pr_info("Hyper-V Host Build:%d-%d.%d-%d-%d.%d\n",
			hv_host_info_eax, hv_host_info_ebx >> 16,
			hv_host_info_ebx & 0xFFFF, hv_host_info_ecx,
			hv_host_info_edx >> 24, hv_host_info_edx & 0xFFFFFF);
		pr_info("Hyper-V: Host Build %d.%d.%d.%d-%d-%d\n",
			hv_host_info_ebx >> 16, hv_host_info_ebx & 0xFFFF,
			hv_host_info_eax, hv_host_info_edx & 0xFFFFFF,
			hv_host_info_ecx, hv_host_info_edx >> 24);
	}

	if (ms_hyperv.features & HV_ACCESS_FREQUENCY_MSRS &&
+9 −10
Original line number Diff line number Diff line
@@ -459,7 +459,7 @@ void hv_process_channel_removal(struct vmbus_channel *channel)
	 * init_vp_index() can (re-)use the CPU.
	 */
	if (hv_is_perf_channel(channel))
		hv_clear_alloced_cpu(channel->target_cpu);
		hv_clear_allocated_cpu(channel->target_cpu);

	/*
	 * Upon suspend, an in-use hv_sock channel is marked as "rescinded" and
@@ -728,7 +728,7 @@ static void init_vp_index(struct vmbus_channel *channel)
	bool perf_chn = hv_is_perf_channel(channel);
	u32 i, ncpu = num_online_cpus();
	cpumask_var_t available_mask;
	struct cpumask *alloced_mask;
	struct cpumask *allocated_mask;
	u32 target_cpu;
	int numa_node;

@@ -745,7 +745,7 @@ static void init_vp_index(struct vmbus_channel *channel)
		 */
		channel->target_cpu = VMBUS_CONNECT_CPU;
		if (perf_chn)
			hv_set_alloced_cpu(VMBUS_CONNECT_CPU);
			hv_set_allocated_cpu(VMBUS_CONNECT_CPU);
		return;
	}

@@ -760,22 +760,21 @@ static void init_vp_index(struct vmbus_channel *channel)
				continue;
			break;
		}
		alloced_mask = &hv_context.hv_numa_map[numa_node];
		allocated_mask = &hv_context.hv_numa_map[numa_node];

		if (cpumask_weight(alloced_mask) ==
		    cpumask_weight(cpumask_of_node(numa_node))) {
		if (cpumask_equal(allocated_mask, cpumask_of_node(numa_node))) {
			/*
			 * We have cycled through all the CPUs in the node;
			 * reset the alloced map.
			 * reset the allocated map.
			 */
			cpumask_clear(alloced_mask);
			cpumask_clear(allocated_mask);
		}

		cpumask_xor(available_mask, alloced_mask,
		cpumask_xor(available_mask, allocated_mask,
			    cpumask_of_node(numa_node));

		target_cpu = cpumask_first(available_mask);
		cpumask_set_cpu(target_cpu, alloced_mask);
		cpumask_set_cpu(target_cpu, allocated_mask);

		if (channel->offermsg.offer.sub_channel_index >= ncpu ||
		    i > ncpu || !hv_cpuself_used(target_cpu, channel))
+1 −1
Original line number Diff line number Diff line
@@ -1563,7 +1563,7 @@ static void balloon_onchannelcallback(void *context)
			break;

		default:
			pr_warn("Unhandled message: type: %d\n", dm_hdr->type);
			pr_warn_ratelimited("Unhandled message: type: %d\n", dm_hdr->type);

		}
	}
+3 −1
Original line number Diff line number Diff line
@@ -79,8 +79,10 @@ int __init hv_common_init(void)
	 * calling crash enlightment interface before running kdump
	 * kernel.
	 */
	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE)
	if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
		crash_kexec_post_notifiers = true;
		pr_info("Hyper-V: enabling crash_kexec_post_notifiers\n");
	}

	/*
	 * Allocate the per-CPU state for the hypercall input arg.
+5 −2
Original line number Diff line number Diff line
@@ -31,6 +31,9 @@ static const int fw_versions[] = {
	UTIL_FW_VERSION
};

/* See comment with struct hv_vss_msg regarding the max VMbus packet size */
#define VSS_MAX_PKT_SIZE (HV_HYP_PAGE_SIZE * 2)

/*
 * Timeout values are based on expecations from host
 */
@@ -298,7 +301,7 @@ void hv_vss_onchannelcallback(void *context)
	if (vss_transaction.state > HVUTIL_READY)
		return;

	if (vmbus_recvpacket(channel, recv_buffer, HV_HYP_PAGE_SIZE * 2, &recvlen, &requestid)) {
	if (vmbus_recvpacket(channel, recv_buffer, VSS_MAX_PKT_SIZE, &recvlen, &requestid)) {
		pr_err_ratelimited("VSS request received. Could not read into recv buf\n");
		return;
	}
@@ -375,7 +378,7 @@ hv_vss_init(struct hv_util_service *srv)
	}
	recv_buffer = srv->recv_buffer;
	vss_transaction.recv_channel = srv->channel;
	vss_transaction.recv_channel->max_pkt_size = HV_HYP_PAGE_SIZE * 2;
	vss_transaction.recv_channel->max_pkt_size = VSS_MAX_PKT_SIZE;

	/*
	 * When this driver loads, the user level daemon that
Loading