提交 39a3478c 编写于 作者: L Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus

* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  lguest: fix for CONFIG_SPARSE_IRQ=y
  lguest: fix crash 'unhandled trap 13 at <native_read_msr_safe>'
...@@ -343,6 +343,11 @@ static void lguest_cpuid(unsigned int *ax, unsigned int *bx, ...@@ -343,6 +343,11 @@ static void lguest_cpuid(unsigned int *ax, unsigned int *bx,
* flush_tlb_user() for both user and kernel mappings unless * flush_tlb_user() for both user and kernel mappings unless
* the Page Global Enable (PGE) feature bit is set. */ * the Page Global Enable (PGE) feature bit is set. */
*dx |= 0x00002000; *dx |= 0x00002000;
/* We also lie, and say we're family id 5. 6 or greater
* leads to a rdmsr in early_init_intel which we can't handle.
* Family ID is returned as bits 8-12 in ax. */
*ax &= 0xFFFFF0FF;
*ax |= 0x00000500;
break; break;
case 0x80000000: case 0x80000000:
/* Futureproof this a little: if they ask how much extended /* Futureproof this a little: if they ask how much extended
...@@ -589,19 +594,21 @@ static void __init lguest_init_IRQ(void) ...@@ -589,19 +594,21 @@ static void __init lguest_init_IRQ(void)
/* Some systems map "vectors" to interrupts weirdly. Lguest has /* Some systems map "vectors" to interrupts weirdly. Lguest has
* a straightforward 1 to 1 mapping, so force that here. */ * a straightforward 1 to 1 mapping, so force that here. */
__get_cpu_var(vector_irq)[vector] = i; __get_cpu_var(vector_irq)[vector] = i;
if (vector != SYSCALL_VECTOR) { if (vector != SYSCALL_VECTOR)
set_intr_gate(vector, set_intr_gate(vector, interrupt[i]);
interrupt[vector-FIRST_EXTERNAL_VECTOR]);
set_irq_chip_and_handler_name(i, &lguest_irq_controller,
handle_level_irq,
"level");
}
} }
/* This call is required to set up for 4k stacks, where we have /* This call is required to set up for 4k stacks, where we have
* separate stacks for hard and soft interrupts. */ * separate stacks for hard and soft interrupts. */
irq_ctx_init(smp_processor_id()); irq_ctx_init(smp_processor_id());
} }
void lguest_setup_irq(unsigned int irq)
{
irq_to_desc_alloc_cpu(irq, 0);
set_irq_chip_and_handler_name(irq, &lguest_irq_controller,
handle_level_irq, "level");
}
/* /*
* Time. * Time.
* *
......
...@@ -212,6 +212,9 @@ static void lg_notify(struct virtqueue *vq) ...@@ -212,6 +212,9 @@ static void lg_notify(struct virtqueue *vq)
hcall(LHCALL_NOTIFY, lvq->config.pfn << PAGE_SHIFT, 0, 0); hcall(LHCALL_NOTIFY, lvq->config.pfn << PAGE_SHIFT, 0, 0);
} }
/* An extern declaration inside a C file is bad form. Don't do it. */
extern void lguest_setup_irq(unsigned int irq);
/* This routine finds the first virtqueue described in the configuration of /* This routine finds the first virtqueue described in the configuration of
* this device and sets it up. * this device and sets it up.
* *
...@@ -266,6 +269,9 @@ static struct virtqueue *lg_find_vq(struct virtio_device *vdev, ...@@ -266,6 +269,9 @@ static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
goto unmap; goto unmap;
} }
/* Make sure the interrupt is allocated. */
lguest_setup_irq(lvq->config.irq);
/* Tell the interrupt for this virtqueue to go to the virtio_ring /* Tell the interrupt for this virtqueue to go to the virtio_ring
* interrupt handler. */ * interrupt handler. */
/* FIXME: We used to have a flag for the Host to tell us we could use /* FIXME: We used to have a flag for the Host to tell us we could use
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册