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

Merge tag 'for-linus-5.7-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen updates from Juergen Gross:

- a cleanup patch removing an unused function

- a small fix for the xen pciback driver

- a series for making the unwinder hyppay with the Xen PV guest idle
task stacks

* tag 'for-linus-5.7-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
x86/xen: Make the secondary CPU idle tasks reliable
x86/xen: Make the boot CPU idle task reliable
xen-pciback: fix INTERRUPT_TYPE_* defines
xen/xenbus: remove unused xenbus_map_ring()

+65 -99
+2 -1
arch/x86/xen/smp_pv.c
··· 53 53 static DEFINE_PER_CPU(struct xen_common_irq, xen_pmu_irq) = { .irq = -1 }; 54 54 55 55 static irqreturn_t xen_irq_work_interrupt(int irq, void *dev_id); 56 + void asm_cpu_bringup_and_idle(void); 56 57 57 58 static void cpu_bringup(void) 58 59 { ··· 310 309 * pointing just below where pt_regs would be if it were a normal 311 310 * kernel entry. 312 311 */ 313 - ctxt->user_regs.eip = (unsigned long)cpu_bringup_and_idle; 312 + ctxt->user_regs.eip = (unsigned long)asm_cpu_bringup_and_idle; 314 313 ctxt->flags = VGCF_IN_KERNEL; 315 314 ctxt->user_regs.eflags = 0x1000; /* IOPL_RING1 */ 316 315 ctxt->user_regs.ds = __USER_DS;
+16 -2
arch/x86/xen/xen-head.S
··· 35 35 rep __ASM_SIZE(stos) 36 36 37 37 mov %_ASM_SI, xen_start_info 38 - mov $init_thread_union+THREAD_SIZE, %_ASM_SP 38 + #ifdef CONFIG_X86_64 39 + mov initial_stack(%rip), %rsp 40 + #else 41 + mov pa(initial_stack), %esp 42 + #endif 39 43 40 44 #ifdef CONFIG_X86_64 41 45 /* Set up %gs. ··· 55 51 wrmsr 56 52 #endif 57 53 58 - jmp xen_start_kernel 54 + call xen_start_kernel 59 55 SYM_CODE_END(startup_xen) 60 56 __FINIT 57 + 58 + #ifdef CONFIG_XEN_PV_SMP 59 + .pushsection .text 60 + SYM_CODE_START(asm_cpu_bringup_and_idle) 61 + UNWIND_HINT_EMPTY 62 + 63 + call cpu_bringup_and_idle 64 + SYM_CODE_END(asm_cpu_bringup_and_idle) 65 + .popsection 66 + #endif 61 67 #endif 62 68 63 69 .pushsection .text
+1 -1
drivers/xen/xen-pciback/conf_space.c
··· 320 320 if (val & PCI_MSIX_FLAGS_ENABLE) 321 321 ret |= INTERRUPT_TYPE_MSIX; 322 322 } 323 - return ret; 323 + return ret ?: INTERRUPT_TYPE_NONE; 324 324 } 325 325 326 326 void xen_pcibk_config_free_dyn_fields(struct pci_dev *dev)
+4 -4
drivers/xen/xen-pciback/conf_space.h
··· 65 65 void *data; 66 66 }; 67 67 68 - #define INTERRUPT_TYPE_NONE (1<<0) 69 - #define INTERRUPT_TYPE_INTX (1<<1) 70 - #define INTERRUPT_TYPE_MSI (1<<2) 71 - #define INTERRUPT_TYPE_MSIX (1<<3) 68 + #define INTERRUPT_TYPE_NONE (0) 69 + #define INTERRUPT_TYPE_INTX (1<<0) 70 + #define INTERRUPT_TYPE_MSI (1<<1) 71 + #define INTERRUPT_TYPE_MSIX (1<<2) 72 72 73 73 extern bool xen_pcibk_permissive; 74 74
+42 -84
drivers/xen/xenbus/xenbus_client.c
··· 517 517 return err; 518 518 } 519 519 520 + /** 521 + * xenbus_unmap_ring 522 + * @dev: xenbus device 523 + * @handles: grant handle array 524 + * @nr_handles: number of handles in the array 525 + * @vaddrs: addresses to unmap 526 + * 527 + * Unmap memory in this domain that was imported from another domain. 528 + * Returns 0 on success and returns GNTST_* on error 529 + * (see xen/include/interface/grant_table.h). 530 + */ 531 + static int xenbus_unmap_ring(struct xenbus_device *dev, grant_handle_t *handles, 532 + unsigned int nr_handles, unsigned long *vaddrs) 533 + { 534 + struct gnttab_unmap_grant_ref unmap[XENBUS_MAX_RING_GRANTS]; 535 + int i; 536 + int err; 537 + 538 + if (nr_handles > XENBUS_MAX_RING_GRANTS) 539 + return -EINVAL; 540 + 541 + for (i = 0; i < nr_handles; i++) 542 + gnttab_set_unmap_op(&unmap[i], vaddrs[i], 543 + GNTMAP_host_map, handles[i]); 544 + 545 + if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, unmap, i)) 546 + BUG(); 547 + 548 + err = GNTST_okay; 549 + for (i = 0; i < nr_handles; i++) { 550 + if (unmap[i].status != GNTST_okay) { 551 + xenbus_dev_error(dev, unmap[i].status, 552 + "unmapping page at handle %d error %d", 553 + handles[i], unmap[i].status); 554 + err = unmap[i].status; 555 + break; 556 + } 557 + } 558 + 559 + return err; 560 + } 561 + 520 562 struct map_ring_valloc_hvm 521 563 { 522 564 unsigned int idx; ··· 649 607 kfree(node); 650 608 return err; 651 609 } 652 - 653 - 654 - /** 655 - * xenbus_map_ring 656 - * @dev: xenbus device 657 - * @gnt_refs: grant reference array 658 - * @nr_grefs: number of grant reference 659 - * @handles: pointer to grant handle to be filled 660 - * @vaddrs: addresses to be mapped to 661 - * @leaked: fail to clean up a failed map, caller should not free vaddr 662 - * 663 - * Map pages of memory into this domain from another domain's grant table. 664 - * xenbus_map_ring does not allocate the virtual address space (you must do 665 - * this yourself!). It only maps in the pages to the specified address. 666 - * Returns 0 on success, and GNTST_* (see xen/include/interface/grant_table.h) 667 - * or -ENOMEM / -EINVAL on error. If an error is returned, device will switch to 668 - * XenbusStateClosing and the first error message will be saved in XenStore. 669 - * Further more if we fail to map the ring, caller should check @leaked. 670 - * If @leaked is not zero it means xenbus_map_ring fails to clean up, caller 671 - * should not free the address space of @vaddr. 672 - */ 673 - int xenbus_map_ring(struct xenbus_device *dev, grant_ref_t *gnt_refs, 674 - unsigned int nr_grefs, grant_handle_t *handles, 675 - unsigned long *vaddrs, bool *leaked) 676 - { 677 - phys_addr_t phys_addrs[XENBUS_MAX_RING_GRANTS]; 678 - int i; 679 - 680 - if (nr_grefs > XENBUS_MAX_RING_GRANTS) 681 - return -EINVAL; 682 - 683 - for (i = 0; i < nr_grefs; i++) 684 - phys_addrs[i] = (unsigned long)vaddrs[i]; 685 - 686 - return __xenbus_map_ring(dev, gnt_refs, nr_grefs, handles, 687 - phys_addrs, GNTMAP_host_map, leaked); 688 - } 689 - EXPORT_SYMBOL_GPL(xenbus_map_ring); 690 - 691 610 692 611 /** 693 612 * xenbus_unmap_ring_vfree ··· 860 857 kfree(node); 861 858 return rv; 862 859 } 863 - 864 - /** 865 - * xenbus_unmap_ring 866 - * @dev: xenbus device 867 - * @handles: grant handle array 868 - * @nr_handles: number of handles in the array 869 - * @vaddrs: addresses to unmap 870 - * 871 - * Unmap memory in this domain that was imported from another domain. 872 - * Returns 0 on success and returns GNTST_* on error 873 - * (see xen/include/interface/grant_table.h). 874 - */ 875 - int xenbus_unmap_ring(struct xenbus_device *dev, 876 - grant_handle_t *handles, unsigned int nr_handles, 877 - unsigned long *vaddrs) 878 - { 879 - struct gnttab_unmap_grant_ref unmap[XENBUS_MAX_RING_GRANTS]; 880 - int i; 881 - int err; 882 - 883 - if (nr_handles > XENBUS_MAX_RING_GRANTS) 884 - return -EINVAL; 885 - 886 - for (i = 0; i < nr_handles; i++) 887 - gnttab_set_unmap_op(&unmap[i], vaddrs[i], 888 - GNTMAP_host_map, handles[i]); 889 - 890 - if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, unmap, i)) 891 - BUG(); 892 - 893 - err = GNTST_okay; 894 - for (i = 0; i < nr_handles; i++) { 895 - if (unmap[i].status != GNTST_okay) { 896 - xenbus_dev_error(dev, unmap[i].status, 897 - "unmapping page at handle %d error %d", 898 - handles[i], unmap[i].status); 899 - err = unmap[i].status; 900 - break; 901 - } 902 - } 903 - 904 - return err; 905 - } 906 - EXPORT_SYMBOL_GPL(xenbus_unmap_ring); 907 - 908 860 909 861 /** 910 862 * xenbus_read_driver_state
-7
include/xen/xenbus.h
··· 209 209 unsigned int nr_pages, grant_ref_t *grefs); 210 210 int xenbus_map_ring_valloc(struct xenbus_device *dev, grant_ref_t *gnt_refs, 211 211 unsigned int nr_grefs, void **vaddr); 212 - int xenbus_map_ring(struct xenbus_device *dev, 213 - grant_ref_t *gnt_refs, unsigned int nr_grefs, 214 - grant_handle_t *handles, unsigned long *vaddrs, 215 - bool *leaked); 216 212 217 213 int xenbus_unmap_ring_vfree(struct xenbus_device *dev, void *vaddr); 218 - int xenbus_unmap_ring(struct xenbus_device *dev, 219 - grant_handle_t *handles, unsigned int nr_handles, 220 - unsigned long *vaddrs); 221 214 222 215 int xenbus_alloc_evtchn(struct xenbus_device *dev, int *port); 223 216 int xenbus_free_evtchn(struct xenbus_device *dev, int port);