16 May, 2014

4 commits

  • This is just a cleanup to get rid of the create/destroy_irq variants
    which were designed in hell.

    The long term solution for x86 is to switch over to irq domains and
    cleanup the whole vector allocation mess.

    The generic irq_alloc_hwirqs() interface deliberately prevents
    multi-MSI vector allocation to further enforce the irq domain
    conversion (aside of the desire to support ioapic hotplug).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Grant Likely
    Cc: Tony Luck
    Cc: Peter Zijlstra
    Cc: x86@kernel.org
    Link: http://lkml.kernel.org/r/20140507154334.482904047@linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • Copy and paste leftovers with no functionality at all.

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Grant Likely
    Cc: Tony Luck
    Cc: Peter Zijlstra
    Cc: Ralf Baechle
    Cc: Jayachandran C
    Cc: linux-mips@linux-mips.org
    Link: http://lkml.kernel.org/r/20140507154334.008113902@linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • No need for a private allocator. The core code handles it
    already.

    Allocate the non MSI irqs right at boot time via machine_desc->nr_irqs
    and let the sparse core handle the MSI space.

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Grant Likely
    Cc: Tony Luck
    Cc: Peter Zijlstra
    Cc: Dan Williams
    Cc: Russell King
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lkml.kernel.org/r/20140507154333.809210026@linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • Reason: Get the upstream and urgent fixes before applying more complex
    changes.

    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

10 May, 2014

