20 Dec, 2014

4 commits

  • Pull x86 apic updates from Thomas Gleixner:
    "After stopping the full x86/apic branch, I took some time to go
    through the first block of patches again, which are mostly cleanups
    and preparatory work for the irqdomain conversion and ioapic hotplug
    support.

    Unfortunaly one of the real problematic commits was right at the
    beginning, so I rebased this portion of the pending patches without
    the offenders.

    It would be great to get this into 3.19. That makes reworking the
    problematic parts simpler. The usual tip testing did not unearth any
    issues and it is fully bisectible now.

    I'm pretty confident that this wont affect the calmness of the xmas
    season.

    Changes:
    - Split the convoluted io_apic.c code into domain specific parts
    (vector, ioapic, msi, htirq)
    - Introduce proper helper functions to retrieve irq specific data
    instead of open coded dereferencing of pointers
    - Preparatory work for ioapic hotplug and irqdomain conversion
    - Removal of the non functional pci-ioapic driver
    - Removal of unused irq entry stubs
    - Make native_smp_prepare_cpus() preemtible to avoid GFP_ATOMIC
    allocations for everything which is called from there.
    - Small cleanups and fixes"

    * 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (36 commits)
    iommu/amd: Use helpers to access irq_cfg data structure associated with IRQ
    iommu/vt-d: Use helpers to access irq_cfg data structure associated with IRQ
    x86: irq_remapping: Use helpers to access irq_cfg data structure associated with IRQ
    x86, irq: Use helpers to access irq_cfg data structure associated with IRQ
    x86, irq: Make MSI and HT_IRQ indepenent of X86_IO_APIC
    x86, irq: Move IRQ initialization routines from io_apic.c into vector.c
    x86, irq: Move IOAPIC related declarations from hw_irq.h into io_apic.h
    x86, irq: Move HT IRQ related code from io_apic.c into htirq.c
    x86, irq: Move PCI MSI related code from io_apic.c into msi.c
    x86, irq: Replace printk(KERN_LVL) with pr_lvl() utilities
    x86, irq: Make UP version of irq_complete_move() an inline stub
    x86, irq: Move local APIC related code from io_apic.c into vector.c
    x86, irq: Introduce helpers to access struct irq_cfg
    x86, irq: Protect __clear_irq_vector() with vector_lock
    x86, irq: Rename local APIC related functions in io_apic.c as apic_xxx()
    x86, irq: Refine hw_irq.h to prepare for irqdomain support
    x86, irq: Convert irq_2_pin list to generic list
    x86, irq: Kill useless parameter 'irq_attr' of IO_APIC_get_PCI_irq_vector()
    x86, irq, acpi: Get rid of special handling of GSI for ACPI SCI
    x86, irq: Introduce helper to check whether an IOAPIC has been registered
    ...

    Linus Torvalds
     
  • Pull x86 MPX fixes from Thomas Gleixner:
    "Three updates for the new MPX infrastructure:
    - Use the proper error check in the trap handler
    - Add a proper config option for it
    - Bring documentation up to date"

    * 'x86-mpx-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86, mpx: Give MPX a real config option prompt
    x86, mpx: Update documentation
    x86_64/traps: Fix always true condition

    Linus Torvalds
     
  • Pull x86 fix from Ingo Molnar:
    "This contains a single TLS ABI validation fix from Andy Lutomirski"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/tls: Don't validate lm in set_thread_area() after all

    Linus Torvalds
     
  • Pull perf fixes and cleanups from Ingo Molnar:
    "A kernel fix plus mostly tooling fixes, but also some tooling
    restructuring and cleanups"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (39 commits)
    perf: Fix building warning on ARM 32
    perf symbols: Fix use after free in filename__read_build_id
    perf evlist: Use roundup_pow_of_two
    tools: Adopt roundup_pow_of_two
    perf tools: Make the mmap length autotuning more robust
    tools: Adopt rounddown_pow_of_two and deps
    tools: Adopt fls_long and deps
    tools: Move bitops.h from tools/perf/util to tools/
    tools: Introduce asm-generic/bitops.h
    tools lib: Move asm-generic/bitops/find.h code to tools/include and tools/lib
    tools: Whitespace prep patches for moving bitops.h
    tools: Move code originally from asm-generic/atomic.h into tools/include/asm-generic/
    tools: Move code originally from linux/log2.h to tools/include/linux/
    tools: Move __ffs implementation to tools/include/asm-generic/bitops/__ffs.h
    perf evlist: Do not use hard coded value for a mmap_pages default
    perf trace: Let the perf_evlist__mmap autosize the number of pages to use
    perf evlist: Improve the strerror_mmap method
    perf evlist: Clarify sterror_mmap variable names
    perf evlist: Fixup brown paper bag on "hint" for --mmap-pages cmdline arg
    perf trace: Provide a better explanation when mmap fails
    ...

    Linus Torvalds
     

