1. 25 Mar, 2020 3 commits
    • Catalin Marinas's avatar
      Merge branch 'for-next/asm-annotations' into for-next/core · 0829a076
      Catalin Marinas authored
      * for-next/asm-annotations:
        : Modernise arm64 assembly annotations
        arm64: head: Convert install_el2_stub to SYM_INNER_LABEL
        arm64: Mark call_smc_arch_workaround_1 as __maybe_unused
        arm64: entry-ftrace.S: Fix missing argument for CONFIG_FUNCTION_GRAPH_TRACER=y
        arm64: vdso32: Convert to modern assembler annotations
        arm64: vdso: Convert to modern assembler annotations
        arm64: sdei: Annotate SDEI entry points using new style annotations
        arm64: kvm: Modernize __smccc_workaround_1_smc_start annotations
        arm64: kvm: Modernize annotation for __bp_harden_hyp_vecs
        arm64: kvm: Annotate assembly using modern annoations
        arm64: kernel: Convert to modern annotations for assembly data
        arm64: head: Annotate stext and preserve_boot_args as code
        arm64: head.S: Convert to modern annotations for assembly functions
        arm64: ftrace: Modernise annotation of return_to_handler
        arm64: ftrace: Correct annotation of ftrace_caller assembly
        arm64: entry-ftrace.S: Convert to modern annotations for assembly functions
        arm64: entry: Additional annotation conversions for entry.S
        arm64: entry: Annotate ret_from_fork as code
        arm64: entry: Annotate vector table and handlers as code
        arm64: crypto: Modernize names for AES function macros
        arm64: crypto: Modernize some extra assembly annotations
      0829a076
    • Catalin Marinas's avatar
      Merge branches 'for-next/memory-hotremove', 'for-next/arm_sdei',... · da12d273
      Catalin Marinas authored
      Merge branches 'for-next/memory-hotremove', 'for-next/arm_sdei', 'for-next/amu', 'for-next/final-cap-helper', 'for-next/cpu_ops-cleanup', 'for-next/misc' and 'for-next/perf' into for-next/core
      
      * for-next/memory-hotremove:
        : Memory hot-remove support for arm64
        arm64/mm: Enable memory hot remove
        arm64/mm: Hold memory hotplug lock while walking for kernel page table dump
      
      * for-next/arm_sdei:
        : SDEI: fix double locking on return from hibernate and clean-up
        firmware: arm_sdei: clean up sdei_event_create()
        firmware: arm_sdei: Use cpus_read_lock() to avoid races with cpuhp
        firmware: arm_sdei: fix possible double-lock on hibernate error path
        firmware: arm_sdei: fix double-lock on hibernate with shared events
      
      * for-next/amu:
        : ARMv8.4 Activity Monitors support
        clocksource/drivers/arm_arch_timer: validate arch_timer_rate
        arm64: use activity monitors for frequency invariance
        cpufreq: add function to get the hardware max frequency
        Documentation: arm64: document support for the AMU extension
        arm64/kvm: disable access to AMU registers from kvm guests
        arm64: trap to EL1 accesses to AMU counters from EL0
        arm64: add support for the AMU extension v1
      
      * for-next/final-cap-helper:
        : Introduce cpus_have_final_cap_helper(), migrate arm64 KVM to it
        arm64: kvm: hyp: use cpus_have_final_cap()
        arm64: cpufeature: add cpus_have_final_cap()
      
      * for-next/cpu_ops-cleanup:
        : cpu_ops[] access code clean-up
        arm64: Introduce get_cpu_ops() helper function
        arm64: Rename cpu_read_ops() to init_cpu_ops()
        arm64: Declare ACPI parking protocol CPU operation if needed
      
      * for-next/misc:
        : Various fixes and clean-ups
        arm64: define __alloc_zeroed_user_highpage
        arm64/kernel: Simplify __cpu_up() by bailing out early
        arm64: remove redundant blank for '=' operator
        arm64: kexec_file: Fixed code style.
        arm64: add blank after 'if'
        arm64: fix spelling mistake "ca not" -> "cannot"
        arm64: entry: unmask IRQ in el0_sp()
        arm64: efi: add efi-entry.o to targets instead of extra-$(CONFIG_EFI)
        arm64: csum: Optimise IPv6 header checksum
        arch/arm64: fix typo in a comment
        arm64: remove gratuitious/stray .ltorg stanzas
        arm64: Update comment for ASID() macro
        arm64: mm: convert cpu_do_switch_mm() to C
        arm64: fix NUMA Kconfig typos
      
      * for-next/perf:
        : arm64 perf updates
        arm64: perf: Add support for ARMv8.5-PMU 64-bit counters
        KVM: arm64: limit PMU version to PMUv3 for ARMv8.1
        arm64: cpufeature: Extract capped perfmon fields
        arm64: perf: Clean up enable/disable calls
        perf: arm-ccn: Use scnprintf() for robustness
        arm64: perf: Support new DT compatibles
        arm64: perf: Refactor PMU init callbacks
        perf: arm_spe: Remove unnecessary zero check on 'nr_pages'
      da12d273
    • Mark Brown's avatar
      arm64: head: Convert install_el2_stub to SYM_INNER_LABEL · d4abd29d
      Mark Brown authored
      New assembly annotations have recently been introduced which aim to
      make the way we describe symbols in assembly more consistent. Recently the
      arm64 assembler was converted to use these but install_el2_stub was missed.
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      [catalin.marinas@arm.com: changed to SYM_L_LOCAL]
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      d4abd29d
  2. 24 Mar, 2020 3 commits
  3. 17 Mar, 2020 11 commits
  4. 13 Mar, 2020 2 commits
    • Mark Rutland's avatar
      arm64: kvm: hyp: use cpus_have_final_cap() · b5475d8c
      Mark Rutland authored
      The KVM hyp code is only run after system capabilities have been
      finalized, and thus all const cap checks have been patched. This is
      noted in in __cpu_init_hyp_mode(), where we BUG() if called too early:
      
      | /*
      |  * Call initialization code, and switch to the full blown HYP code.
      |  * If the cpucaps haven't been finalized yet, something has gone very
      |  * wrong, and hyp will crash and burn when it uses any
      |  * cpus_have_const_cap() wrapper.
      |  */
      
      Given this, the hyp code can use cpus_have_final_cap() and avoid
      generating code to check the cpu_hwcaps array, which would be unsafe to
      run in hyp context.
      
      This patch migrate the KVM hyp code to cpus_have_final_cap(), avoiding
      this redundant code generation, and making it possible to detect if we
      accidentally invoke this code too early. In the latter case, the BUG()
      in cpus_have_final_cap() will cause a hyp panic.
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Reviewed-by: default avatarMarc Zyngier <maz@kernel.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Julien Thierry <julien.thierry.kdev@gmail.com>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      b5475d8c
    • Mark Rutland's avatar
      arm64: cpufeature: add cpus_have_final_cap() · 1db5cdec
      Mark Rutland authored
      When cpus_have_const_cap() was originally introduced it was intended to
      be safe in hyp context, where it is not safe to access the cpu_hwcaps
      array as cpus_have_cap() did. For more details see commit:
      
        a4023f68 ("arm64: Add hypervisor safe helper for checking constant capabilities")
      
      We then made use of cpus_have_const_cap() throughout the kernel.
      
      Subsequently, we had to defer updating the static_key associated with
      each capability in order to avoid lockdep complaints. To avoid breaking
      kernel-wide usage of cpus_have_const_cap(), this was updated to fall
      back to the cpu_hwcaps array if called before the static_keys were
      updated. As the kvm hyp code was only called later than this, the
      fallback is redundant but not functionally harmful. For more details,
      see commit:
      
        63a1e1c9 ("arm64/cpufeature: don't use mutex in bringup path")
      
      Today we have more users of cpus_have_const_cap() which are only called
      once the relevant static keys are initialized, and it would be
      beneficial to avoid the redundant code.
      
      To that end, this patch adds a new cpus_have_final_cap(), helper which
      is intend to be used in code which is only run once capabilities have
      been finalized, and will never check the cpus_hwcap array. This helps
      the compiler to generate better code as it no longer needs to generate
      code to address and test the cpus_hwcap array. To help catch misuse,
      cpus_have_final_cap() will BUG() if called before capabilities are
      finalized.
      
      In hyp context, BUG() will result in a hyp panic, but the specific BUG()
      instance will not be identified in the usual way.
      
      Comments are added to the various cpus_have_*_cap() helpers to describe
      the constraints on when they can be used. For clarity cpus_have_cap() is
      moved above the other helpers. Similarly the helpers are updated to use
      system_capabilities_finalized() consistently, and this is made
      __always_inline as required by its new callers.
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Reviewed-by: default avatarMarc Zyngier <maz@kernel.org>
      Reviewed-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      1db5cdec
  5. 11 Mar, 2020 3 commits
  6. 09 Mar, 2020 18 commits