aboutsummaryrefslogtreecommitdiff
path: root/sys/x86
diff options
context:
space:
mode:
authorRoger Pau Monné <royger@FreeBSD.org>2015-02-16 16:37:59 +0000
committerRoger Pau Monné <royger@FreeBSD.org>2015-02-16 16:37:59 +0000
commit69138e87889b0107df5b3a994e226d7928640e51 (patch)
tree6c0bda856b24c60b20a02081852aec5184f3af2b /sys/x86
parenta2c525128191f7e4f5c88f1c45b4dae870e9a8d2 (diff)
downloadsrc-69138e87889b0107df5b3a994e226d7928640e51.tar.gz
src-69138e87889b0107df5b3a994e226d7928640e51.zip
xen/intr: improve handling of legacy IRQs
Devices that use ISA IRQs expect them to be already configured, and don't call bus_config_intr, which prevents those IRQs from working on Xen. In order to solve it pre-register all the legacy IRQs with the default values (edge triggered, low polarity) if no override is found. While there add a panic if the registration of an interrupt override fails. Sponsored by: Citrix Systems R&D
Notes
Notes: svn path=/head/; revision=278855
Diffstat (limited to 'sys/x86')
-rw-r--r--sys/x86/xen/pvcpu_enum.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/sys/x86/xen/pvcpu_enum.c b/sys/x86/xen/pvcpu_enum.c
index 8d54bddfe2fe..5b8b053a73d3 100644
--- a/sys/x86/xen/pvcpu_enum.c
+++ b/sys/x86/xen/pvcpu_enum.c
@@ -81,6 +81,7 @@ madt_parse_interrupt_override(ACPI_MADT_INTERRUPT_OVERRIDE *intr)
{
enum intr_trigger trig;
enum intr_polarity pol;
+ int ret;
if (acpi_quirks & ACPI_Q_MADT_IRQ0 && intr->SourceIrq == 0 &&
intr->GlobalIrq == 2) {
@@ -101,7 +102,9 @@ madt_parse_interrupt_override(ACPI_MADT_INTERRUPT_OVERRIDE *intr)
acpi_OverrideInterruptLevel(intr->GlobalIrq);
/* Register the IRQ with the polarity and trigger mode found. */
- xen_register_pirq(intr->GlobalIrq, trig, pol);
+ ret = xen_register_pirq(intr->GlobalIrq, trig, pol);
+ if (ret != 0)
+ panic("Unable to register interrupt override");
}
/*
@@ -175,7 +178,7 @@ xenpv_setup_io(void)
{
if (xen_initial_domain()) {
- int i;
+ int i, ret;
/* Map MADT */
madt_physaddr = acpi_find_table(ACPI_SIG_MADT);
@@ -201,8 +204,21 @@ xenpv_setup_io(void)
if (!madt_found_sci_override) {
printf(
"MADT: Forcing active-low polarity and level trigger for SCI\n");
- xen_register_pirq(AcpiGbl_FADT.SciInterrupt,
+ ret = xen_register_pirq(AcpiGbl_FADT.SciInterrupt,
INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW);
+ if (ret != 0)
+ panic("Unable to register SCI IRQ");
+ }
+
+ /* Register legacy ISA IRQs */
+ for (i = 1; i < 16; i++) {
+ if (intr_lookup_source(i) != NULL)
+ continue;
+ ret = xen_register_pirq(i, INTR_TRIGGER_EDGE,
+ INTR_POLARITY_LOW);
+ if (ret != 0 && bootverbose)
+ printf("Unable to register legacy IRQ#%d: %d\n",
+ i, ret);
}
acpi_SetDefaultIntrModel(ACPI_INTR_APIC);