19 Dec, 2014

2 commits

  • Pull more ACPI and power management updates from Rafael Wysocki:
    "These are regression fixes (leds-gpio, ACPI backlight driver,
    operating performance points library, ACPI device enumeration
    messages, cpupower tool), other bug fixes (ACPI EC driver, ACPI device
    PM), some cleanups in the operating performance points (OPP)
    framework, continuation of CONFIG_PM_RUNTIME elimination, a couple of
    minor intel_pstate driver changes, a new MAINTAINERS entry for it and
    an ACPI fan driver change needed for better support of thermal
    management in user space.

    Specifics:

    - Fix a regression in leds-gpio introduced by a recent commit that
    inadvertently changed the name of one of the properties used by the
    driver (Fabio Estevam).

    - Fix a regression in the ACPI backlight driver introduced by a
    recent fix that missed one special case that had to be taken into
    account (Aaron Lu).

    - Drop the level of some new kernel messages from the ACPI core
    introduced by a recent commit to KERN_DEBUG which they should have
    used from the start and drop some other unuseful KERN_ERR messages
    printed by ACPI (Rafael J Wysocki).

    - Revert an incorrect commit modifying the cpupower tool (Prarit
    Bhargava).

    - Fix two regressions introduced by recent commits in the OPP library
    and clean up some existing minor issues in that code (Viresh
    Kumar).

    - Continue to replace CONFIG_PM_RUNTIME with CONFIG_PM throughout the
    tree (or drop it where that can be done) in order to make it
    possible to eliminate CONFIG_PM_RUNTIME (Rafael J Wysocki, Ulf
    Hansson, Ludovic Desroches).

    There will be one more "CONFIG_PM_RUNTIME removal" batch after this
    one, because some new uses of it have been introduced during the
    current merge window, but that should be sufficient to finally get
    rid of it.

    - Make the ACPI EC driver more robust against race conditions related
    to GPE handler installation failures (Lv Zheng).

    - Prevent the ACPI device PM core code from attempting to disable
    GPEs that it has not enabled which confuses ACPICA and makes it
    report errors unnecessarily (Rafael J Wysocki).

    - Add a "force" command line switch to the intel_pstate driver to
    make it possible to override the blacklisting of some systems in
    that driver if needed (Ethan Zhao).

    - Improve intel_pstate code documentation and add a MAINTAINERS entry
    for it (Kristen Carlson Accardi).

    - Make the ACPI fan driver create cooling device interfaces witn
    names that reflect the IDs of the ACPI device objects they are
    associated with, except for "generic" ACPI fans (PNP ID "PNP0C0B").

    That's necessary for user space thermal management tools to be able
    to connect the fans with the parts of the system they are supposed
    to be cooling properly. From Srinivas Pandruvada"

    * tag 'pm+acpi-3.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits)
    MAINTAINERS: add entry for intel_pstate
    ACPI / video: update the skip case for acpi_video_device_in_dod()
    power / PM: Eliminate CONFIG_PM_RUNTIME
    NFC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    ACPI / EC: Fix unexpected ec_remove_handlers() invocations
    Revert "tools: cpupower: fix return checks for sysfs_get_idlestate_count()"
    tracing / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    x86 / PM: Replace CONFIG_PM_RUNTIME in io_apic.c
    PM: Remove the SET_PM_RUNTIME_PM_OPS() macro
    mmc: atmel-mci: use SET_RUNTIME_PM_OPS() macro
    PM / Kconfig: Replace PM_RUNTIME with PM in dependencies
    ARM / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    sound / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    phy / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    video / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    tty / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    spi: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    ACPI / PM: Do not disable wakeup GPEs that have not been enabled
    ACPI / utils: Drop error messages from acpi_evaluate_reference()
    ...

    Linus Torvalds
     
  • Pull KVM update from Paolo Bonzini:
    "3.19 changes for KVM:

    - spring cleaning: removed support for IA64, and for hardware-
    assisted virtualization on the PPC970

    - ARM, PPC, s390 all had only small fixes

    For x86:
    - small performance improvements (though only on weird guests)
    - usual round of hardware-compliancy fixes from Nadav
    - APICv fixes
    - XSAVES support for hosts and guests. XSAVES hosts were broken
    because the (non-KVM) XSAVES patches inadvertently changed the KVM
    userspace ABI whenever XSAVES was enabled; hence, this part is
    going to stable. Guest support is just a matter of exposing the
    feature and CPUID leaves support"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (179 commits)
    KVM: move APIC types to arch/x86/
    KVM: PPC: Book3S: Enable in-kernel XICS emulation by default
    KVM: PPC: Book3S HV: Improve H_CONFER implementation
    KVM: PPC: Book3S HV: Fix endianness of instruction obtained from HEIR register
    KVM: PPC: Book3S HV: Remove code for PPC970 processors
    KVM: PPC: Book3S HV: Tracepoints for KVM HV guest interactions
    KVM: PPC: Book3S HV: Simplify locking around stolen time calculations
    arch: powerpc: kvm: book3s_paired_singles.c: Remove unused function
    arch: powerpc: kvm: book3s_pr.c: Remove unused function
    arch: powerpc: kvm: book3s.c: Remove some unused functions
    arch: powerpc: kvm: book3s_32_mmu.c: Remove unused function
    KVM: PPC: Book3S HV: Check wait conditions before sleeping in kvmppc_vcore_blocked
    KVM: PPC: Book3S HV: ptes are big endian
    KVM: PPC: Book3S HV: Fix inaccuracies in ICP emulation for H_IPI
    KVM: PPC: Book3S HV: Fix KSM memory corruption
    KVM: PPC: Book3S HV: Fix an issue where guest is paused on receiving HMI
    KVM: PPC: Book3S HV: Fix computation of tlbie operand
    KVM: PPC: Book3S HV: Add missing HPTE unlock
    KVM: PPC: BookE: Improve irq inject tracepoint
    arm/arm64: KVM: Require in-kernel vgic for the arch timers
    ...

    Linus Torvalds
     

