1. Jan 04, 2024
    • Will Deacon's avatar
      Merge branch 'for-next/perf' into for-next/core · dd9168ab
      Will Deacon authored
      * for-next/perf: (30 commits)
        arm: perf: Fix ARCH=arm build with GCC
        MAINTAINERS: add maintainers for DesignWare PCIe PMU driver
        drivers/perf: add DesignWare PCIe PMU driver
        PCI: Move pci_clear_and_set_dword() helper to PCI header
        PCI: Add Alibaba Vendor ID to linux/pci_ids.h
        docs: perf: Add description for Synopsys DesignWare PCIe PMU driver
        Revert "perf/arm_dmc620: Remove duplicate format attribute #defines"
        Documentation: arm64: Document the PMU event counting threshold feature
        arm64: perf: Add support for event counting threshold
        arm: pmu: Move error message and -EOPNOTSUPP to individual PMUs
        KVM: selftests: aarch64: Update tools copy of arm_pmuv3.h
        perf/arm_dmc620: Remove duplicate format attribute #defines
        arm: pmu: Share user ABI format mechanism with SPE
        arm64: perf: Include threshold control fields in PMEVTYPER mask
        arm: perf: Convert remaining fields to use GENMASK
        arm: perf: Use GENMASK for PMMIR fields
        arm: perf/kvm: Use GENMASK for ARMV8_PMU_PMCR_N
        arm: perf: Remove inlines from arm_pmuv3.c
        drivers/perf: arm_dsu_pmu: Remove kerneldoc-style comment syntax
        drivers/perf: Remove usage of the deprecated ida_simple_xx() API
        ...
      dd9168ab
    • Will Deacon's avatar
      Merge branch 'for-next/mm' into for-next/core · 3b47bd8f
      Will Deacon authored
      * for-next/mm:
        arm64: irq: set the correct node for shadow call stack
        arm64: irq: set the correct node for VMAP stack
      3b47bd8f
    • Will Deacon's avatar
      Merge branch 'for-next/misc' into for-next/core · 65180649
      Will Deacon authored
      * for-next/misc:
        arm64: memory: remove duplicated include
        arm64: Delete the zero_za macro
        Documentation/arch/arm64: Fix typo
      65180649
    • Will Deacon's avatar
      Merge branch 'for-next/lpa2-prep' into for-next/core · ccaeeec5
      Will Deacon authored
      * for-next/lpa2-prep:
        arm64: mm: get rid of kimage_vaddr global variable
        arm64: mm: Take potential load offset into account when KASLR is off
        arm64: kernel: Disable latent_entropy GCC plugin in early C runtime
        arm64: Add ARM64_HAS_LPA2 CPU capability
        arm64/mm: Add FEAT_LPA2 specific ID_AA64MMFR0.TGRAN[2]
        arm64/mm: Update tlb invalidation routines for FEAT_LPA2
        arm64/mm: Add lpa2_is_enabled() kvm_lpa2_is_enabled() stubs
        arm64/mm: Modify range-based tlbi to decrement scale
      ccaeeec5
    • Will Deacon's avatar
      Merge branch 'for-next/kbuild' into for-next/core · 88619527
      Will Deacon authored
      * for-next/kbuild:
        efi/libstub: zboot: do not use $(shell ...) in cmd_copy_and_pad
        arm64: properly install vmlinuz.efi
        arm64: replace <asm-generic/export.h> with <linux/export.h>
        arm64: vdso32: rename 32-bit debug vdso to vdso32.so.dbg
      88619527
    • Will Deacon's avatar
      Merge branch 'for-next/fpsimd' into for-next/core · 79eb42b2
      Will Deacon authored
      * for-next/fpsimd:
        arm64: fpsimd: Implement lazy restore for kernel mode FPSIMD
        arm64: fpsimd: Preserve/restore kernel mode NEON at context switch
        arm64: fpsimd: Drop unneeded 'busy' flag
      79eb42b2
    • Will Deacon's avatar
      Merge branch 'for-next/early-idreg-overrides' into for-next/core · e90a8a21
      Will Deacon authored
      * for-next/early-idreg-overrides:
        arm64/kernel: Move 'nokaslr' parsing out of early idreg code
        arm64: idreg-override: Avoid kstrtou64() to parse a single hex digit
        arm64: idreg-override: Avoid sprintf() for simple string concatenation
        arm64: idreg-override: avoid strlen() to check for empty strings
        arm64: idreg-override: Avoid parameq() and parameqn()
        arm64: idreg-override: Prepare for place relative reloc patching
        arm64: idreg-override: Omit non-NULL checks for override pointer
      e90a8a21
    • Will Deacon's avatar
      Merge branch 'for-next/cpufeature' into for-next/core · 3f35db4e
      Will Deacon authored
      * for-next/cpufeature:
        arm64: Align boot cpucap handling with system cpucap handling
        arm64: Cleanup system cpucap handling
        arm64: Kconfig: drop KAISER reference from KPTI option description
        arm64: mm: Only map KPTI trampoline if it is going to be used
        arm64: Get rid of ARM64_HAS_NO_HW_PREFETCH
      3f35db4e
  2. Dec 19, 2023
    • Masahiro Yamada's avatar
      efi/libstub: zboot: do not use $(shell ...) in cmd_copy_and_pad · 97ba4416
      Masahiro Yamada authored
      
      
      You do not need to use $(shell ...) in recipe lines, as they are already
      executed in a shell. An alternative solution is $$(...), which is an
      escaped sequence of the shell's command substituion, $(...).
      
      For this case, there is a reason to avoid $(shell ...).
      
      Kbuild detects command changes by using the if_changed macro, which
      compares the previous command recorded in .*.cmd with the current
      command from Makefile. If they differ, Kbuild re-runs the build rule.
      
      To diff the commands, Make must expand $(shell ...) first. It means that
      hexdump is executed every time, even when nothing needs rebuilding. If
      Kbuild determines that vmlinux.bin needs rebuilding, hexdump will be
      executed again to evaluate the 'cmd' macro, one more time to really
      build vmlinux.bin, and finally yet again to record the expanded command
      into .*.cmd.
      
      Replace $(shell ...) with $$(...) to avoid multiple, unnecessay shell
      evaluations. Since Make is agnostic about the shell code, $(...), the
      if_changed macro compares the string "$(hexdump -s16 -n4 ...)" verbatim,
      so hexdump is run only for building vmlinux.bin.
      
      For the same reason, $(shell ...) in EFI_ZBOOT_OBJCOPY_FLAGS should be
      eliminated.
      
      While I was here, I replaced '&&' with ';' because a command for
      if_changed is executed with 'set -e'.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Reviewed-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Link: https://lore.kernel.org/r/20231218080127.907460-1-masahiroy@kernel.org
      
      
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      97ba4416
  3. Dec 17, 2023
  4. Dec 14, 2023
    • Mark Rutland's avatar
      arm64: Align boot cpucap handling with system cpucap handling · eb15d707
      Mark Rutland authored
      
      
      Currently the detection+enablement of boot cpucaps is separate from the
      patching of boot cpucap alternatives, which means there's a period where
      cpus_have_cap($CAP) and alternative_has_cap($CAP) may be mismatched.
      
      It would be preferable to manage the boot cpucaps in the same way as the
      system cpucaps, both for clarity and to minimize the risk of accidental
      usage of code relying upon an alternative which has not yet been
      patched.
      
      This patch aligns the handling of boot cpucaps with the handling of
      system cpucaps:
      
      * The existing setup_boot_cpu_capabilities() function is moved to be
        closer to the setup_system_capabilities() and setup_system_features()
        functions so that they're more clearly related and more likely to be
        updated together in future.
      
      * The patching of boot cpucap alternatives is moved into
        setup_boot_cpu_capabilities(), immediately after boot cpucaps are
        detected and enabled.
      
      * A new setup_boot_cpu_features() function is added to mirror
        setup_system_features(); this handles initialization of cpucap data
        structures and calls setup_boot_cpu_capabilities(). This makes
        init_cpu_features() a closer mirror to update_cpu_features(), and
        makes smp_prepare_boot_cpu() a closer mirror to smp_cpus_done().
      
      Importantly, while these changes alter the structure of the code, they
      retain the existing order of calls to:
      
        init_cpu_features(); // prefix initializing feature regs
        init_cpucap_indirect_list();
        detect_system_supports_pseudo_nmi();
        update_cpu_capabilities(SCOPE_BOOT_CPU | SCOPE_LOCAL_CPU);
        enable_cpu_capabilities(SCOPE_BOOT_CPU);
        apply_boot_alternatives();
      
      ... and hence there should be no functional change as a result of this
      patch; this is purely a structural cleanup.
      
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/20231212170910.3745497-3-mark.rutland@arm.com
      
      
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      eb15d707
    • Mark Rutland's avatar
      arm64: Cleanup system cpucap handling · 63a2d92e
      Mark Rutland authored
      Recent changes to remove cpus_have_const_cap() introduced new users of
      cpus_have_cap() in the period between detecting system cpucaps and
      patching alternatives. It would be preferable to defer these until after
      the relevant cpucaps have been patched so that these can use the usual
      feature check helper functions, which is clearer and has less risk of
      accidental usage of code relying upon an alternative which has not yet
      been patched.
      
      This patch reworks the system-wide cpucap detection and patching to
      minimize this transient period:
      
      * The detection, enablement, and patching of system cpucaps is moved
        into a new setup_system_capabilities() function so that these can be
        grouped together more clearly, with no other functions called in the
        period between detection and patching. This is called from
        setup_system_features() before the subsequent checks that depend on
        the cpucaps.
      
        The logging of TTBR0 PAN and cpucaps with a mask is also moved here to
        keep these as close as possible to update_cpu_capabilities().
      
        At the same time, comments are corrected and improved to make the
        intent clearer.
      
      * As hyp_mode_check() only tests system register values (not hwcaps) and
        must be called prior to patching, the call to hyp_mode_check() is
        moved before the call to setup_system_features().
      
      * In setup_system_features(), the use of system_uses_ttbr0_pan() is
        restored, now that this occurs after alternatives are patched. This is
        a partial revert of commit:
      
          53d62e99 ("arm64: Avoid cpus_have_const_cap() for ARM64_HAS_PAN")
      
      * In sve_setup() and sme_setup(), the use of system_supports_sve() and
        system_supports_sme() respectively are restored, now that these occur
        after alternatives are patched. This is a partial revert of commit:
      
          a76521d1
      
       ("arm64: Avoid cpus_have_const_cap() for ARM64_{SVE,SME,SME2,FA64}")
      
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Cc: Ard Biesheuvel <ardb@kernel.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/20231212170910.3745497-2-mark.rutland@arm.com
      
      
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      63a2d92e
  5. Dec 13, 2023
  6. Dec 12, 2023