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 'for-linus-5.9-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen fixes from Juergen Gross:
"Two fixes for Xen: one needed for ongoing work to support virtio with
Xen, and one for a corner case in IRQ handling with Xen"

* tag 'for-linus-5.9-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
arm/xen: Add misuse warning to virt_to_gfn
xen/xenbus: Fix granting of vmalloc'd memory
XEN uses irqdesc::irq_data_common::handler_data to store a per interrupt XEN data pointer which contains XEN specific information.

+21 -11
+8 -8
drivers/xen/events/events_base.c
··· 156 156 /* Get info for IRQ */ 157 157 struct irq_info *info_for_irq(unsigned irq) 158 158 { 159 - return irq_get_handler_data(irq); 159 + return irq_get_chip_data(irq); 160 160 } 161 161 162 162 /* Constructors for packed IRQ information. */ ··· 377 377 info->type = IRQT_UNBOUND; 378 378 info->refcnt = -1; 379 379 380 - irq_set_handler_data(irq, info); 380 + irq_set_chip_data(irq, info); 381 381 382 382 list_add_tail(&info->list, &xen_irq_list_head); 383 383 } ··· 426 426 427 427 static void xen_free_irq(unsigned irq) 428 428 { 429 - struct irq_info *info = irq_get_handler_data(irq); 429 + struct irq_info *info = irq_get_chip_data(irq); 430 430 431 431 if (WARN_ON(!info)) 432 432 return; 433 433 434 434 list_del(&info->list); 435 435 436 - irq_set_handler_data(irq, NULL); 436 + irq_set_chip_data(irq, NULL); 437 437 438 438 WARN_ON(info->refcnt > 0); 439 439 ··· 603 603 static void __unbind_from_irq(unsigned int irq) 604 604 { 605 605 evtchn_port_t evtchn = evtchn_from_irq(irq); 606 - struct irq_info *info = irq_get_handler_data(irq); 606 + struct irq_info *info = irq_get_chip_data(irq); 607 607 608 608 if (info->refcnt > 0) { 609 609 info->refcnt--; ··· 1108 1108 1109 1109 void unbind_from_irqhandler(unsigned int irq, void *dev_id) 1110 1110 { 1111 - struct irq_info *info = irq_get_handler_data(irq); 1111 + struct irq_info *info = irq_get_chip_data(irq); 1112 1112 1113 1113 if (WARN_ON(!info)) 1114 1114 return; ··· 1142 1142 if (irq == -1) 1143 1143 return -ENOENT; 1144 1144 1145 - info = irq_get_handler_data(irq); 1145 + info = irq_get_chip_data(irq); 1146 1146 1147 1147 if (!info) 1148 1148 return -ENOENT; ··· 1170 1170 if (irq == -1) 1171 1171 goto done; 1172 1172 1173 - info = irq_get_handler_data(irq); 1173 + info = irq_get_chip_data(irq); 1174 1174 1175 1175 if (!info) 1176 1176 goto done;
+8 -2
drivers/xen/xenbus/xenbus_client.c
··· 379 379 int i, j; 380 380 381 381 for (i = 0; i < nr_pages; i++) { 382 - err = gnttab_grant_foreign_access(dev->otherend_id, 383 - virt_to_gfn(vaddr), 0); 382 + unsigned long gfn; 383 + 384 + if (is_vmalloc_addr(vaddr)) 385 + gfn = pfn_to_gfn(vmalloc_to_pfn(vaddr)); 386 + else 387 + gfn = virt_to_gfn(vaddr); 388 + 389 + err = gnttab_grant_foreign_access(dev->otherend_id, gfn, 0); 384 390 if (err < 0) { 385 391 xenbus_dev_fatal(dev, err, 386 392 "granting access to ring page");
+5 -1
include/xen/arm/page.h
··· 76 76 #define bfn_to_local_pfn(bfn) bfn_to_pfn(bfn) 77 77 78 78 /* VIRT <-> GUEST conversion */ 79 - #define virt_to_gfn(v) (pfn_to_gfn(virt_to_phys(v) >> XEN_PAGE_SHIFT)) 79 + #define virt_to_gfn(v) \ 80 + ({ \ 81 + WARN_ON_ONCE(!virt_addr_valid(v)); \ 82 + pfn_to_gfn(virt_to_phys(v) >> XEN_PAGE_SHIFT); \ 83 + }) 80 84 #define gfn_to_virt(m) (__va(gfn_to_pfn(m) << XEN_PAGE_SHIFT)) 81 85 82 86 /* Only used in PV code. But ARM guests are always HVM. */