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

Pull Xen fixes from Konrad Rzeszutek Wilk:
"There are three ARM compile fixes (we forgot to export certain
functions and if the drivers are built as an module - we go belly-up).

There is also an mismatch of irq_enter() / exit_idle() calls sequence
which were fixed some time ago in other piece of codes, but failed to
appear in the Xen code.

Lastly a fix for to help in the field with troubleshooting in case we
cannot get the appropriate parameter and also fallback code when
working with very old hypervisors."

Bug-fixes:
- Fix compile issues on ARM.
- Fix hypercall fallback code for old hypervisors.
- Print out which HVM parameter failed if it fails.
- Fix idle notifier call after irq_enter.

* tag 'stable/for-linus-3.7-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
xen/arm: Fix compile errors when drivers are compiled as modules (export more).
xen/arm: Fix compile errors when drivers are compiled as modules.
xen/generic: Disable fallback build on ARM.
xen/events: fix RCU warning, or Call idle notifier after irq_enter()
xen/hvm: If we fail to fetch an HVM parameter print out which flag it is.
xen/hypercall: fix hypercall fallback code for very old hypervisors

+132 -17
+11
arch/arm/xen/enlighten.c
··· 166 166 *pages = NULL; 167 167 } 168 168 EXPORT_SYMBOL_GPL(free_xenballooned_pages); 169 + 170 + /* In the hypervisor.S file. */ 171 + EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op); 172 + EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op); 173 + EXPORT_SYMBOL_GPL(HYPERVISOR_xen_version); 174 + EXPORT_SYMBOL_GPL(HYPERVISOR_console_io); 175 + EXPORT_SYMBOL_GPL(HYPERVISOR_sched_op); 176 + EXPORT_SYMBOL_GPL(HYPERVISOR_hvm_op); 177 + EXPORT_SYMBOL_GPL(HYPERVISOR_memory_op); 178 + EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op); 179 + EXPORT_SYMBOL_GPL(privcmd_call);
+7 -14
arch/x86/include/asm/xen/hypercall.h
··· 359 359 return _hypercall4(int, update_va_mapping, va, 360 360 new_val.pte, new_val.pte >> 32, flags); 361 361 } 362 + extern int __must_check xen_event_channel_op_compat(int, void *); 362 363 363 364 static inline int 364 365 HYPERVISOR_event_channel_op(int cmd, void *arg) 365 366 { 366 367 int rc = _hypercall2(int, event_channel_op, cmd, arg); 367 - if (unlikely(rc == -ENOSYS)) { 368 - struct evtchn_op op; 369 - op.cmd = cmd; 370 - memcpy(&op.u, arg, sizeof(op.u)); 371 - rc = _hypercall1(int, event_channel_op_compat, &op); 372 - memcpy(arg, &op.u, sizeof(op.u)); 373 - } 368 + if (unlikely(rc == -ENOSYS)) 369 + rc = xen_event_channel_op_compat(cmd, arg); 374 370 return rc; 375 371 } 376 372 ··· 382 386 return _hypercall3(int, console_io, cmd, count, str); 383 387 } 384 388 389 + extern int __must_check HYPERVISOR_physdev_op_compat(int, void *); 390 + 385 391 static inline int 386 392 HYPERVISOR_physdev_op(int cmd, void *arg) 387 393 { 388 394 int rc = _hypercall2(int, physdev_op, cmd, arg); 389 - if (unlikely(rc == -ENOSYS)) { 390 - struct physdev_op op; 391 - op.cmd = cmd; 392 - memcpy(&op.u, arg, sizeof(op.u)); 393 - rc = _hypercall1(int, physdev_op_compat, &op); 394 - memcpy(arg, &op.u, sizeof(op.u)); 395 - } 395 + if (unlikely(rc == -ENOSYS)) 396 + rc = HYPERVISOR_physdev_op_compat(cmd, arg); 396 397 return rc; 397 398 } 398 399
+1
drivers/xen/Makefile
··· 2 2 obj-y += manage.o balloon.o 3 3 obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o 4 4 endif 5 + obj-$(CONFIG_X86) += fallback.o 5 6 obj-y += grant-table.o features.o events.o 6 7 obj-y += xenbus/ 7 8
+1 -1
drivers/xen/events.c
··· 1395 1395 { 1396 1396 struct pt_regs *old_regs = set_irq_regs(regs); 1397 1397 1398 + irq_enter(); 1398 1399 #ifdef CONFIG_X86 1399 1400 exit_idle(); 1400 1401 #endif 1401 - irq_enter(); 1402 1402 1403 1403 __xen_evtchn_do_upcall(); 1404 1404
+80
drivers/xen/fallback.c
··· 1 + #include <linux/kernel.h> 2 + #include <linux/string.h> 3 + #include <linux/bug.h> 4 + #include <linux/export.h> 5 + #include <asm/hypervisor.h> 6 + #include <asm/xen/hypercall.h> 7 + 8 + int xen_event_channel_op_compat(int cmd, void *arg) 9 + { 10 + struct evtchn_op op; 11 + int rc; 12 + 13 + op.cmd = cmd; 14 + memcpy(&op.u, arg, sizeof(op.u)); 15 + rc = _hypercall1(int, event_channel_op_compat, &op); 16 + 17 + switch (cmd) { 18 + case EVTCHNOP_close: 19 + case EVTCHNOP_send: 20 + case EVTCHNOP_bind_vcpu: 21 + case EVTCHNOP_unmask: 22 + /* no output */ 23 + break; 24 + 25 + #define COPY_BACK(eop) \ 26 + case EVTCHNOP_##eop: \ 27 + memcpy(arg, &op.u.eop, sizeof(op.u.eop)); \ 28 + break 29 + 30 + COPY_BACK(bind_interdomain); 31 + COPY_BACK(bind_virq); 32 + COPY_BACK(bind_pirq); 33 + COPY_BACK(status); 34 + COPY_BACK(alloc_unbound); 35 + COPY_BACK(bind_ipi); 36 + #undef COPY_BACK 37 + 38 + default: 39 + WARN_ON(rc != -ENOSYS); 40 + break; 41 + } 42 + 43 + return rc; 44 + } 45 + EXPORT_SYMBOL_GPL(xen_event_channel_op_compat); 46 + 47 + int HYPERVISOR_physdev_op_compat(int cmd, void *arg) 48 + { 49 + struct physdev_op op; 50 + int rc; 51 + 52 + op.cmd = cmd; 53 + memcpy(&op.u, arg, sizeof(op.u)); 54 + rc = _hypercall1(int, physdev_op_compat, &op); 55 + 56 + switch (cmd) { 57 + case PHYSDEVOP_IRQ_UNMASK_NOTIFY: 58 + case PHYSDEVOP_set_iopl: 59 + case PHYSDEVOP_set_iobitmap: 60 + case PHYSDEVOP_apic_write: 61 + /* no output */ 62 + break; 63 + 64 + #define COPY_BACK(pop, fld) \ 65 + case PHYSDEVOP_##pop: \ 66 + memcpy(arg, &op.u.fld, sizeof(op.u.fld)); \ 67 + break 68 + 69 + COPY_BACK(irq_status_query, irq_status_query); 70 + COPY_BACK(apic_read, apic_op); 71 + COPY_BACK(ASSIGN_VECTOR, irq_op); 72 + #undef COPY_BACK 73 + 74 + default: 75 + WARN_ON(rc != -ENOSYS); 76 + break; 77 + } 78 + 79 + return rc; 80 + }
+32 -2
include/xen/hvm.h
··· 5 5 #include <xen/interface/hvm/params.h> 6 6 #include <asm/xen/hypercall.h> 7 7 8 + static const char *param_name(int op) 9 + { 10 + #define PARAM(x) [HVM_PARAM_##x] = #x 11 + static const char *const names[] = { 12 + PARAM(CALLBACK_IRQ), 13 + PARAM(STORE_PFN), 14 + PARAM(STORE_EVTCHN), 15 + PARAM(PAE_ENABLED), 16 + PARAM(IOREQ_PFN), 17 + PARAM(BUFIOREQ_PFN), 18 + PARAM(TIMER_MODE), 19 + PARAM(HPET_ENABLED), 20 + PARAM(IDENT_PT), 21 + PARAM(DM_DOMAIN), 22 + PARAM(ACPI_S_STATE), 23 + PARAM(VM86_TSS), 24 + PARAM(VPT_ALIGN), 25 + PARAM(CONSOLE_PFN), 26 + PARAM(CONSOLE_EVTCHN), 27 + }; 28 + #undef PARAM 29 + 30 + if (op >= ARRAY_SIZE(names)) 31 + return "unknown"; 32 + 33 + if (!names[op]) 34 + return "reserved"; 35 + 36 + return names[op]; 37 + } 8 38 static inline int hvm_get_parameter(int idx, uint64_t *value) 9 39 { 10 40 struct xen_hvm_param xhv; ··· 44 14 xhv.index = idx; 45 15 r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv); 46 16 if (r < 0) { 47 - printk(KERN_ERR "Cannot get hvm parameter %d: %d!\n", 48 - idx, r); 17 + printk(KERN_ERR "Cannot get hvm parameter %s (%d): %d!\n", 18 + param_name(idx), idx, r); 49 19 return r; 50 20 } 51 21 *value = xhv.value;