1. 28 4月, 2022 1 次提交
  2. 23 4月, 2022 16 次提交
  3. 22 4月, 2022 1 次提交
  4. 08 4月, 2022 1 次提交
  5. 06 4月, 2022 1 次提交
    • R
      KVM: arm64: mixed-width check should be skipped for uninitialized vCPUs · 26bf74bd
      Reiji Watanabe 提交于
      KVM allows userspace to configure either all EL1 32bit or 64bit vCPUs
      for a guest.  At vCPU reset, vcpu_allowed_register_width() checks
      if the vcpu's register width is consistent with all other vCPUs'.
      Since the checking is done even against vCPUs that are not initialized
      (KVM_ARM_VCPU_INIT has not been done) yet, the uninitialized vCPUs
      are erroneously treated as 64bit vCPU, which causes the function to
      incorrectly detect a mixed-width VM.
      
      Introduce KVM_ARCH_FLAG_EL1_32BIT and KVM_ARCH_FLAG_REG_WIDTH_CONFIGURED
      bits for kvm->arch.flags.  A value of the EL1_32BIT bit indicates that
      the guest needs to be configured with all 32bit or 64bit vCPUs, and
      a value of the REG_WIDTH_CONFIGURED bit indicates if a value of the
      EL1_32BIT bit is valid (already set up). Values in those bits are set at
      the first KVM_ARM_VCPU_INIT for the guest based on KVM_ARM_VCPU_EL1_32BIT
      configuration for the vCPU.
      
      Check vcpu's register width against those new bits at the vcpu's
      KVM_ARM_VCPU_INIT (instead of against other vCPUs' register width).
      
      Fixes: 66e94d5c ("KVM: arm64: Prevent mixed-width VM creation")
      Signed-off-by: NReiji Watanabe <reijiw@google.com>
      Reviewed-by: NOliver Upton <oupton@google.com>
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      Link: https://lore.kernel.org/r/20220329031924.619453-2-reijiw@google.com
      26bf74bd
  6. 04 4月, 2022 1 次提交
  7. 25 3月, 2022 2 次提交
  8. 23 3月, 2022 1 次提交
  9. 18 3月, 2022 4 次提交
  10. 11 3月, 2022 1 次提交
  11. 10 3月, 2022 1 次提交
    • N
      arm64: Do not include __READ_ONCE() block in assembly files · 52c9f93a
      Nathan Chancellor 提交于
      When building arm64 defconfig + CONFIG_LTO_CLANG_{FULL,THIN}=y after
      commit 558c303c ("arm64: Mitigate spectre style branch history side
      channels"), the following error occurs:
      
        <instantiation>:4:2: error: invalid fixup for movz/movk instruction
         mov w0, #ARM_SMCCC_ARCH_WORKAROUND_3
         ^
      
      Marc figured out that moving "#include <linux/init.h>" in
      include/linux/arm-smccc.h into a !__ASSEMBLY__ block resolves it. The
      full include chain with CONFIG_LTO=y from include/linux/arm-smccc.h:
      
      include/linux/init.h
      include/linux/compiler.h
      arch/arm64/include/asm/rwonce.h
      arch/arm64/include/asm/alternative-macros.h
      arch/arm64/include/asm/assembler.h
      
      The asm/alternative-macros.h include in asm/rwonce.h only happens when
      CONFIG_LTO is set, which ultimately casues asm/assembler.h to be
      included before the definition of ARM_SMCCC_ARCH_WORKAROUND_3. As a
      result, the preprocessor does not expand ARM_SMCCC_ARCH_WORKAROUND_3 in
      __mitigate_spectre_bhb_fw, which results in the error above.
      
      Avoid this problem by just avoiding the CONFIG_LTO=y __READ_ONCE() block
      in asm/rwonce.h with assembly files, as nothing in that block is useful
      to assembly files, which allows ARM_SMCCC_ARCH_WORKAROUND_3 to be
      properly expanded with CONFIG_LTO=y builds.
      
      Fixes: e35123d8 ("arm64: lto: Strengthen READ_ONCE() to acquire when CONFIG_LTO=y")
      Cc: <stable@vger.kernel.org> # 5.11.x
      Link: https://lore.kernel.org/r/20220309155716.3988480-1-maz@kernel.org/Reported-by: NMarc Zyngier <maz@kernel.org>
      Acked-by: NJames Morse <james.morse@arm.com>
      Signed-off-by: NNathan Chancellor <nathan@kernel.org>
      Link: https://lore.kernel.org/r/20220309191633.2307110-1-nathan@kernel.orgSigned-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      52c9f93a
  12. 09 3月, 2022 1 次提交
  13. 08 3月, 2022 8 次提交
  14. 25 2月, 2022 1 次提交
    • M
      arm64/mte: Add userspace interface for enabling asymmetric mode · 766121ba
      Mark Brown 提交于
      The architecture provides an asymmetric mode for MTE where tag mismatches
      are checked asynchronously for stores but synchronously for loads. Allow
      userspace processes to select this and make it available as a default mode
      via the existing per-CPU sysfs interface.
      
      Since there PR_MTE_TCF_ values are a bitmask (allowing the kernel to choose
      between the multiple modes) and there are no free bits adjacent to the
      existing PR_MTE_TCF_ bits the set of bits used to specify the mode becomes
      disjoint. Programs using the new interface should be aware of this and
      programs that do not use it will not see any change in behaviour.
      
      When userspace requests two possible modes but the system default for the
      CPU is the third mode (eg, default is synchronous but userspace requests
      either asynchronous or asymmetric) the preference order is:
      
         ASYMM > ASYNC > SYNC
      
      This situation is not currently possible since there are only two modes and
      it is mandatory to have a system default so there could be no ambiguity and
      there is no ABI change. The chosen order is basically arbitrary as we do not
      have a clear metric for what is better here.
      
      If userspace requests specifically asymmetric mode via the prctl() and the
      system does not support it then we will return an error, this mirrors
      how we handle the case where userspace enables MTE on a system that does
      not support MTE at all and the behaviour that will be seen if running on
      an older kernel that does not support userspace use of asymmetric mode.
      
      Attempts to set asymmetric mode as the default mode will result in an error
      if the system does not support it.
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Reviewed-by: NVincenzo Frascino <Vincenzo.Frascino@arm.com>
      Tested-by: NBranislav Rankov <branislav.rankov@arm.com>
      Link: https://lore.kernel.org/r/20220216173224.2342152-5-broonie@kernel.orgSigned-off-by: NWill Deacon <will@kernel.org>
      766121ba