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-4.2-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen bug fixes from David Vrabel:

- revert a fix from 4.2-rc5 that was causing lots of WARNING spam.

- fix a memory leak affecting backends in HVM guests.

- fix PV domU hang with certain configurations.

* tag 'for-linus-4.2-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
xen/xenbus: Don't leak memory when unmapping the ring on HVM backend
Revert "xen/events/fifo: Handle linked events when closing a port"
x86/xen: build "Xen PV" APIC driver for domU as well

+16 -60
+2 -2
arch/x86/xen/Makefile
··· 13 13 obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ 14 14 time.o xen-asm.o xen-asm_$(BITS).o \ 15 15 grant-table.o suspend.o platform-pci-unplug.o \ 16 - p2m.o 16 + p2m.o apic.o 17 17 18 18 obj-$(CONFIG_EVENT_TRACING) += trace.o 19 19 20 20 obj-$(CONFIG_SMP) += smp.o 21 21 obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o 22 22 obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o 23 - obj-$(CONFIG_XEN_DOM0) += apic.o vga.o 23 + obj-$(CONFIG_XEN_DOM0) += vga.o 24 24 obj-$(CONFIG_SWIOTLB_XEN) += pci-swiotlb-xen.o 25 25 obj-$(CONFIG_XEN_EFI) += efi.o
+2 -4
arch/x86/xen/xen-ops.h
··· 101 101 102 102 #ifdef CONFIG_XEN_DOM0 103 103 void __init xen_init_vga(const struct dom0_vga_console_info *, size_t size); 104 - void __init xen_init_apic(void); 105 104 #else 106 105 static inline void __init xen_init_vga(const struct dom0_vga_console_info *info, 107 106 size_t size) 108 107 { 109 108 } 110 - static inline void __init xen_init_apic(void) 111 - { 112 - } 113 109 #endif 110 + 111 + void __init xen_init_apic(void); 114 112 115 113 #ifdef CONFIG_XEN_EFI 116 114 extern void xen_efi_init(void);
+4 -6
drivers/xen/events/events_base.c
··· 452 452 irq_free_desc(irq); 453 453 } 454 454 455 - static void xen_evtchn_close(unsigned int port, unsigned int cpu) 455 + static void xen_evtchn_close(unsigned int port) 456 456 { 457 457 struct evtchn_close close; 458 - 459 - xen_evtchn_op_close(port, cpu); 460 458 461 459 close.port = port; 462 460 if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close) != 0) ··· 544 546 545 547 err: 546 548 pr_err("irq%d: Failed to set port to irq mapping (%d)\n", irq, rc); 547 - xen_evtchn_close(evtchn, NR_CPUS); 549 + xen_evtchn_close(evtchn); 548 550 return 0; 549 551 } 550 552 ··· 565 567 return; 566 568 567 569 mask_evtchn(evtchn); 568 - xen_evtchn_close(evtchn, cpu_from_evtchn(evtchn)); 570 + xen_evtchn_close(evtchn); 569 571 xen_irq_info_cleanup(info); 570 572 } 571 573 ··· 609 611 if (VALID_EVTCHN(evtchn)) { 610 612 unsigned int cpu = cpu_from_irq(irq); 611 613 612 - xen_evtchn_close(evtchn, cpu); 614 + xen_evtchn_close(evtchn); 613 615 614 616 switch (type_from_irq(irq)) { 615 617 case IRQT_VIRQ:
+5 -40
drivers/xen/events/events_fifo.c
··· 255 255 } 256 256 } 257 257 258 - static bool evtchn_fifo_is_linked(unsigned port) 259 - { 260 - event_word_t *word = event_word_from_port(port); 261 - return sync_test_bit(EVTCHN_FIFO_BIT(LINKED, word), BM(word)); 262 - } 263 - 264 258 static uint32_t clear_linked(volatile event_word_t *word) 265 259 { 266 260 event_word_t new, old, w; ··· 281 287 282 288 static void consume_one_event(unsigned cpu, 283 289 struct evtchn_fifo_control_block *control_block, 284 - unsigned priority, unsigned long *ready, 285 - bool drop) 290 + unsigned priority, unsigned long *ready) 286 291 { 287 292 struct evtchn_fifo_queue *q = &per_cpu(cpu_queue, cpu); 288 293 uint32_t head; ··· 313 320 if (head == 0) 314 321 clear_bit(priority, ready); 315 322 316 - if (evtchn_fifo_is_pending(port) && !evtchn_fifo_is_masked(port)) { 317 - if (likely(!drop)) 318 - handle_irq_for_port(port); 319 - } 323 + if (evtchn_fifo_is_pending(port) && !evtchn_fifo_is_masked(port)) 324 + handle_irq_for_port(port); 320 325 321 326 q->head[priority] = head; 322 327 } 323 328 324 - static void __evtchn_fifo_handle_events(unsigned cpu, bool drop) 329 + static void evtchn_fifo_handle_events(unsigned cpu) 325 330 { 326 331 struct evtchn_fifo_control_block *control_block; 327 332 unsigned long ready; ··· 331 340 332 341 while (ready) { 333 342 q = find_first_bit(&ready, EVTCHN_FIFO_MAX_QUEUES); 334 - consume_one_event(cpu, control_block, q, &ready, drop); 343 + consume_one_event(cpu, control_block, q, &ready); 335 344 ready |= xchg(&control_block->ready, 0); 336 345 } 337 - } 338 - 339 - static void evtchn_fifo_handle_events(unsigned cpu) 340 - { 341 - __evtchn_fifo_handle_events(cpu, false); 342 346 } 343 347 344 348 static void evtchn_fifo_resume(void) ··· 371 385 event_array_pages = 0; 372 386 } 373 387 374 - static void evtchn_fifo_close(unsigned port, unsigned int cpu) 375 - { 376 - if (cpu == NR_CPUS) 377 - return; 378 - 379 - get_online_cpus(); 380 - if (cpu_online(cpu)) { 381 - if (WARN_ON(irqs_disabled())) 382 - goto out; 383 - 384 - while (evtchn_fifo_is_linked(port)) 385 - cpu_relax(); 386 - } else { 387 - __evtchn_fifo_handle_events(cpu, true); 388 - } 389 - 390 - out: 391 - put_online_cpus(); 392 - } 393 - 394 388 static const struct evtchn_ops evtchn_ops_fifo = { 395 389 .max_channels = evtchn_fifo_max_channels, 396 390 .nr_channels = evtchn_fifo_nr_channels, ··· 384 418 .unmask = evtchn_fifo_unmask, 385 419 .handle_events = evtchn_fifo_handle_events, 386 420 .resume = evtchn_fifo_resume, 387 - .close = evtchn_fifo_close, 388 421 }; 389 422 390 423 static int evtchn_fifo_alloc_control_block(unsigned cpu)
-7
drivers/xen/events/events_internal.h
··· 68 68 bool (*test_and_set_mask)(unsigned port); 69 69 void (*mask)(unsigned port); 70 70 void (*unmask)(unsigned port); 71 - void (*close)(unsigned port, unsigned cpu); 72 71 73 72 void (*handle_events)(unsigned cpu); 74 73 void (*resume)(void); ··· 143 144 { 144 145 if (evtchn_ops->resume) 145 146 evtchn_ops->resume(); 146 - } 147 - 148 - static inline void xen_evtchn_op_close(unsigned port, unsigned cpu) 149 - { 150 - if (evtchn_ops->close) 151 - return evtchn_ops->close(port, cpu); 152 147 } 153 148 154 149 void xen_evtchn_2l_init(void);
+3 -1
drivers/xen/xenbus/xenbus_client.c
··· 814 814 815 815 rv = xenbus_unmap_ring(dev, node->handles, node->nr_handles, 816 816 addrs); 817 - if (!rv) 817 + if (!rv) { 818 818 vunmap(vaddr); 819 + free_xenballooned_pages(node->nr_handles, node->hvm.pages); 820 + } 819 821 else 820 822 WARN(1, "Leaking %p, size %u page(s)\n", vaddr, 821 823 node->nr_handles);