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 'stable/for-linus-3.7-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen

Pull Xen bugfixes from Konrad Rzeszutek Wilk:
- Use appropriate macros instead of hand-rolling our own (ARM).
- Fixes if FB/KBD closed unexpectedly.
- Fix memory leak in /dev/gntdev ioctl calls.
- Fix overflow check in xenbus_file_write.
- Document cleanup.
- Performance optimization when migrating guests.

* tag 'stable/for-linus-3.7-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
xen/mmu: Use Xen specific TLB flush instead of the generic one.
xen/arm: use the __HVC macro
xen/xenbus: fix overflow check in xenbus_file_write()
xen-kbdfront: handle backend CLOSED without CLOSING
xen-fbfront: handle backend CLOSED without CLOSING
xen/gntdev: don't leak memory from IOCTL_GNTDEV_MAP_GRANT_REF
x86: remove obsolete comment from asm/xen/hypervisor.h

+61 -31
+5 -9
arch/arm/xen/hypercall.S
··· 48 48 49 49 #include <linux/linkage.h> 50 50 #include <asm/assembler.h> 51 + #include <asm/opcodes-virt.h> 51 52 #include <xen/interface/xen.h> 52 53 53 54 54 - /* HVC 0xEA1 */ 55 - #ifdef CONFIG_THUMB2_KERNEL 56 - #define xen_hvc .word 0xf7e08ea1 57 - #else 58 - #define xen_hvc .word 0xe140ea71 59 - #endif 55 + #define XEN_IMM 0xEA1 60 56 61 57 #define HYPERCALL_SIMPLE(hypercall) \ 62 58 ENTRY(HYPERVISOR_##hypercall) \ 63 59 mov r12, #__HYPERVISOR_##hypercall; \ 64 - xen_hvc; \ 60 + __HVC(XEN_IMM); \ 65 61 mov pc, lr; \ 66 62 ENDPROC(HYPERVISOR_##hypercall) 67 63 ··· 72 76 stmdb sp!, {r4} \ 73 77 ldr r4, [sp, #4] \ 74 78 mov r12, #__HYPERVISOR_##hypercall; \ 75 - xen_hvc \ 79 + __HVC(XEN_IMM); \ 76 80 ldm sp!, {r4} \ 77 81 mov pc, lr \ 78 82 ENDPROC(HYPERVISOR_##hypercall) ··· 96 100 mov r2, r3 97 101 ldr r3, [sp, #8] 98 102 ldr r4, [sp, #4] 99 - xen_hvc 103 + __HVC(XEN_IMM) 100 104 ldm sp!, {r4} 101 105 mov pc, lr 102 106 ENDPROC(privcmd_call);
-1
arch/x86/include/asm/xen/hypervisor.h
··· 33 33 #ifndef _ASM_X86_XEN_HYPERVISOR_H 34 34 #define _ASM_X86_XEN_HYPERVISOR_H 35 35 36 - /* arch/i386/kernel/setup.c */ 37 36 extern struct shared_info *HYPERVISOR_shared_info; 38 37 extern struct start_info *xen_start_info; 39 38
+20 -1
arch/x86/xen/mmu.c
··· 1288 1288 return this_cpu_read(xen_vcpu_info.arch.cr2); 1289 1289 } 1290 1290 1291 + void xen_flush_tlb_all(void) 1292 + { 1293 + struct mmuext_op *op; 1294 + struct multicall_space mcs; 1295 + 1296 + trace_xen_mmu_flush_tlb_all(0); 1297 + 1298 + preempt_disable(); 1299 + 1300 + mcs = xen_mc_entry(sizeof(*op)); 1301 + 1302 + op = mcs.args; 1303 + op->cmd = MMUEXT_TLB_FLUSH_ALL; 1304 + MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF); 1305 + 1306 + xen_mc_issue(PARAVIRT_LAZY_MMU); 1307 + 1308 + preempt_enable(); 1309 + } 1291 1310 static void xen_flush_tlb(void) 1292 1311 { 1293 1312 struct mmuext_op *op; ··· 2537 2518 err = 0; 2538 2519 out: 2539 2520 2540 - flush_tlb_all(); 2521 + xen_flush_tlb_all(); 2541 2522 2542 2523 return err; 2543 2524 }
+4 -1
drivers/input/misc/xen-kbdfront.c
··· 311 311 case XenbusStateReconfiguring: 312 312 case XenbusStateReconfigured: 313 313 case XenbusStateUnknown: 314 - case XenbusStateClosed: 315 314 break; 316 315 317 316 case XenbusStateInitWait: ··· 349 350 350 351 break; 351 352 353 + case XenbusStateClosed: 354 + if (dev->state == XenbusStateClosed) 355 + break; 356 + /* Missed the backend's CLOSING state -- fallthrough */ 352 357 case XenbusStateClosing: 353 358 xenbus_frontend_closed(dev); 354 359 break;
+4 -1
drivers/video/xen-fbfront.c
··· 641 641 case XenbusStateReconfiguring: 642 642 case XenbusStateReconfigured: 643 643 case XenbusStateUnknown: 644 - case XenbusStateClosed: 645 644 break; 646 645 647 646 case XenbusStateInitWait: ··· 669 670 info->feature_resize = val; 670 671 break; 671 672 673 + case XenbusStateClosed: 674 + if (dev->state == XenbusStateClosed) 675 + break; 676 + /* Missed the backend's CLOSING state -- fallthrough */ 672 677 case XenbusStateClosing: 673 678 xenbus_frontend_closed(dev); 674 679 break;
+19 -17
drivers/xen/gntdev.c
··· 105 105 #endif 106 106 } 107 107 108 + static void gntdev_free_map(struct grant_map *map) 109 + { 110 + if (map == NULL) 111 + return; 112 + 113 + if (map->pages) 114 + free_xenballooned_pages(map->count, map->pages); 115 + kfree(map->pages); 116 + kfree(map->grants); 117 + kfree(map->map_ops); 118 + kfree(map->unmap_ops); 119 + kfree(map->kmap_ops); 120 + kfree(map); 121 + } 122 + 108 123 static struct grant_map *gntdev_alloc_map(struct gntdev_priv *priv, int count) 109 124 { 110 125 struct grant_map *add; ··· 157 142 return add; 158 143 159 144 err: 160 - kfree(add->pages); 161 - kfree(add->grants); 162 - kfree(add->map_ops); 163 - kfree(add->unmap_ops); 164 - kfree(add->kmap_ops); 165 - kfree(add); 145 + gntdev_free_map(add); 166 146 return NULL; 167 147 } 168 148 ··· 208 198 evtchn_put(map->notify.event); 209 199 } 210 200 211 - if (map->pages) { 212 - if (!use_ptemod) 213 - unmap_grant_pages(map, 0, map->count); 214 - 215 - free_xenballooned_pages(map->count, map->pages); 216 - } 217 - kfree(map->pages); 218 - kfree(map->grants); 219 - kfree(map->map_ops); 220 - kfree(map->unmap_ops); 221 - kfree(map); 201 + if (map->pages && !use_ptemod) 202 + unmap_grant_pages(map, 0, map->count); 203 + gntdev_free_map(map); 222 204 } 223 205 224 206 /* ------------------------------------------------------------------ */
+1 -1
drivers/xen/xenbus/xenbus_dev_frontend.c
··· 458 458 goto out; 459 459 460 460 /* Can't write a xenbus message larger we can buffer */ 461 - if ((len + u->len) > sizeof(u->u.buffer)) { 461 + if (len > sizeof(u->u.buffer) - u->len) { 462 462 /* On error, dump existing buffer */ 463 463 u->len = 0; 464 464 rc = -EINVAL;
+8
include/trace/events/xen.h
··· 377 377 DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_pin); 378 378 DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_unpin); 379 379 380 + TRACE_EVENT(xen_mmu_flush_tlb_all, 381 + TP_PROTO(int x), 382 + TP_ARGS(x), 383 + TP_STRUCT__entry(__array(char, x, 0)), 384 + TP_fast_assign((void)x), 385 + TP_printk("%s", "") 386 + ); 387 + 380 388 TRACE_EVENT(xen_mmu_flush_tlb, 381 389 TP_PROTO(int x), 382 390 TP_ARGS(x),