1. 04 May, 2010 11 commits
    • Eric W. Biederman's avatar
      x86, ioapic: Move nr_ioapic_registers calculation to mp_register_ioapic. · 7716a5c4
      Eric W. Biederman authored
      Now that all ioapic registration happens in mp_register_ioapic we can
      move the calculation of nr_ioapic_registers there from enable_IO_APIC.
      The number of ioapic registers is already calucated in mp_register_ioapic
      so all that really needs to be done is to save the caluclated value
      in nr_ioapic_registers.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      LKML-Reference: <1269936436-7039-11-git-send-email-ebiederm@xmission.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      7716a5c4
    • Eric W. Biederman's avatar
      x86, ioapic: In mpparse use mp_register_ioapic · cf7500c0
      Eric W. Biederman authored
      Long ago MP_ioapic_info was the primary way of setting up our
      ioapic data structures and mp_register_ioapic was a compatibility
      shim for acpi code.  Now the situation is reversed and
      and mp_register_ioapic is the primary way of setting up our
      ioapic data structures.
      
      Keep the setting up of ioapic data structures uniform by
      having mp_register_ioapic call mp_register_ioapic.
      
      This changes a few fields:
      
      - type: is now hardset to MP_IOAPIC but type had to
        bey MP_IOAPIC or MP_ioapic_info would not have been called.
      
      - flags: is now hard coded to MPC_APIC_USABLE.
        We require flags to contain at least MPC_APIC_USEBLE in
        MP_ioapic_info and we don't ever examine flags so dropping
        a few flags that might possibly exist that we have never
        used is harmless.
      
      - apicaddr: Unchanged
      
      - apicver: Read from the ioapic instead of using the cached
        hardware value in the MP table.  The real hardware value
        will be more accurate.
      
      - apicid: Now verified to be unique and changed if it is not.
        If the BIOS got this right this is a noop.  If the BIOS did
        not fixing things appears to be the better solution.
      
      This adds gsi_base and gsi_end values to our ioapics defined with
      the mpatable, which will make our lives simpler later since
      we can always assume gsi_base and gsi_end are valid.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      LKML-Reference: <1269936436-7039-10-git-send-email-ebiederm@xmission.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      cf7500c0
    • Eric W. Biederman's avatar
      x86, ioapic: Teach mp_register_ioapic to compute a global gsi_end · 5777372a
      Eric W. Biederman authored
      Add the global variable gsi_end and teach mp_register_ioapic
      to keep it uptodate as we add more ioapics into the system.
      
      ioapics can only be added early in boot so the code that
      runs later can treat gsi_end as a constant.
      
      Remove the have hacks in sfi.c to second guess mp_register_ioapic
      by keeping t's own running total of how many gsi's have been seen,
      and instead use the gsi_end.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      LKML-Reference: <1269936436-7039-9-git-send-email-ebiederm@xmission.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      5777372a
    • Eric W. Biederman's avatar
      x86, ioapic: Fix the types of gsi values · eddb0c55
      Eric W. Biederman authored
      This patches fixes the types of gsi_base and gsi_end values in
      struct mp_ioapic_gsi, and the gsi parameter of mp_find_ioapic
      and mp_find_ioapic_pin
      
      A gsi is cannonically a u32, not an int.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      LKML-Reference: <1269936436-7039-8-git-send-email-ebiederm@xmission.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      eddb0c55
    • Eric W. Biederman's avatar
      x86, ioapic: Fix io_apic_redir_entries to return the number of entries. · 4b6b19a1
      Eric W. Biederman authored
      io_apic_redir_entries has a huge conceptual bug.  It returns the maximum
      redirection entry not the number of redirection entries.  Which simply
      does not match what the name of the function.  This just caught me
      and it caught  Feng Tang, and  Len Brown when they wrote sfi_parse_ioapic.
      
      Modify io_apic_redir_entries to actually return the number of redirection
      entries, and fix the callers so that they properly handle receiving the
      number of the number of redirection table entries, instead of the
      number of redirection table entries less one.
      
      While the usage in sfi.c does not show up in this patch it is fixed
      by virtue of the fact that io_apic_redir_entries now has the semantics
      sfi_parse_ioapic most reasonably expects.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      LKML-Reference: <1269936436-7039-7-git-send-email-ebiederm@xmission.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      4b6b19a1
    • Eric W. Biederman's avatar
      x86, ioapic: Only export mp_find_ioapic and mp_find_ioapic_pin in io_apic.h · 9638fa52
      Eric W. Biederman authored
      Multiple declarations of the same function in different headers
      is a pain to maintain.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      LKML-Reference: <1269936436-7039-6-git-send-email-ebiederm@xmission.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      9638fa52
    • Eric W. Biederman's avatar
      x86, acpi/irq: Generalize mp_config_acpi_legacy_irqs · 0fd52670
      Eric W. Biederman authored
      Remove the assumption that there is not an override for isa irq 0.
      Instead lookup the gsi and from that lookup the ioapic and pin of each
      isa irq indivdually.
      
      In general this should not have any behavioural affect but in
      perverse cases this gets all of the details correct, instead of
      doing something weird.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      LKML-Reference: <1269936436-7039-5-git-send-email-ebiederm@xmission.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      0fd52670
    • Eric W. Biederman's avatar
      x86, acpi/irq: Fix acpi_sci_ioapic_setup so it has both bus_irq and gsi · 9d2062b8
      Eric W. Biederman authored
      Currently acpi_sci_ioapic_setup calls mp_override_legacy_irq with
      bus_irq == gsi, which is wrong if we are comming from an override
      Instead pass the bus_irq into acpi_sci_ioapic_setup.
      
      This fix was inspired by a similar fix from:
      Yinghai Lu <yinghai@kernel.org>
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      LKML-Reference: <1269936436-7039-4-git-send-email-ebiederm@xmission.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      9d2062b8
    • Eric W. Biederman's avatar
      x86, acpi/irq: pci device dev->irq is an isa irq not a gsi · 414d3448
      Eric W. Biederman authored
      Strictly speaking on x86 (where acpi is used) dev->irq must be
      a dual i8259 irq input aka an isa irq.  Therefore we should translate
      that isa irq into a gsi before passing it to a function that
      takes a gsi.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      LKML-Reference: <1269936436-7039-3-git-send-email-ebiederm@xmission.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      414d3448
    • Eric W. Biederman's avatar
      x86, acpi/irq: Teach acpi_get_override_irq to take a gsi not an isa_irq · 9a0a91bb
      Eric W. Biederman authored
      In perverse acpi implementations the isa irqs are not identity mapped
      to the first 16 gsi.  Furthermore at least the extended interrupt
      resource capability may return gsi's and not isa irqs.  So since
      what we get from acpi is a gsi teach acpi_get_overrride_irq to
      operate on a gsi instead of an isa_irq.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      LKML-Reference: <1269936436-7039-2-git-send-email-ebiederm@xmission.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      9a0a91bb
    • Eric W. Biederman's avatar
      x86, acpi/irq: Introduce apci_isa_irq_to_gsi · 2c2df841
      Eric W. Biederman authored
      There are a number of cases where the current code makes the assumption
      that isa irqs identity map to the first 16 acpi global system intereupts.
      In most instances that assumption is correct as that is the required
      behaviour in dual i8259 mode and the default behavior in ioapic mode.
      
      However there are some systems out there that take advantage of acpis
      interrupt remapping  for the isa irqs to have a completely different
      mapping of isa_irq to gsi.
      
      Introduce acpi_isa_irq_to_gsi to perform this mapping explicitly in the
      code that needs it.  Initially this will be just the current assumed
      identity mapping to ensure it's introduction does not cause regressions.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      LKML-Reference: <1269936436-7039-1-git-send-email-ebiederm@xmission.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      2c2df841
  2. 03 May, 2010 15 commits
  3. 30 Apr, 2010 14 commits