Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull Hyper-V fixes from Wei Liu:

- Two fixes for Hyper-V PCI driver (Long Li, Sahil Chandna)

- Fix an infinite loop issue in MSHV driver (Stanislav Kinsburskii)

* tag 'hyperv-fixes-signed-20260406' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
mshv: Fix infinite fault loop on permission-denied GPA intercepts
PCI: hv: Fix double ida_free in hv_pci_probe error path
PCI: hv: Set default NUMA node to 0 for devices without affinity info

+29 -8
+12 -3
drivers/hv/mshv_root_main.c
··· 630 630 { 631 631 struct mshv_partition *p = vp->vp_partition; 632 632 struct mshv_mem_region *region; 633 - bool ret; 633 + bool ret = false; 634 634 u64 gfn; 635 635 #if defined(CONFIG_X86_64) 636 636 struct hv_x64_memory_intercept_message *msg = ··· 641 641 (struct hv_arm64_memory_intercept_message *) 642 642 vp->vp_intercept_msg_page->u.payload; 643 643 #endif 644 + enum hv_intercept_access_type access_type = 645 + msg->header.intercept_access_type; 644 646 645 647 gfn = HVPFN_DOWN(msg->guest_physical_address); 646 648 ··· 650 648 if (!region) 651 649 return false; 652 650 651 + if (access_type == HV_INTERCEPT_ACCESS_WRITE && 652 + !(region->hv_map_flags & HV_MAP_GPA_WRITABLE)) 653 + goto put_region; 654 + 655 + if (access_type == HV_INTERCEPT_ACCESS_EXECUTE && 656 + !(region->hv_map_flags & HV_MAP_GPA_EXECUTABLE)) 657 + goto put_region; 658 + 653 659 /* Only movable memory ranges are supported for GPA intercepts */ 654 660 if (region->mreg_type == MSHV_REGION_TYPE_MEM_MOVABLE) 655 661 ret = mshv_region_handle_gfn_fault(region, gfn); 656 - else 657 - ret = false; 658 662 663 + put_region: 659 664 mshv_region_put(region); 660 665 661 666 return ret;
+9 -3
drivers/pci/controller/pci-hyperv.c
··· 2485 2485 if (!hv_dev) 2486 2486 continue; 2487 2487 2488 + /* 2489 + * If the Hyper-V host doesn't provide a NUMA node for the 2490 + * device, default to node 0. With NUMA_NO_NODE the kernel 2491 + * may spread work across NUMA nodes, which degrades 2492 + * performance on Hyper-V. 2493 + */ 2494 + set_dev_node(&dev->dev, 0); 2495 + 2488 2496 if (hv_dev->desc.flags & HV_PCI_DEVICE_FLAG_NUMA_AFFINITY && 2489 2497 hv_dev->desc.virtual_numa_node < num_possible_nodes()) 2490 2498 /* ··· 3786 3778 hbus->bridge->domain_nr); 3787 3779 if (!hbus->wq) { 3788 3780 ret = -ENOMEM; 3789 - goto free_dom; 3781 + goto free_bus; 3790 3782 } 3791 3783 3792 3784 hdev->channel->next_request_id_callback = vmbus_next_request_id; ··· 3882 3874 vmbus_close(hdev->channel); 3883 3875 destroy_wq: 3884 3876 destroy_workqueue(hbus->wq); 3885 - free_dom: 3886 - pci_bus_release_emul_domain_nr(hbus->bridge->domain_nr); 3887 3877 free_bus: 3888 3878 kfree(hbus); 3889 3879 return ret;
+6
include/hyperv/hvgdk_mini.h
··· 1533 1533 u8 data[HV_HYPERCALL_MMIO_MAX_DATA_LENGTH]; 1534 1534 } __packed; 1535 1535 1536 + enum hv_intercept_access_type { 1537 + HV_INTERCEPT_ACCESS_READ = 0, 1538 + HV_INTERCEPT_ACCESS_WRITE = 1, 1539 + HV_INTERCEPT_ACCESS_EXECUTE = 2 1540 + }; 1541 + 1536 1542 #endif /* _HV_HVGDK_MINI_H */
+2 -2
include/hyperv/hvhdk.h
··· 779 779 u32 vp_index; 780 780 u8 instruction_length:4; 781 781 u8 cr8:4; /* Only set for exo partitions */ 782 - u8 intercept_access_type; 782 + u8 intercept_access_type; /* enum hv_intercept_access_type */ 783 783 union hv_x64_vp_execution_state execution_state; 784 784 struct hv_x64_segment_register cs_segment; 785 785 u64 rip; ··· 825 825 struct hv_arm64_intercept_message_header { 826 826 u32 vp_index; 827 827 u8 instruction_length; 828 - u8 intercept_access_type; 828 + u8 intercept_access_type; /* enum hv_intercept_access_type */ 829 829 union hv_arm64_vp_execution_state execution_state; 830 830 u64 pc; 831 831 u64 cpsr;