18 Dec, 2014

3 commits

  • It turns out that there's a lurking ABI issue. GCC, when
    compiling this in a 32-bit program:

    struct user_desc desc = {
    .entry_number = idx,
    .base_addr = base,
    .limit = 0xfffff,
    .seg_32bit = 1,
    .contents = 0, /* Data, grow-up */
    .read_exec_only = 0,
    .limit_in_pages = 1,
    .seg_not_present = 0,
    .useable = 0,
    };

    will leave .lm uninitialized. This means that anything in the
    kernel that reads user_desc.lm for 32-bit tasks is unreliable.

    Revert the .lm check in set_thread_area(). The value never did
    anything in the first place.

    Fixes: 0e58af4e1d21 ("x86/tls: Disallow unusual TLS segments")
    Signed-off-by: Andy Lutomirski
    Acked-by: Thomas Gleixner
    Cc: stable@vger.kernel.org # Only if 0e58af4e1d21 is backported
    Cc: Linus Torvalds
    Link: http://lkml.kernel.org/r/d7875b60e28c512f6a6fc0baf5714d58e7eaadbb.1418856405.git.luto@amacapital.net
    Signed-off-by: Ingo Molnar

    Andy Lutomirski
     
  • They are not used anymore by IA64, move them away.

    Signed-off-by: Paolo Bonzini

    Paolo Bonzini
     
  • My commit 26178ec11ef3 ("x86: mm: consolidate VM_FAULT_RETRY handling")
    had a really stupid typo: the FAULT_FLAG_USER bit is in the 'flags'
    variable, not the 'fault' variable. Duh,

    The one silver lining in this is that Dave finding this at least
    confirms that trinity actually triggers this special path easily, in a
    way normal use does not.

    Reported-by: Dave Jones
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

17 Dec, 2014

