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 * flush_tlb_user() for both user and kernel mappings unless 344 * the Page Global Enable (PGE) feature bit is set. */ 345 *dx |= 0x00002000; 346 break; 347 case 0x80000000: 348 /* Futureproof this a little: if they ask how much extended ··· 594 /* Some systems map "vectors" to interrupts weirdly. Lguest has 595 * a straightforward 1 to 1 mapping, so force that here. */ 596 __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 - } 604 } 605 /* This call is required to set up for 4k stacks, where we have 606 * separate stacks for hard and soft interrupts. */ 607 irq_ctx_init(smp_processor_id()); 608 } 609 610 /*
··· 343 * flush_tlb_user() for both user and kernel mappings unless 344 * the Page Global Enable (PGE) feature bit is set. */ 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; 351 break; 352 case 0x80000000: 353 /* Futureproof this a little: if they ask how much extended ··· 589 /* Some systems map "vectors" to interrupts weirdly. Lguest has 590 * a straightforward 1 to 1 mapping, so force that here. */ 591 __get_cpu_var(vector_irq)[vector] = i; 592 + if (vector != SYSCALL_VECTOR) 593 + set_intr_gate(vector, interrupt[i]); 594 } 595 /* This call is required to set up for 4k stacks, where we have 596 * separate stacks for hard and soft interrupts. */ 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"); 605 } 606 607 /*
+6
drivers/lguest/lguest_device.c
··· 212 hcall(LHCALL_NOTIFY, lvq->config.pfn << PAGE_SHIFT, 0, 0); 213 } 214 215 /* This routine finds the first virtqueue described in the configuration of 216 * this device and sets it up. 217 * ··· 268 err = -ENOMEM; 269 goto unmap; 270 } 271 272 /* Tell the interrupt for this virtqueue to go to the virtio_ring 273 * interrupt handler. */
··· 212 hcall(LHCALL_NOTIFY, lvq->config.pfn << PAGE_SHIFT, 0, 0); 213 } 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 + 218 /* This routine finds the first virtqueue described in the configuration of 219 * this device and sets it up. 220 * ··· 265 err = -ENOMEM; 266 goto unmap; 267 } 268 + 269 + /* Make sure the interrupt is allocated. */ 270 + lguest_setup_irq(lvq->config.irq); 271 272 /* Tell the interrupt for this virtqueue to go to the virtio_ring 273 * interrupt handler. */