提交 0020dd0b 编写于 作者: L Linus Torvalds

Merge tag 'stable/for-linus-3.7-rc5-tag' of...

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
...@@ -166,3 +166,14 @@ void free_xenballooned_pages(int nr_pages, struct page **pages) ...@@ -166,3 +166,14 @@ void free_xenballooned_pages(int nr_pages, struct page **pages)
*pages = NULL; *pages = NULL;
} }
EXPORT_SYMBOL_GPL(free_xenballooned_pages); EXPORT_SYMBOL_GPL(free_xenballooned_pages);
/* In the hypervisor.S file. */
EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
EXPORT_SYMBOL_GPL(HYPERVISOR_xen_version);
EXPORT_SYMBOL_GPL(HYPERVISOR_console_io);
EXPORT_SYMBOL_GPL(HYPERVISOR_sched_op);
EXPORT_SYMBOL_GPL(HYPERVISOR_hvm_op);
EXPORT_SYMBOL_GPL(HYPERVISOR_memory_op);
EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op);
EXPORT_SYMBOL_GPL(privcmd_call);
...@@ -359,18 +359,14 @@ HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val, ...@@ -359,18 +359,14 @@ HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val,
return _hypercall4(int, update_va_mapping, va, return _hypercall4(int, update_va_mapping, va,
new_val.pte, new_val.pte >> 32, flags); new_val.pte, new_val.pte >> 32, flags);
} }
extern int __must_check xen_event_channel_op_compat(int, void *);
static inline int static inline int
HYPERVISOR_event_channel_op(int cmd, void *arg) HYPERVISOR_event_channel_op(int cmd, void *arg)
{ {
int rc = _hypercall2(int, event_channel_op, cmd, arg); int rc = _hypercall2(int, event_channel_op, cmd, arg);
if (unlikely(rc == -ENOSYS)) { if (unlikely(rc == -ENOSYS))
struct evtchn_op op; rc = xen_event_channel_op_compat(cmd, arg);
op.cmd = cmd;
memcpy(&op.u, arg, sizeof(op.u));
rc = _hypercall1(int, event_channel_op_compat, &op);
memcpy(arg, &op.u, sizeof(op.u));
}
return rc; return rc;
} }
...@@ -386,17 +382,14 @@ HYPERVISOR_console_io(int cmd, int count, char *str) ...@@ -386,17 +382,14 @@ HYPERVISOR_console_io(int cmd, int count, char *str)
return _hypercall3(int, console_io, cmd, count, str); return _hypercall3(int, console_io, cmd, count, str);
} }
extern int __must_check HYPERVISOR_physdev_op_compat(int, void *);
static inline int static inline int
HYPERVISOR_physdev_op(int cmd, void *arg) HYPERVISOR_physdev_op(int cmd, void *arg)
{ {
int rc = _hypercall2(int, physdev_op, cmd, arg); int rc = _hypercall2(int, physdev_op, cmd, arg);
if (unlikely(rc == -ENOSYS)) { if (unlikely(rc == -ENOSYS))
struct physdev_op op; rc = HYPERVISOR_physdev_op_compat(cmd, arg);
op.cmd = cmd;
memcpy(&op.u, arg, sizeof(op.u));
rc = _hypercall1(int, physdev_op_compat, &op);
memcpy(arg, &op.u, sizeof(op.u));
}
return rc; return rc;
} }
......
...@@ -2,6 +2,7 @@ ifneq ($(CONFIG_ARM),y) ...@@ -2,6 +2,7 @@ ifneq ($(CONFIG_ARM),y)
obj-y += manage.o balloon.o obj-y += manage.o balloon.o
obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o
endif endif
obj-$(CONFIG_X86) += fallback.o
obj-y += grant-table.o features.o events.o obj-y += grant-table.o features.o events.o
obj-y += xenbus/ obj-y += xenbus/
......
...@@ -1395,10 +1395,10 @@ void xen_evtchn_do_upcall(struct pt_regs *regs) ...@@ -1395,10 +1395,10 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
{ {
struct pt_regs *old_regs = set_irq_regs(regs); struct pt_regs *old_regs = set_irq_regs(regs);
irq_enter();
#ifdef CONFIG_X86 #ifdef CONFIG_X86
exit_idle(); exit_idle();
#endif #endif
irq_enter();
__xen_evtchn_do_upcall(); __xen_evtchn_do_upcall();
......
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/bug.h>
#include <linux/export.h>
#include <asm/hypervisor.h>
#include <asm/xen/hypercall.h>
int xen_event_channel_op_compat(int cmd, void *arg)
{
struct evtchn_op op;
int rc;
op.cmd = cmd;
memcpy(&op.u, arg, sizeof(op.u));
rc = _hypercall1(int, event_channel_op_compat, &op);
switch (cmd) {
case EVTCHNOP_close:
case EVTCHNOP_send:
case EVTCHNOP_bind_vcpu:
case EVTCHNOP_unmask:
/* no output */
break;
#define COPY_BACK(eop) \
case EVTCHNOP_##eop: \
memcpy(arg, &op.u.eop, sizeof(op.u.eop)); \
break
COPY_BACK(bind_interdomain);
COPY_BACK(bind_virq);
COPY_BACK(bind_pirq);
COPY_BACK(status);
COPY_BACK(alloc_unbound);
COPY_BACK(bind_ipi);
#undef COPY_BACK
default:
WARN_ON(rc != -ENOSYS);
break;
}
return rc;
}
EXPORT_SYMBOL_GPL(xen_event_channel_op_compat);
int HYPERVISOR_physdev_op_compat(int cmd, void *arg)
{
struct physdev_op op;
int rc;
op.cmd = cmd;
memcpy(&op.u, arg, sizeof(op.u));
rc = _hypercall1(int, physdev_op_compat, &op);
switch (cmd) {
case PHYSDEVOP_IRQ_UNMASK_NOTIFY:
case PHYSDEVOP_set_iopl:
case PHYSDEVOP_set_iobitmap:
case PHYSDEVOP_apic_write:
/* no output */
break;
#define COPY_BACK(pop, fld) \
case PHYSDEVOP_##pop: \
memcpy(arg, &op.u.fld, sizeof(op.u.fld)); \
break
COPY_BACK(irq_status_query, irq_status_query);
COPY_BACK(apic_read, apic_op);
COPY_BACK(ASSIGN_VECTOR, irq_op);
#undef COPY_BACK
default:
WARN_ON(rc != -ENOSYS);
break;
}
return rc;
}
...@@ -5,6 +5,36 @@ ...@@ -5,6 +5,36 @@
#include <xen/interface/hvm/params.h> #include <xen/interface/hvm/params.h>
#include <asm/xen/hypercall.h> #include <asm/xen/hypercall.h>
static const char *param_name(int op)
{
#define PARAM(x) [HVM_PARAM_##x] = #x
static const char *const names[] = {
PARAM(CALLBACK_IRQ),
PARAM(STORE_PFN),
PARAM(STORE_EVTCHN),
PARAM(PAE_ENABLED),
PARAM(IOREQ_PFN),
PARAM(BUFIOREQ_PFN),
PARAM(TIMER_MODE),
PARAM(HPET_ENABLED),
PARAM(IDENT_PT),
PARAM(DM_DOMAIN),
PARAM(ACPI_S_STATE),
PARAM(VM86_TSS),
PARAM(VPT_ALIGN),
PARAM(CONSOLE_PFN),
PARAM(CONSOLE_EVTCHN),
};
#undef PARAM
if (op >= ARRAY_SIZE(names))
return "unknown";
if (!names[op])
return "reserved";
return names[op];
}
static inline int hvm_get_parameter(int idx, uint64_t *value) static inline int hvm_get_parameter(int idx, uint64_t *value)
{ {
struct xen_hvm_param xhv; struct xen_hvm_param xhv;
...@@ -14,8 +44,8 @@ static inline int hvm_get_parameter(int idx, uint64_t *value) ...@@ -14,8 +44,8 @@ static inline int hvm_get_parameter(int idx, uint64_t *value)
xhv.index = idx; xhv.index = idx;
r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv); r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv);
if (r < 0) { if (r < 0) {
printk(KERN_ERR "Cannot get hvm parameter %d: %d!\n", printk(KERN_ERR "Cannot get hvm parameter %s (%d): %d!\n",
idx, r); param_name(idx), idx, r);
return r; return r;
} }
*value = xhv.value; *value = xhv.value;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册