Merge 3.7-rc6 into char-misc-next
This commit is contained in:
@@ -2,6 +2,7 @@ ifneq ($(CONFIG_ARM),y)
|
||||
obj-y += manage.o balloon.o
|
||||
obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o
|
||||
endif
|
||||
obj-$(CONFIG_X86) += fallback.o
|
||||
obj-y += grant-table.o features.o events.o
|
||||
obj-y += xenbus/
|
||||
|
||||
|
@@ -1395,10 +1395,10 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
|
||||
{
|
||||
struct pt_regs *old_regs = set_irq_regs(regs);
|
||||
|
||||
irq_enter();
|
||||
#ifdef CONFIG_X86
|
||||
exit_idle();
|
||||
#endif
|
||||
irq_enter();
|
||||
|
||||
__xen_evtchn_do_upcall();
|
||||
|
||||
|
80
drivers/xen/fallback.c
Normal file
80
drivers/xen/fallback.c
Normal file
@@ -0,0 +1,80 @@
|
||||
#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;
|
||||
}
|
@@ -105,6 +105,21 @@ static void gntdev_print_maps(struct gntdev_priv *priv,
|
||||
#endif
|
||||
}
|
||||
|
||||
static void gntdev_free_map(struct grant_map *map)
|
||||
{
|
||||
if (map == NULL)
|
||||
return;
|
||||
|
||||
if (map->pages)
|
||||
free_xenballooned_pages(map->count, map->pages);
|
||||
kfree(map->pages);
|
||||
kfree(map->grants);
|
||||
kfree(map->map_ops);
|
||||
kfree(map->unmap_ops);
|
||||
kfree(map->kmap_ops);
|
||||
kfree(map);
|
||||
}
|
||||
|
||||
static struct grant_map *gntdev_alloc_map(struct gntdev_priv *priv, int count)
|
||||
{
|
||||
struct grant_map *add;
|
||||
@@ -142,12 +157,7 @@ static struct grant_map *gntdev_alloc_map(struct gntdev_priv *priv, int count)
|
||||
return add;
|
||||
|
||||
err:
|
||||
kfree(add->pages);
|
||||
kfree(add->grants);
|
||||
kfree(add->map_ops);
|
||||
kfree(add->unmap_ops);
|
||||
kfree(add->kmap_ops);
|
||||
kfree(add);
|
||||
gntdev_free_map(add);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -198,17 +208,9 @@ static void gntdev_put_map(struct grant_map *map)
|
||||
evtchn_put(map->notify.event);
|
||||
}
|
||||
|
||||
if (map->pages) {
|
||||
if (!use_ptemod)
|
||||
unmap_grant_pages(map, 0, map->count);
|
||||
|
||||
free_xenballooned_pages(map->count, map->pages);
|
||||
}
|
||||
kfree(map->pages);
|
||||
kfree(map->grants);
|
||||
kfree(map->map_ops);
|
||||
kfree(map->unmap_ops);
|
||||
kfree(map);
|
||||
if (map->pages && !use_ptemod)
|
||||
unmap_grant_pages(map, 0, map->count);
|
||||
gntdev_free_map(map);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
@@ -458,7 +458,7 @@ static ssize_t xenbus_file_write(struct file *filp,
|
||||
goto out;
|
||||
|
||||
/* Can't write a xenbus message larger we can buffer */
|
||||
if ((len + u->len) > sizeof(u->u.buffer)) {
|
||||
if (len > sizeof(u->u.buffer) - u->len) {
|
||||
/* On error, dump existing buffer */
|
||||
u->len = 0;
|
||||
rc = -EINVAL;
|
||||
|
Reference in New Issue
Block a user