summaryrefslogtreecommitdiffstats
path: root/arch/x86/lguest
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2015-02-11 15:15:10 +1030
committerRusty Russell <rusty@rustcorp.com.au>2015-02-11 16:47:34 +1030
commite1b83e27881cf3153ce420aea853797fed29a9ea (patch)
tree81826521d6dfacca02c6f253df0524815ad46c44 /arch/x86/lguest
parentee72576c143d8e9081ae1fe8644122454dd323c5 (diff)
downloadtalos-obmc-linux-e1b83e27881cf3153ce420aea853797fed29a9ea.tar.gz
talos-obmc-linux-e1b83e27881cf3153ce420aea853797fed29a9ea.zip
lguest: Override pcibios_enable_irq/pcibios_disable_irq to our stupid PIC
This lets us deliver interrupts for our emulated PCI devices using our dumb PIC, and not emulate an 8259 and PCI irq mapping tables or whatever. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'arch/x86/lguest')
-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 @@
#include <linux/virtio_console.h>
#include <linux/pm.h>
#include <linux/export.h>
+#include <linux/pci.h>
#include <asm/acpi.h>
#include <asm/apic.h>
#include <asm/lguest.h>
@@ -72,6 +73,7 @@
#include <asm/stackprotector.h>
#include <asm/reboot.h> /* for struct machine_ops */
#include <asm/kvm_para.h>
+#include <asm/pci_x86.h>
/*G:010
* Welcome to the Guest!
@@ -832,6 +834,24 @@ static struct irq_chip lguest_irq_controller = {
.irq_unmask = enable_lguest_irq,
};
+static int lguest_enable_irq(struct pci_dev *dev)
+{
+ u8 line = 0;
+
+ /* We literally use the PCI interrupt line as the irq number. */
+ pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &line);
+ irq_set_chip_and_handler_name(line, &lguest_irq_controller,
+ handle_level_irq, "level");
+ dev->irq = line;
+ return 0;
+}
+
+/* We don't do hotplug PCI, so this shouldn't be called. */
+static void lguest_disable_irq(struct pci_dev *dev)
+{
+ WARN_ON(1);
+}
+
/*
* This sets up the Interrupt Descriptor Table (IDT) entry for each hardware
* interrupt (except 128, which is used for system calls), and then tells the
@@ -1432,6 +1452,10 @@ __init void lguest_init(void)
/* Don't let ACPI try to control our PCI interrupts. */
disable_acpi();
+ /* We control them ourselves, by overriding these two hooks. */
+ pcibios_enable_irq = lguest_enable_irq;
+ pcibios_disable_irq = lguest_disable_irq;
+
/*
* Last of all, we set the power management poweroff hook to point to
* the Guest routine to power off, and the reboot hook to our restart
OpenPOWER on IntegriCloud