1 commit

  • Pull additional xen update from David Vrabel:
    "Xen: additional features for 3.19-rc0

    - Linear p2m for x86 PV guests which simplifies the p2m code,
    improves performance and will allow for > 512 GB PV guests in the
    future.

    A last-minute, configuration specific issue was discovered with this
    change which is why it was not included in my previous pull request.
    This is now been fixed and tested"

    * tag 'stable/for-linus-3.19-rc0b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
    xen: switch to post-init routines in xen mmu.c earlier
    Revert "swiotlb-xen: pass dev_addr to swiotlb_tbl_unmap_single"
    xen: annotate xen_set_identity_and_remap_chunk() with __init
    xen: introduce helper functions to do safe read and write accesses
    xen: Speed up set_phys_to_machine() by using read-only mappings
    xen: switch to linear virtual mapped sparse p2m list
    xen: Hide get_phys_to_machine() to be able to tune common path
    x86: Introduce function to get pmd entry pointer
    xen: Delay invalidating extra memory
    xen: Delay m2p_override initialization
    xen: Delay remapping memory of pv-domain
    xen: use common page allocation function in p2m.c
    xen: Make functions static
    xen: fix some style issues in p2m.c

    Linus Torvalds
     

16 Dec, 2014

30 commits

  • Use helpers to access irq_cfg data structure associated with IRQ,
    instead of accessing irq_data->chip_data directly. Later we can
    rewrite those helpers to support hierarchy irqdomain.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Grant Likely
    Cc: Prarit Bhargava
    Link: http://lkml.kernel.org/r/1414397531-28254-17-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Now we have splitted functions to support MSI and HT_IRQ into vector.c,
    and they have no dependency on IOAPIC any more. So change Kconfig files
    to make MSI and HT_IRQ independent of X86_IO_APIC.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Link: http://lkml.kernel.org/r/1414397531-28254-16-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Move IRQ initialization routines from io_apic.c into vector.c,
    preparing for enabling hierarchy irqdomain.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Grant Likely
    Cc: Prarit Bhargava
    Link: http://lkml.kernel.org/r/1414397531-28254-15-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Clean up code by moving IOAPIC related declarations from hw_irq.h into
    io_apic.h.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: H. Peter Anvin
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Prarit Bhargava
    Cc: Grant Likely
    Cc: Vivek Goyal
    Cc: Baoquan He
    Cc: Matt Fleming
    Cc: Fenghua Yu
    Cc: Christian Gmeiner
    Cc: Aubrey
    Cc: Ryan Desfosses
    Cc: Quentin Lambert
    Cc: Rafael J. Wysocki
    Link: http://lkml.kernel.org/r/1414397531-28254-14-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Create arch/x86/kernel/apic/htirq.c to host Hypertransport IRQ related
    code, preparing for enabling hierarchy irqdomain.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Grant Likely
    Cc: Prarit Bhargava
    Link: http://lkml.kernel.org/r/1414397531-28254-13-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Create arch/x86/kernel/apic/msi.c to host MSI related code,
    preparing for enabling hierarchy irqdomain.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Rafael J. Wysocki
    Cc: Grant Likely
    Cc: Prarit Bhargava
    Link: http://lkml.kernel.org/r/1414397531-28254-12-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Replace printk(KENR_LVL) with pr_lvl() to keep checkpatch script silent.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Link: http://lkml.kernel.org/r/1414397531-28254-11-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • No point for having an empty real function.

    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • Create arch/x86/kernel/apic/vector.c to host local APIC related code,
    prepare for making MSI/HT_IRQ independent of IOAPIC.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Prarit Bhargava
    Cc: Grant Likely
    Link: http://lkml.kernel.org/r/1414397531-28254-10-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Change irq_cfg() from static to extern, also introduce helper function
    irqd_cfg(). Later we can rewrite these two helpers when enabling
    hierarchy irqdomain.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Prarit Bhargava
    Cc: Grant Likely
    Link: http://lkml.kernel.org/r/1414397531-28254-9-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Function __clear_irq_vector() accesses vector related data structure,
    so protect it with vector_lock. Also rename it as clear_irq_vector().

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Grant Likely
    Cc: Prarit Bhargava
    Link: http://lkml.kernel.org/r/1414397531-28254-8-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Rename local APIC related functions in io_apic.c as apic_xxx() instead
    of ioapic_xxx(), later they will be moved into separate file.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Prarit Bhargava
    Cc: Grant Likely
    Link: http://lkml.kernel.org/r/1414397531-28254-7-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Refine hw_irq.h to prepare for irqdomain support by:

    1) guarding common APIC related interfaces with CONFIG_X86_LOCAL_APIC
    2) guarding interrupt remapping related interfaces with CONFIG_IRQ_REMAP
    3) guarding IOAPIC related interfaces with CONFIG_X86_IO_APIC

    No functional changes.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Prarit Bhargava
    Link: http://lkml.kernel.org/r/1414397531-28254-6-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Use generic list to replace private list implementation so we can use
    the existing helper functions.

    Signed-off-by: Yinghai Lu
    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Sebastian Andrzej Siewior
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Borislav Petkov
    Cc: Prarit Bhargava
    Cc: Grant Likely
    Link: http://lkml.kernel.org/r/1414397531-28254-5-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner
    Cc: Konrad Rzeszutek Wilk
    Cc: Sebastian Andrzej Siewior
    Cc: Joerg Roedel

    Yinghai Lu
     
  • None of the callers requires irq_attr to be filled
    in. IO_APIC_get_PCI_irq_vector() does not do anything useful with it
    either.

    Remove the parameter and fixup the call sites.

    [ tglx: Massaged changelog ]

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Prarit Bhargava
    Cc: Grant Likely
    Cc: Ryan Desfosses
    Cc: Quentin Lambert
    Cc: Rafael J. Wysocki
    Link: http://lkml.kernel.org/r/1414397531-28254-4-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • The IOAPIC has logic to track IOAPIC pin status, so there's no need for
    special treatment for GSI used by ACPI SCI in function mp_register_gsi()
    and mp_unregister_gsi().

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Len Brown
    Cc: Pavel Machek
    Link: http://lkml.kernel.org/r/1414397531-28254-2-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Introduce acpi_ioapic_registered() to check whether an IOAPIC has already
    been registered, it will be used when enabling IOAPIC hotplug.

    Signed-off-by: Jiang Liu
    Acked-by: Pavel Machek
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Len Brown
    Cc: Grant Likely
    Cc: Prarit Bhargava
    Link: http://lkml.kernel.org/r/1414387308-27148-18-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Implement acpi_unregister_ioapic() to support ACPI based IOAPIC hot-removal.
    An IOAPIC could only be removed when all its pins are unused.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Len Brown
    Cc: Pavel Machek
    Cc: Grant Likely
    Cc: Prarit Bhargava
    Link: http://lkml.kernel.org/r/1414387308-27148-17-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Implement acpi_register_ioapic() and enhance mp_register_ioapic()
    to support ACPI based IOAPIC hot-addition.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Len Brown
    Cc: Pavel Machek
    Cc: Grant Likely
    Cc: Prarit Bhargava
    Link: http://lkml.kernel.org/r/1414387308-27148-16-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • We are going to support ACPI based IOAPIC hotplug, so introduce a mutex
    to protect IOAPIC data structures from IOAPIC hotplug. We choose to
    serialize in ACPI instead of in the IOAPIC core because:

    1) currently we only plan to support ACPI based IOAPIC hotplug
    2) it's much more cleaner and easier
    3) It does't affect IOAPIC discovered by devicetree, SFI and mpparse.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Len Brown
    Cc: Pavel Machek
    Link: http://lkml.kernel.org/r/1414908273-7552-15-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Refine mp_register_ioapic() to prepare for IOAPIC hotplug by:
    1) change return value from void to int.
    2) check for gsi range conflicts
    3) check for IOAPIC physical address conflicts
    4) enhance the way to allocate IOAPIC index

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Grant Likely
    Cc: Prarit Bhargava
    Link: http://lkml.kernel.org/r/1414387308-27148-14-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • To keep balance of IOAPIC pin reference count, we need to protect
    pirq_enable_irq(), acpi_pci_irq_enable() and intel_mid_pci_irq_enable()
    from reentrance. There are two cases which will cause reentrance.

    The first case is caused by suspend/hibernation. If pcibios_disable_irq
    is called during suspending/hibernating, we don't release the assigned
    IRQ number, otherwise it may break the suspend/hibernation. So late when
    pcibios_enable_irq is called during resume, we shouldn't allocate IRQ
    number again.

    The second case is that function acpi_pci_irq_enable() may be called
    twice for PCI devices present at boot time as below:
    1) pci_acpi_init()
    --> acpi_pci_irq_enable() if pci_routeirq is true
    2) pci_enable_device()
    --> pcibios_enable_device()
    --> acpi_pci_irq_enable()
    We can't kill kernel parameter pci_routeirq yet because it's still
    needed for debugging purpose.

    So flag irq_managed is introduced to track whether IRQ number is
    assigned by OS and to protect pirq_enable_irq(), acpi_pci_irq_enable()
    and intel_mid_pci_irq_enable() from reentrance.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Len Brown
    Link: http://lkml.kernel.org/r/1414387308-27148-13-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Remove __init marker for functions which will be used by IOAPIC hotplug
    at runtime.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Grant Likely
    Cc: Prarit Bhargava
    Link: http://lkml.kernel.org/r/1414387308-27148-12-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Perfer the assigned ID in APIC ID register for x86_64 if it's still
    available.

    [ tglx: Added comments ]

    Signed-off-by: Yinghai Lu
    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Sebastian Andrzej Siewior
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Borislav Petkov
    Cc: Grant Likely
    Cc: Prarit Bhargava
    Link: http://lkml.kernel.org/r/1414387308-27148-11-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Yinghai Lu
     
  • Split out alloc_ioapic_save_registers() from early_irq_init(),
    so it could be used for ioapic hotplug later.

    Signed-off-by: Yinghai Lu
    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Sebastian Andrzej Siewior
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Borislav Petkov
    Cc: Grant Likely
    Cc: Prarit Bhargava
    Link: http://lkml.kernel.org/r/1414387308-27148-10-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Yinghai Lu
     
  • There is no reason to keep preemption disabled in this function.

    We only have two other threads live: kthreadd and idle. Neither of
    them is going to preempt. But that preempt_disable forces all the code
    inside to do GFP_ATOMIC allocations which is just insane.

    Remove it.

    Signed-off-by: Thomas Gleixner
    Tested-by: Borislav Petkov
    Cc: Jiang Liu
    Cc: Joerg Roedel
    Cc: x86@kernel.org
    Link: http://lkml.kernel.org/r/20141205084147.153643952@linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • When X86_LOCAL_APIC (i.e. unconditionally on x86-64),
    first_system_vector will never end up being higher than
    LOCAL_TIMER_VECTOR (0xef), and hence building stubs for vectors
    0xef...0xff is pointlessly reducing code density. Deal with this at
    build time already.

    Taking into consideration that X86_64 implies X86_LOCAL_APIC, also
    simplify (and hence make easier to read and more consistent with the
    change done here) some #if-s in arch/x86/kernel/irqinit.c.

    While we could further improve the packing of the IRQ entry stubs (the
    four ones now left in the last set could be fit into the four padding
    bytes each of the final four sets have) this doesn't seem to provide
    any real benefit: Both irq_entries_start and common_interrupt getting
    cache line aligned, eliminating the 30th set would just produce 32
    bytes of padding between the 29th and common_interrupt.

    [ tglx: Folded lguest fix from Dan Carpenter ]

    Signed-off-by: Jan Beulich
    Cc: Dan Carpenter
    Cc: Andi Kleen
    Cc: lguest@lists.ozlabs.org
    Cc: Rusty Russell
    Link: http://lkml.kernel.org/r/54574D5F0200007800044389@mail.emea.novell.com
    Link: http://lkml.kernel.org/r/20141115185718.GB6530@mwanda
    Signed-off-by: Thomas Gleixner

    Jan Beulich
     
  • While f3761db164 ("x86, irq: Fix build error caused by
    9eabc99a635a77cbf09") addressed the original build problem,
    declaration, inline stub, and definition still seem misplaced: It isn't
    really IO-APIC related, and it's being used solely in arch/x86/pci/.
    This also means stubbing it out when !CONFIG_X86_IO_APIC was at least
    questionable.

    Signed-off-by: Jan Beulich
    Cc: Jiang Liu
    Link: http://lkml.kernel.org/r/545747BE020000780004436E@mail.emea.novell.com
    Signed-off-by: Thomas Gleixner

    Jan Beulich
     
  • Fix building warning when CONFIG_X86_LOCAL_APIC is disabled.
    arch/x86/kernel/acpi/boot.c:699:20: warning: ‘acpi_set_irq_model_ioapic’ defined but not used [-Wunused-function]

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Len Brown
    Cc: Pavel Machek
    Link: http://lkml.kernel.org/r/1414397531-28254-3-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Define an empty send_cleanup_vector() for UP kernel to fix link error
    of undefined reference, which is used by uv_irq and irq_remapping.

    [ tglx: Made it an inline stub and moved it ahead of the file split
    changes ]

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Link: http://lkml.kernel.org/r/1414397531-28254-21-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu