Drivers: hv: vmbus: Miscellaneous fixes/enhancements
Subsystems (2)
cover Drivers: hv: vmbus: Miscellaneous fixes/enhancements
From: "K. Y. Srinivasan" <[email protected]>
Miscellaneous fixes/enhancements
Stephen Hemminger (1):
Drivers: hv: vmbus: add numa_node to sysfs
Sunil Muthuswamy (3):
Drivers: hv: vmus: Fix the check for return value from kmsg get dump
buffer
Drivers: hv: vmbus: Fix the issue with freeing up hv_ctl_table_hdr
Drivers: hv: vmbus: Get rid of MSR access from vmbus_drv.c
Documentation/ABI/stable/sysfs-bus-vmbus | 7 ++++ arch/x86/include/asm/mshyperv.h | 3 ++ drivers/hv/vmbus_drv.c | 44 ++++++++++++++---------- 3 files changed, 36 insertions(+), 18 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/4 Drivers: hv: vmus: Fix the check for return value from kmsg get dump buffer
From: Sunil Muthuswamy <[email protected]>
The code to support panic control message was checking the return was checking the return value from kmsg_dump_get_buffer as error value, which is not what the routine returns. This fixes it.
--- drivers/hv/vmbus_drv.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/hv/vmbus_drv.c +4 -7
@@ -1047,13 +1047,10 @@ static void hv_kmsg_dump(struct kmsg_dumper *dumper,* Write dump contents to the page. No need to synchronize; panic should * be single-threaded. */ -if (!kmsg_dump_get_buffer (dumper, true, hv_panic_page, -PAGE_SIZE , &bytes_written)) { -pr_err ("Hyper-V: Unable to get kmsg data for panic\n" ); -return ; - } - -hyperv_report_panic_msg (panic_pa, bytes_written); +kmsg_dump_get_buffer (dumper, true, hv_panic_page,PAGE_SIZE , + &bytes_written); +if (bytes_written) +hyperv_report_panic_msg (panic_pa, bytes_written); }static struct kmsg_dumper hv_kmsg_dumper = {
Signature · 1 line
2.17.1
PATCH 2/4 Drivers: hv: vmbus: Fix the issue with freeing up hv_ctl_table_hdr
From: Sunil Muthuswamy <[email protected]>
The check to free the Hyper-V control table header was reversed. This fixes it.
--- drivers/hv/vmbus_drv.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
drivers/hv/vmbus_drv.c +4 -10
@@ -1176,11 +1176,8 @@ static int vmbus_bus_init(void)bus_unregister (&hv_bus);free_page ((unsigned long )hv_panic_page); -if (!hv_ctl_table_hdr) { -unregister_sysctl_table (hv_ctl_table_hdr); - hv_ctl_table_hdr =NULL ; - } - +unregister_sysctl_table (hv_ctl_table_hdr); + hv_ctl_table_hdr =NULL ;return ret; }
@@ -1891,11 +1888,8 @@ static void __exit vmbus_exit(void) }free_page ((unsigned long )hv_panic_page); -if (!hv_ctl_table_hdr) { -unregister_sysctl_table (hv_ctl_table_hdr); - hv_ctl_table_hdr =NULL ; - } - +unregister_sysctl_table (hv_ctl_table_hdr); + hv_ctl_table_hdr =NULL ;bus_unregister (&hv_bus);cpuhp_remove_state (hyperv_cpuhp_online);
Signature · 1 line
2.17.1
PATCH 3/4 Drivers: hv: vmbus: Get rid of MSR access from vmbus_drv.c
In reply to [email protected]From: Sunil Muthuswamy <[email protected]>
Get rid of ISA specific code from vmus_drv.c which is common code.
--- arch/x86/include/asm/mshyperv.h | 3 +++ drivers/hv/vmbus_drv.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
arch/x86/include/asm/mshyperv.h +3 -0
@@ -96,6 +96,9 @@ static inline void vmbus_signal_eom(struct hv_message *msg, u32 old_msg_type)#define hv_set_synint_state (int_num, val) \ wrmsrl(HV_X64_MSR_SINT0 + int_num, val) +#define hv_get_crash_ctl (val) \ + rdmsrl(HV_X64_MSR_CRASH_CTL, val) +void hyperv_callback_vector (void );void hyperv_reenlightenment_vector (void );#ifdef CONFIG_TRACING
drivers/hv/vmbus_drv.c +1 -1
@@ -1146,7 +1146,7 @@ static int vmbus_bus_init(void)* Register for panic kmsg callback only if the right * capability is supported by the hypervisor. */ -rdmsrl (HV_X64_MSR_CRASH_CTL , hyperv_crash_ctl); +hv_get_crash_ctl (hyperv_crash_ctl);if (hyperv_crash_ctl &HV_CRASH_CTL_CRASH_NOTIFY_MSG ) { hv_panic_page = (void *)get_zeroed_page (GFP_KERNEL );if (hv_panic_page) {
Signature · 1 line
2.17.1
PATCH 4/4 Drivers: hv: vmbus: add numa_node to sysfs
In reply to [email protected]From: Stephen Hemminger <[email protected]>
Being able to find the numa_node for a device is useful for userspace drivers (DPDK) and also for diagnosing performance issues. This makes vmbus similar to pci.
--- Documentation/ABI/stable/sysfs-bus-vmbus | 7 +++++++ drivers/hv/vmbus_drv.c | 17 +++++++++++++++++ 2 files changed, 24 insertions(+)
Documentation/ABI/stable/sysfs-bus-vmbus +7 -0
@@ -42,6 +42,13 @@ Contact: K. Y. Srinivasan <[email protected]> Description: The 16 bit vendor ID of the device Users: tools/hv/lsvmbus and user level RDMA libraries +What: /sys/bus/vmbus/devices/<UUID>/numa_node +Date: Jul 2018 +KernelVersion: 4.19 +Contact: Stephen Hemminger <[email protected]> +Description: This NUMA node to which the VMBUS device is + attached, or -1 if the node is unknown. + What: /sys/bus/vmbus/devices/<UUID>/channels/<N> Date: September. 2017 KernelVersion: 4.14
drivers/hv/vmbus_drv.c +17 -0
@@ -210,6 +210,20 @@ static ssize_t modalias_show(struct device *dev, }static DEVICE_ATTR_RO (modalias); +#ifdef CONFIG_NUMA +static ssize_t numa_node_show (struct device *dev, +struct device_attribute *attr,char *buf) +{ +struct hv_device *hv_dev =device_to_hv_device (dev); + +if (!hv_dev->channel) +return -ENODEV ; + +return sprintf (buf,"%d\n" , hv_dev->channel->numa_node); +} +static DEVICE_ATTR_RO (numa_node); +#endif +static ssize_t server_monitor_pending_show (struct device *dev,struct device_attribute *dev_attr,char *buf)
@@ -492,6 +506,9 @@ static struct attribute *vmbus_dev_attrs[] = { &dev_attr_class_id.attr, &dev_attr_device_id.attr, &dev_attr_modalias.attr, +#ifdef CONFIG_NUMA + &dev_attr_numa_node.attr, +#endif &dev_attr_server_monitor_pending.attr, &dev_attr_client_monitor_pending.attr, &dev_attr_server_monitor_latency.attr,
Signature · 1 line
2.17.1