aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/lguest/boot.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index aa6e3b4ce29c..2943ab931671 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -56,6 +56,7 @@
56#include <linux/virtio_console.h> 56#include <linux/virtio_console.h>
57#include <linux/pm.h> 57#include <linux/pm.h>
58#include <linux/export.h> 58#include <linux/export.h>
59#include <linux/pci.h>
59#include <asm/acpi.h> 60#include <asm/acpi.h>
60#include <asm/apic.h> 61#include <asm/apic.h>
61#include <asm/lguest.h> 62#include <asm/lguest.h>
@@ -72,6 +73,7 @@
72#include <asm/stackprotector.h> 73#include <asm/stackprotector.h>
73#include <asm/reboot.h> /* for struct machine_ops */ 74#include <asm/reboot.h> /* for struct machine_ops */
74#include <asm/kvm_para.h> 75#include <asm/kvm_para.h>
76#include <asm/pci_x86.h>
75 77
76/*G:010 78/*G:010
77 * Welcome to the Guest! 79 * Welcome to the Guest!
@@ -832,6 +834,24 @@ static struct irq_chip lguest_irq_controller = {
832 .irq_unmask = enable_lguest_irq, 834 .irq_unmask = enable_lguest_irq,
833}; 835};
834 836
837static int lguest_enable_irq(struct pci_dev *dev)
838{
839 u8 line = 0;
840
841 /* We literally use the PCI interrupt line as the irq number. */
842 pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &line);
843 irq_set_chip_and_handler_name(line, &lguest_irq_controller,
844 handle_level_irq, "level");
845 dev->irq = line;
846 return 0;
847}
848
849/* We don't do hotplug PCI, so this shouldn't be called. */
850static void lguest_disable_irq(struct pci_dev *dev)
851{
852 WARN_ON(1);
853}
854
835/* 855/*
836 * This sets up the Interrupt Descriptor Table (IDT) entry for each hardware 856 * This sets up the Interrupt Descriptor Table (IDT) entry for each hardware
837 * interrupt (except 128, which is used for system calls), and then tells the 857 * interrupt (except 128, which is used for system calls), and then tells the
@@ -1432,6 +1452,10 @@ __init void lguest_init(void)
1432 /* Don't let ACPI try to control our PCI interrupts. */ 1452 /* Don't let ACPI try to control our PCI interrupts. */
1433 disable_acpi(); 1453 disable_acpi();
1434 1454
1455 /* We control them ourselves, by overriding these two hooks. */
1456 pcibios_enable_irq = lguest_enable_irq;
1457 pcibios_disable_irq = lguest_disable_irq;
1458
1435 /* 1459 /*
1436 * Last of all, we set the power management poweroff hook to point to 1460 * Last of all, we set the power management poweroff hook to point to
1437 * the Guest routine to power off, and the reboot hook to our restart 1461 * the Guest routine to power off, and the reboot hook to our restart