1. 20 5月, 2022 9 次提交
    • N
      ARM: 9206/1: A9: Add ARM ERRATA 764319 workaround (Updated) · 8294fec1
      Nick Hawkins 提交于
      Enable the workaround for the 764319 Cortex A-9 erratum.
      CP14 read accesses to the DBGPRSR and DBGOSLSR registers generate an
      unexpected Undefined Instruction exception when the DBGSWENABLE external
      pin is set to 0, even when the CP14 accesses are performed from a
      privileged mode. The work around catches the exception in a way
      the kernel does not stop execution with the use of undef_hook. This
      has been found to effect the HPE GXP SoC.
      Signed-off-by: NNick Hawkins <nick.hawkins@hpe.com>
      Reviewed-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      8294fec1
    • A
      ARM: 9201/1: spectre-bhb: rely on linker to emit cross-section literal loads · ad12c2f1
      Ard Biesheuvel 提交于
      The assembler does not permit 'LDR PC, <sym>' when the symbol lives in a
      different section, which is why we have been relying on rather fragile
      open-coded arithmetic to load the address of the vector_swi routine into
      the program counter using a single LDR instruction in the SWI slot in
      the vector table. The literal was moved to a different section to in
      commit 19accfd3 ("ARM: move vector stubs") to ensure that the
      vector stubs page does not need to be mapped readable for user space,
      which is the case for the vector page itself, as it carries the kuser
      helpers as well.
      
      So the cross-section literal load is open-coded, and this relies on the
      address of vector_swi to be at the very start of the vector stubs page,
      and we won't notice if we got it wrong until booting the kernel and see
      it break. Fortunately, it was guaranteed to break, so this was fragile
      but not problematic.
      
      Now that we have added two other variants of the vector table, we have 3
      occurrences of the same trick, and so the size of our ISA/compiler/CPU
      validation space has tripled, in a way that may cause regressions to only
      be observed once booting the image in question on a CPU that exercises a
      particular vector table.
      
      So let's switch to true cross section references, and let the linker fix
      them up like it fixes up all the other cross section references in the
      vector page.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      ad12c2f1
    • A
      ARM: 9200/1: spectre-bhb: avoid cross-subsection jump using a numbered label · 1290c70d
      Ard Biesheuvel 提交于
      In order to minimize potential confusion regarding numbered labels
      appearing in a different order in the assembler output due to the use of
      subsections, use a named local label to jump back into the vector
      handler code from the associated loop8 mitigation sequence.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      1290c70d
    • A
      ARM: 9199/1: spectre-bhb: use local DSB and elide ISB in loop8 sequence · 892c608a
      Ard Biesheuvel 提交于
      The loop8 mitigation for Spectre-BHB only requires a CPU local DSB
      rather than a systemwide one, which is much more costly. And by the same
      reasoning as why it is justified to omit the ISB after BPIALL, we can
      also elide the ISB and rely on the exception return for the context
      synchronization.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      892c608a
    • A
      ARM: 9198/1: spectre-bhb: simplify BPIALL vector macro · c4f486f1
      Ard Biesheuvel 提交于
      The BPIALL mitigation for Spectre-BHB adds a single instruction to the
      handler sequence that doesn't clobber any registers. Given that these
      sequences are 10 instructions long, they don't fit neatly into a
      cacheline anyway, so we can simply move that single instruction to the
      start of the unmitigated one, and rearrange the symbol names accordingly.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      c4f486f1
    • A
      ARM: 9195/1: entry: avoid explicit literal loads · 50807460
      Ard Biesheuvel 提交于
      ARMv7 has MOVW/MOVT instruction pairs to load symbol addresses into
      registers without having to rely on literal loads that go via the
      D-cache.  For older cores, we now support a similar arrangement, based
      on PC-relative group relocations.
      
      This means we can elide most literal loads entirely from the entry path,
      by switching to the ldr_va macro to emit the appropriate sequence
      depending on the target architecture revision.
      
      While at it, switch to the bl_r macro for invoking the right PABT/DABT
      helpers instead of setting the LR register explicitly, which does not
      play well with cores that speculate across function returns.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      50807460
    • A
      ARM: 9194/1: assembler: simplify ldr_this_cpu for !SMP builds · 952f0331
      Ard Biesheuvel 提交于
      When CONFIG_SMP is not defined, the CPU offset is always zero, and so
      we can simplify the sequence to load a per-CPU variable.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      952f0331
    • W
      ARM: 9192/1: amba: fix memory leak in amba_device_try_add() · 7719a68b
      Wang Kefeng 提交于
      If amba_device_try_add() return error code (not EPROBE_DEFER),
      memory leak occurred when amba device fails to read periphid.
      
      unreferenced object 0xc1c60800 (size 1024):
        comm "swapper/0", pid 1, jiffies 4294937333 (age 75.200s)
        hex dump (first 32 bytes):
          40 40 db c1 04 08 c6 c1 04 08 c6 c1 00 00 00 00  @@..............
          00 d9 c1 c1 84 6f 38 c1 00 00 00 00 01 00 00 00  .....o8.........
        backtrace:
          [<(ptrval)>] kmem_cache_alloc_trace+0x168/0x2b4
          [<(ptrval)>] amba_device_alloc+0x38/0x7c
          [<(ptrval)>] of_platform_bus_create+0x2f4/0x4e8
          [<(ptrval)>] of_platform_bus_create+0x380/0x4e8
          [<(ptrval)>] of_platform_bus_create+0x380/0x4e8
          [<(ptrval)>] of_platform_bus_create+0x380/0x4e8
          [<(ptrval)>] of_platform_populate+0x70/0xc4
          [<(ptrval)>] of_platform_default_populate_init+0xb4/0xcc
          [<(ptrval)>] do_one_initcall+0x58/0x218
          [<(ptrval)>] kernel_init_freeable+0x250/0x29c
          [<(ptrval)>] kernel_init+0x24/0x148
          [<(ptrval)>] ret_from_fork+0x14/0x1c
          [<00000000>] 0x0
      unreferenced object 0xc1db4040 (size 64):
        comm "swapper/0", pid 1, jiffies 4294937333 (age 75.200s)
        hex dump (first 32 bytes):
          31 63 30 66 30 30 30 30 2e 77 64 74 00 00 00 00  1c0f0000.wdt....
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<(ptrval)>] __kmalloc_track_caller+0x19c/0x2f8
          [<(ptrval)>] kvasprintf+0x60/0xcc
          [<(ptrval)>] kvasprintf_const+0x54/0x78
          [<(ptrval)>] kobject_set_name_vargs+0x34/0xa8
          [<(ptrval)>] dev_set_name+0x40/0x5c
          [<(ptrval)>] of_device_make_bus_id+0x128/0x1f8
          [<(ptrval)>] of_platform_bus_create+0x4dc/0x4e8
          [<(ptrval)>] of_platform_bus_create+0x380/0x4e8
          [<(ptrval)>] of_platform_bus_create+0x380/0x4e8
          [<(ptrval)>] of_platform_bus_create+0x380/0x4e8
          [<(ptrval)>] of_platform_populate+0x70/0xc4
          [<(ptrval)>] of_platform_default_populate_init+0xb4/0xcc
          [<(ptrval)>] do_one_initcall+0x58/0x218
          [<(ptrval)>] kernel_init_freeable+0x250/0x29c
          [<(ptrval)>] kernel_init+0x24/0x148
          [<(ptrval)>] ret_from_fork+0x14/0x1c
      
      Fix them by adding amba_device_put() to release device name and
      amba device.
      Signed-off-by: NKefeng Wang <wangkefeng.wang@huawei.com>
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      7719a68b
    • W
      ARM: 9193/1: amba: Add amba_read_periphid() helper · 1f44de0f
      Wang Kefeng 提交于
      Add new amba_read_periphid() helper to simplify error handling.
      Signed-off-by: NKefeng Wang <wangkefeng.wang@huawei.com>
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      1f44de0f
  2. 18 5月, 2022 2 次提交
  3. 04 4月, 2022 7 次提交
    • L
      Linux 5.18-rc1 · 31231092
      Linus Torvalds 提交于
      31231092
    • L
      Merge tag 'trace-v5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 09bb8856
      Linus Torvalds 提交于
      Pull more tracing updates from Steven Rostedt:
      
       - Rename the staging files to give them some meaning. Just
         stage1,stag2,etc, does not show what they are for
      
       - Check for NULL from allocation in bootconfig
      
       - Hold event mutex for dyn_event call in user events
      
       - Mark user events to broken (to work on the API)
      
       - Remove eBPF updates from user events
      
       - Remove user events from uapi header to keep it from being installed.
      
       - Move ftrace_graph_is_dead() into inline as it is called from hot
         paths and also convert it into a static branch.
      
      * tag 'trace-v5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Move user_events.h temporarily out of include/uapi
        ftrace: Make ftrace_graph_is_dead() a static branch
        tracing: Set user_events to BROKEN
        tracing/user_events: Remove eBPF interfaces
        tracing/user_events: Hold event_mutex during dyn_event_add
        proc: bootconfig: Add null pointer check
        tracing: Rename the staging files for trace_events
      09bb8856
    • L
      Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · 34a53ff9
      Linus Torvalds 提交于
      Pull clk fix from Stephen Boyd:
       "A single revert to fix a boot regression seen when clk_put() started
        dropping rate range requests. It's best to keep various systems
        booting so we'll kick this out and try again next time"
      
      * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        Revert "clk: Drop the rate range on clk_put()"
      34a53ff9
    • L
      Merge tag 'x86-urgent-2022-04-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 8b5656bc
      Linus Torvalds 提交于
      Pull x86 fixes from Thomas Gleixner:
       "A set of x86 fixes and updates:
      
         - Make the prctl() for enabling dynamic XSTATE components correct so
           it adds the newly requested feature to the permission bitmap
           instead of overwriting it. Add a selftest which validates that.
      
         - Unroll string MMIO for encrypted SEV guests as the hypervisor
           cannot emulate it.
      
         - Handle supervisor states correctly in the FPU/XSTATE code so it
           takes the feature set of the fpstate buffer into account. The
           feature sets can differ between host and guest buffers. Guest
           buffers do not contain supervisor states. So far this was not an
           issue, but with enabling PASID it needs to be handled in the buffer
           offset calculation and in the permission bitmaps.
      
         - Avoid a gazillion of repeated CPUID invocations in by caching the
           values early in the FPU/XSTATE code.
      
         - Enable CONFIG_WERROR in x86 defconfig.
      
         - Make the X86 defconfigs more useful by adapting them to Y2022
           reality"
      
      * tag 'x86-urgent-2022-04-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/fpu/xstate: Consolidate size calculations
        x86/fpu/xstate: Handle supervisor states in XSTATE permissions
        x86/fpu/xsave: Handle compacted offsets correctly with supervisor states
        x86/fpu: Cache xfeature flags from CPUID
        x86/fpu/xsave: Initialize offset/size cache early
        x86/fpu: Remove unused supervisor only offsets
        x86/fpu: Remove redundant XCOMP_BV initialization
        x86/sev: Unroll string mmio with CC_ATTR_GUEST_UNROLL_STRING_IO
        x86/config: Make the x86 defconfigs a bit more usable
        x86/defconfig: Enable WERROR
        selftests/x86/amx: Update the ARCH_REQ_XCOMP_PERM test
        x86/fpu/xstate: Fix the ARCH_REQ_XCOMP_PERM implementation
      8b5656bc
    • L
      Merge tag 'core-urgent-2022-04-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e235f419
      Linus Torvalds 提交于
      Pull RT signal fix from Thomas Gleixner:
       "Revert the RT related signal changes. They need to be reworked and
        generalized"
      
      * tag 'core-urgent-2022-04-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        Revert "signal, x86: Delay calling signals in atomic on RT enabled kernels"
      e235f419
    • L
      Merge tag 'dma-mapping-5.18-1' of git://git.infradead.org/users/hch/dma-mapping · 63d12cc3
      Linus Torvalds 提交于
      Pull more dma-mapping updates from Christoph Hellwig:
      
       - fix a regression in dma remap handling vs AMD memory encryption (me)
      
       - finally kill off the legacy PCI DMA API (Christophe JAILLET)
      
      * tag 'dma-mapping-5.18-1' of git://git.infradead.org/users/hch/dma-mapping:
        dma-mapping: move pgprot_decrypted out of dma_pgprot
        PCI/doc: cleanup references to the legacy PCI DMA API
        PCI: Remove the deprecated "pci-dma-compat.h" API
      63d12cc3
    • L
      Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm · 5dee8721
      Linus Torvalds 提交于
      Pull ARM fixes from Russell King:
      
       - avoid unnecessary rebuilds for library objects
      
       - fix return value of __setup handlers
      
       - fix invalid input check for "crashkernel=" kernel option
      
       - silence KASAN warnings in unwind_frame
      
      * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
        ARM: 9191/1: arm/stacktrace, kasan: Silence KASAN warnings in unwind_frame()
        ARM: 9190/1: kdump: add invalid input check for 'crashkernel=0'
        ARM: 9187/1: JIVE: fix return value of __setup handler
        ARM: 9189/1: decompressor: fix unneeded rebuilds of library objects
      5dee8721
  4. 03 4月, 2022 12 次提交
  5. 02 4月, 2022 10 次提交