1 commit

  • Pull x86 fixes from Peter Anvin:
    "A somewhat unpleasantly large collection of small fixes. The big ones
    are the __visible tree sweep and a fix for 'earlyprintk=efi,keep'. It
    was using __init functions with predictably suboptimal results.

    Another key fix is a build fix which would produce output that simply
    would not decompress correctly in some configuration, due to the
    existing Makefiles picking up an unfortunate local label and mistaking
    it for the global symbol _end.

    Additional fixes include the handling of 64-bit numbers when setting
    the vdso data page (a latent bug which became manifest when i386
    started exporting a vdso with time functions), a fix to the new MSR
    manipulation accessors which would cause features to not get properly
    unblocked, a build fix for 32-bit userland, and a few new platform
    quirks"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86, vdso, time: Cast tv_nsec to u64 for proper shifting in update_vsyscall()
    x86: Fix typo in MSR_IA32_MISC_ENABLE_LIMIT_CPUID macro
    x86: Fix typo preventing msr_set/clear_bit from having an effect
    x86/intel: Add quirk to disable HPET for the Baytrail platform
    x86/hpet: Make boot_hpet_disable extern
    x86-64, build: Fix stack protector Makefile breakage with 32-bit userland
    x86/reboot: Add reboot quirk for Certec BPC600
    asmlinkage: Add explicit __visible to drivers/*, lib/*, kernel/*
    asmlinkage, x86: Add explicit __visible to arch/x86/*
    asmlinkage: Revert "lto: Make asmlinkage __visible"
    x86, build: Don't get confused by local symbols
    x86/efi: earlyprintk=efi,keep fix

    Linus Torvalds
     

09 May, 2014

3 commits

  • With tk->wall_to_monotonic.tv_nsec being a 32-bit value on 32-bit
    systems, (tk->wall_to_monotonic.tv_nsec << tk->shift) in update_vsyscall()
    may lose upper bits or, worse, add them since compiler will do this:
    (u64)(tk->wall_to_monotonic.tv_nsec << tk->shift)
    instead of
    ((u64)tk->wall_to_monotonic.tv_nsec << tk->shift)

    So if, for example, tv_nsec is 0x800000 and shift is 8 we will end up
    with 0xffffffff80000000 instead of 0x80000000. And then we are stuck in
    the subsequent 'while' loop.

    We need an explicit cast.

    Signed-off-by: Boris Ostrovsky
    Link: http://lkml.kernel.org/r/1399648287-15178-1-git-send-email-boris.ostrovsky@oracle.com
    Acked-by: Konrad Rzeszutek Wilk
    Cc: # v3.14
    Signed-off-by: H. Peter Anvin

    Boris Ostrovsky
     
  • The spuriously added semicolon didn't have any effect because the
    macro isn't currently in use.

    c0a639ad0bc6b178b46996bd1f821a04643e2bde

    Signed-off-by: Andres Freund
    Link: http://lkml.kernel.org/r/1399598957-7011-3-git-send-email-andres@anarazel.de
    Cc: Borislav Petkov
    Signed-off-by: H. Peter Anvin

    Andres Freund
     
  • Due to a typo the msr accessor function introduced in
    22085a66c2fab6cf9b9393c056a3600a6b4735de didn't have any lasting
    effects because they accidentally wrote the old value back.

    After c0a639ad0bc6b178b46996bd1f821a04643e2bde this at the very least
    this causes cpuid limits not to be lifted on some cpus leading to
    missing capabilities for those.

    Signed-off-by: Andres Freund
    Link: http://lkml.kernel.org/r/1399598957-7011-2-git-send-email-andres@anarazel.de
    Cc: Borislav Petkov
    Signed-off-by: H. Peter Anvin

    Andres Freund
     

08 May, 2014

6 commits

  • irqchip mvebu changes for v3.16 from Jason Cooper:
    * orion: reverse irq handling priority
    * armada-370-xp: do set_smp_cross_call in the driver
    * armada-370-xp use cpu notifier to init secondary cpus

    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • Some irqchip initialization must be done on secondary CPUs. On mvebu
    platforms, this is currently achieved by having the
    arch/arm/mach-mvebu/platsmp.c code directly call into a function
    exported by the irqchip driver, which isn't really nice.

    This commit changes this by using the same solution as the one used in
    the GIC driver: the irqchip driver registers a CPU notifier, which is
    used to do the secondary CPU IRQ initialization. This way, the irqchip
    driver is completely autonomous, and the function no longer needs to
    be exposed from the irqchip driver to the SoC code.

    Signed-off-by: Thomas Petazzoni
    Link: https://lkml.kernel.org/r/1397483648-26611-6-git-send-email-thomas.petazzoni@free-electrons.com
    Signed-off-by: Jason Cooper

    Thomas Petazzoni
     
  • Instead of having the SoC code in arch/arm/mach-mvebu/platsmp.c do the
    set_smp_cross_call() to register the IPI-triggering function, it makes
    more sense to do exactly what the GIC driver is doing: let the irqchip
    driver do it. This way, it avoids having to expose the
    armada_mpic_send_doorbell() function between the irqchip driver and
    the SoC code.

    Signed-off-by: Thomas Petazzoni
    Link: https://lkml.kernel.org/r/1397483648-26611-5-git-send-email-thomas.petazzoni@free-electrons.com
    Signed-off-by: Jason Cooper

    Thomas Petazzoni
     
  • HPET on current Baytrail platform has accuracy problem to be
    used as reliable clocksource/clockevent, so add a early quirk to
    disable it.

    Signed-off-by: Feng Tang
    Cc: Clemens Ladisch
    Cc: John Stultz
    Cc: Linus Torvalds
    Link: http://lkml.kernel.org/r/1398327498-13163-2-git-send-email-feng.tang@intel.com
    Signed-off-by: Ingo Molnar

    Feng Tang
     
  • HPET on some platform has accuracy problem. Making
    "boot_hpet_disable" extern so that we can runtime disable
    the HPET timer by using quirk to check the platform.

    Signed-off-by: Feng Tang
    Cc: Clemens Ladisch
    Cc: John Stultz
    Cc: Linus Torvalds
    Link: http://lkml.kernel.org/r/1398327498-13163-1-git-send-email-feng.tang@intel.com
    Signed-off-by: Ingo Molnar

    Feng Tang
     
  • If you are using a 64-bit kernel with 32-bit userland, then
    scripts/gcc-x86_64-has-stack-protector.sh invokes 32-bit gcc
    with -mcmodel=kernel, which produces:

    :1:0: error: code model 'kernel' not supported in the 32 bit mode

    and trips the "broken compiler" test at arch/x86/Makefile:120.

    There are several places a fix is possible, but the following seems
    cleanest. (But it's minimal; it would also be possible to factor
    out a bunch of stuff from the two branches of the if.)

    Signed-off-by: George Spelvin
    Link: http://lkml.kernel.org/r/20140507210552.7581.qmail@ns.horizon.com
    Cc: # v3.14
    Signed-off-by: H. Peter Anvin

    George Spelvin
     

07 May, 2014

2 commits

  • Certec BPC600 needs reboot=pci to actually reboot.

    Signed-off-by: Christian Gmeiner
    Cc: Matthew Garrett
    Cc: Li Aubrey
    Cc: Andrew Morton
    Cc: Dave Jones
    Cc: Fenghua Yu
    Cc: Linus Torvalds
    Link: http://lkml.kernel.org/r/1399446114-2147-1-git-send-email-christian.gmeiner@gmail.com
    Signed-off-by: Ingo Molnar

    Christian Gmeiner
     
  • Pull sparc fixes from David Miller:
    "I've been auditing the THP support on sparc64 and found several bugs,
    hopefully most of which are fixed completely here.

    Also an RT kernel locking fix from Kirill Tkhai"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
    sparc64: Give more detailed information in {pgd,pmd}_ERROR() and kill pte_ERROR().
    sparc64: Add basic validations to {pud,pmd}_bad().
    sparc64: Use 'ILOG2_4MB' instead of constant '22'.
    sparc64: Fix range check in kern_addr_valid().
    sparc64: Fix top-level fault handling bugs.
    sparc64: Handle 32-bit tasks properly in compute_effective_address().
    sparc64: Don't use _PAGE_PRESENT in pte_modify() mask.
    sparc64: Fix hex values in comment above pte_modify().
    sparc64: Fix bugs in get_user_pages_fast() wrt. THP.
    sparc64: Fix huge PMD invalidation.
    sparc64: Fix executable bit testing in set_pmd_at() paths.
    sparc64: Normalize NMI watchdog logging and behavior.
    sparc64: Make itc_sync_lock raw
    sparc64: Fix argument sign extension for compat_sys_futex().

    Linus Torvalds
     

06 May, 2014

4 commits

  • As requested by Linus add explicit __visible to the asmlinkage users.
    This marks all functions visible to assembler.

    Tree sweep for arch/x86/*

    Signed-off-by: Andi Kleen
    Link: http://lkml.kernel.org/r/1398984278-29319-3-git-send-email-andi@firstfloor.org
    Signed-off-by: H. Peter Anvin

    Andi Kleen
     
  • Pull Xtensa fixes from Chris Zankel:
    - Fixes allmodconfig, allnoconfig builds
    - Adds highmem support
    - Enables build-time exception table sorting.

    * tag 'xtensa-next-20140503' of git://github.com/czankel/xtensa-linux:
    xtensa: ISS: don't depend on CONFIG_TTY
    xtensa: xt2000: drop redundant sysmem initialization
    xtensa: add support for KC705
    xtensa: xtfpga: introduce SoC I/O bus
    xtensa: add HIGHMEM support
    xtensa: optimize local_flush_tlb_kernel_range
    xtensa: dump sysmem from the bootmem_init
    xtensa: handle memmap kernel option
    xtensa: keep sysmem banks ordered in mem_reserve
    xtensa: keep sysmem banks ordered in add_sysmem_bank
    xtensa: split bootparam and kernel meminfo
    xtensa: enable sorting extable at build time
    xtensa: export __{invalidate,flush}_dcache_range
    xtensa: Export __invalidate_icache_range

    Linus Torvalds
     
  • arch/x86/crypto/sha1_avx2_x86_64_asm.S introduced _end as a local
    symbol, which broke the build under certain circumstances. Although
    the wisdom of _end as a local symbol can definitely be questioned, the
    build should not break for that reason.

    Thus, filter the output of nm to only get global symbols of
    appropriate type.

    Reported-by: Andy Lutomirski
    Cc: Chandramouli Narayanan
    Cc: Herbert Xu
    Signed-off-by: H. Peter Anvin
    Link: http://lkml.kernel.org/n/tip-uxm3j3w3odglcwhafwq5tjqu@git.kernel.org

    H. Peter Anvin
     
  • Build console support only when CONFIG_TTY is selected.
    This restores ISS as the default platform for allnoconfig builds.

    Signed-off-by: Max Filippov
    Signed-off-by: Chris Zankel

    Max Filippov
     

05 May, 2014

2 commits

  • Pull arm64 fixes from Catalin Marinas:
    "These are mostly arm64 fixes with an additional arm(64) platform fix
    for the initialisation of vexpress clocks (the latter only affecting
    arm64; the arch/arm64 code is SoC agnostic and does not rely on early
    SoC-specific calls)

    - vexpress platform clocks initialisation moved earlier following the
    arm64 move of of_clk_init() call in a previous commit
    - Default DMA ops changed to non-coherent to preserve compatibility
    with 32-bit ARM DT files. The "dma-coherent" property can be used
    to explicitly mark a device coherent. The Applied Micro DT file
    has been updated to avoid DMA cache maintenance for the X-Gene SATA
    controller (the only arm64 related driver with such assumption in
    -rc mainline)
    - Fixmap correction for earlyprintk
    - kern_addr_valid() fix for huge pages"

    * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
    vexpress: Initialise the sysregs before setting up the clocks
    arm64: Mark the Applied Micro X-Gene SATA controller as DMA coherent
    arm64: Use bus notifiers to set per-device coherent DMA ops
    arm64: Make default dma_ops to be noncoherent
    arm64: fixmap: fix missing sub-page offset for earlyprintk
    arm64: Fix for the arm64 kern_addr_valid() function

    Linus Torvalds
     
  • Pull EFI fix from Matt Fleming:

    " * Fix earlyprintk=efi,keep support by switching to an ioremap() mapping
    of the framebuffer when early_ioremap() is no longer available and
    dropping __init from functions that may be invoked after
    free_initmem() - Dave Young "

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

04 May, 2014

17 commits

  • pte_ERROR() is not used anywhere, delete it.

    For pgd_ERROR() and pmd_ERROR(), output something similar to x86, giving the address
    of the pgd/pmd as well as it's value.

    Also provide the caller, since these macros are invoked from pgd_clear_bad() and
    pmd_clear_bad() which provides little context as to what high level operation was
    occuring when the BAD state was detected.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Instead of returning false we should at least check the most basic
    things, otherwise page table corruptions will be very difficult to
    debug.

    PMD and PTE tables are of size PAGE_SIZE, so none of the sub-PAGE_SIZE
    bits should be set.

    We also complement this with a check that the physical address the
    pud/pmd points to is valid memory.

    PowerPC was used as a guide while implementating this.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Signed-off-by: David S. Miller

    David S. Miller
     
  • In commit b2d438348024b75a1ee8b66b85d77f569a5dfed8 ("sparc64: Make
    PAGE_OFFSET variable."), the MAX_PHYS_ADDRESS_BITS value was increased
    (to 47).

    This constant reference to '41UL' was missed.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Make get_user_insn() able to cope with huge PMDs.

    Next, make do_fault_siginfo() more robust when get_user_insn() can't
    actually fetch the instruction. In particular, use the MMU announced
    fault address when that happens, instead of calling
    compute_effective_address() and computing garbage.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • If we have a 32-bit task we must chop off the top 32-bits of the
    64-bit value just as the cpu would.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Signed-off-by: David S. Miller

    David S. Miller
     
  • When _PAGE_SPECIAL and _PAGE_PMD_HUGE were added to the mask, the
    comment was not updated.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The large PMD path needs to check _PAGE_VALID not _PAGE_PRESENT, to
    decide if it needs to bail and return 0.

    pmd_large() should therefore just check _PAGE_PMD_HUGE.

    Calls to gup_huge_pmd() are guarded with a check of pmd_large(), so we
    just need to add a valid bit check.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • On sparc64 "present" and "valid" are seperate PTE bits, this allows us to
    naturally distinguish between the user explicitly asking for PROT_NONE
    with mprotect() and other situations.

    However we weren't handling this properly in the huge PMD paths.

    First of all, the page table walker in the TSB miss path only checks
    for _PAGE_PMD_HUGE. So the generic pmdp_invalidate() would clear
    _PAGE_PRESENT but the TLB miss paths would still load it into the TLB
    as a valid huge PMD.

    Fix this by clearing the valid bit in pmdp_invalidate(), and also
    checking the valid bit in USER_PGTABLE_CHECK_PMD_HUGE using "brgez"
    since _PAGE_VALID is bit 63 in both the sun4u and sun4v pte layouts.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • This code was mistakenly using the exec bit from the PMD in all
    cases, even when the PMD isn't a huge PMD.

    If it's not a huge PMD, test the exec bit in the individual ptes down
    in tlb_batch_pmd_scan().

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Bring this code in line with the perf based generic NMI watchdog
    in kernel/watchdog.c (which we should convert over to at some
    point).

    In particular, don't do anything super fancy when the watchdog
    triggers, and specifically don't do a do_exit() which only makes
    things worse.

    Either panic(), or WARN(). The latter of which will do all of
    the actions such as give us a stack backtrace.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Since the default DMA ops for arm64 are non-coherent, mark the X-Gene
    controller explicitly as dma-coherent to avoid additional cache
    maintenance.

    Signed-off-by: Catalin Marinas
    Cc: Loc Ho

    Catalin Marinas
     
  • Recently, the default DMA ops have been changed to non-coherent for
    alignment with 32-bit ARM platforms (and DT files). This patch adds bus
    notifiers to be able to set the coherent DMA ops (with no cache
    maintenance) for devices explicitly marked as coherent via the
    "dma-coherent" DT property.

    Signed-off-by: Catalin Marinas

    Catalin Marinas
     
  • Currently arm64 dma_ops is by default made coherent which makes it
    opposite in default policy from arm.

    Make default dma_ops to be noncoherent (same as arm), as currently there
    aren't any dma-capable drivers which assumes coherent ops

    Signed-off-by: Ritesh Harjani
    Acked-by: Will Deacon
    Signed-off-by: Catalin Marinas

    Ritesh Harjani
     
  • Commit d57c33c5daa4 (add generic fixmap.h) added (among other
    similar things) set_fixmap_io to deal with early ioremap of devices.

    More recently, commit bf4b558eba92 (arm64: add early_ioremap support)
    converted the arm64 earlyprintk to use set_fixmap_io. A side effect of
    this conversion is that my virtual machines have stopped booting when
    I pass "earlyprintk=uart8250-8bit,0x3f8" to the guest kernel.

    Turns out that the new earlyprintk code doesn't care at all about
    sub-page offsets, and just assumes that the earlyprintk device will
    be page-aligned. Obviously, that doesn't play well with the above example.

    Further investigation shows that set_fixmap_io uses __set_fixmap instead
    of __set_fixmap_offset. A fix is to introduce a set_fixmap_offset_io that
    uses the latter, and to remove the superflous call to fix_to_virt
    (which only returns the value that set_fixmap_io has already given us).

    With this applied, my VMs are back in business. Tested on a Cortex-A57
    platform with kvmtool as platform emulation.

    Cc: Will Deacon
    Acked-by: Mark Salter
    Acked-by: Arnd Bergmann
    Signed-off-by: Marc Zyngier
    Signed-off-by: Catalin Marinas

    Marc Zyngier
     
  • Fix for the arm64 kern_addr_valid() function to recognize
    virtual addresses in the kernel logical memory map. The
    function fails as written because it does not check whether
    the addresses in that region are mapped at the pmd level to
    2MB or 512MB pages, continues the page table walk to the
    pte level, and issues a garbage value to pfn_valid().

    Tested on 4K-page and 64K-page kernels.

    Signed-off-by: Dave Anderson
    Signed-off-by: Catalin Marinas

    Dave Anderson
     

03 May, 2014

1 commit

  • Pull irq fixes from Thomas Gleixner:
    "This udpate delivers:

    - A fix for dynamic interrupt allocation on x86 which is required to
    exclude the GSI interrupts from the dynamic allocatable range.

    This was detected with the newfangled tablet SoCs which have GPIOs
    and therefor allocate a range of interrupts. The MSI allocations
    already excluded the GSI range, so we never noticed before.

    - The last missing set_irq_affinity() repair, which was delayed due
    to testing issues

    - A few bug fixes for the armada SoC interrupt controller

    - A memory allocation fix for the TI crossbar interrupt controller

    - A trivial kernel-doc warning fix"

    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    irqchip: irq-crossbar: Not allocating enough memory
    irqchip: armanda: Sanitize set_irq_affinity()
    genirq: x86: Ensure that dynamic irq allocation does not conflict
    linux/interrupt.h: fix new kernel-doc warnings
    irqchip: armada-370-xp: Fix releasing of MSIs
    irqchip: armada-370-xp: implement the ->check_device() msi_chip operation
    irqchip: armada-370-xp: fix invalid cast of signed value into unsigned variable

    Linus Torvalds