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>'

+20 -7
+14 -7
arch/x86/lguest/boot.c
··· 343 343 * flush_tlb_user() for both user and kernel mappings unless 344 344 * the Page Global Enable (PGE) feature bit is set. */ 345 345 *dx |= 0x00002000; 346 + /* We also lie, and say we're family id 5. 6 or greater 347 + * leads to a rdmsr in early_init_intel which we can't handle. 348 + * Family ID is returned as bits 8-12 in ax. */ 349 + *ax &= 0xFFFFF0FF; 350 + *ax |= 0x00000500; 346 351 break; 347 352 case 0x80000000: 348 353 /* Futureproof this a little: if they ask how much extended ··· 594 589 /* Some systems map "vectors" to interrupts weirdly. Lguest has 595 590 * a straightforward 1 to 1 mapping, so force that here. */ 596 591 __get_cpu_var(vector_irq)[vector] = i; 597 - if (vector != SYSCALL_VECTOR) { 598 - set_intr_gate(vector, 599 - interrupt[vector-FIRST_EXTERNAL_VECTOR]); 600 - set_irq_chip_and_handler_name(i, &lguest_irq_controller, 601 - handle_level_irq, 602 - "level"); 603 - } 592 + if (vector != SYSCALL_VECTOR) 593 + set_intr_gate(vector, interrupt[i]); 604 594 } 605 595 /* This call is required to set up for 4k stacks, where we have 606 596 * separate stacks for hard and soft interrupts. */ 607 597 irq_ctx_init(smp_processor_id()); 598 + } 599 + 600 + void lguest_setup_irq(unsigned int irq) 601 + { 602 + irq_to_desc_alloc_cpu(irq, 0); 603 + set_irq_chip_and_handler_name(irq, &lguest_irq_controller, 604 + handle_level_irq, "level"); 608 605 } 609 606 610 607 /*
+6
drivers/lguest/lguest_device.c
··· 212 212 hcall(LHCALL_NOTIFY, lvq->config.pfn << PAGE_SHIFT, 0, 0); 213 213 } 214 214 215 + /* An extern declaration inside a C file is bad form. Don't do it. */ 216 + extern void lguest_setup_irq(unsigned int irq); 217 + 215 218 /* This routine finds the first virtqueue described in the configuration of 216 219 * this device and sets it up. 217 220 * ··· 268 265 err = -ENOMEM; 269 266 goto unmap; 270 267 } 268 + 269 + /* Make sure the interrupt is allocated. */ 270 + lguest_setup_irq(lvq->config.irq); 271 271 272 272 /* Tell the interrupt for this virtqueue to go to the virtio_ring 273 273 * interrupt handler. */