1. 10 11月, 2020 2 次提交
  2. 30 10月, 2020 1 次提交
  3. 29 10月, 2020 1 次提交
  4. 29 9月, 2020 2 次提交
  5. 04 9月, 2020 1 次提交
  6. 22 7月, 2020 1 次提交
  7. 10 7月, 2020 1 次提交
  8. 07 7月, 2020 1 次提交
  9. 06 7月, 2020 6 次提交
  10. 09 6月, 2020 3 次提交
    • M
      KVM: arm64: Handle PtrAuth traps early · 29eb5a3c
      Marc Zyngier 提交于
      The current way we deal with PtrAuth is a bit heavy handed:
      
      - We forcefully save the host's keys on each vcpu_load()
      - Handling the PtrAuth trap forces us to go all the way back
        to the exit handling code to just set the HCR bits
      
      Overall, this is pretty cumbersome. A better approach would be
      to handle it the same way we deal with the FPSIMD registers:
      
      - On vcpu_load() disable PtrAuth for the guest
      - On first use, save the host's keys, enable PtrAuth in the
        guest
      
      Crucially, this can happen as a fixup, which is done very early
      on exit. We can then reenter the guest immediately without
      leaving the hypervisor role.
      
      Another thing is that it simplify the rest of the host handling:
      exiting all the way to the host means that the only possible
      outcome for this trap is to inject an UNDEF.
      Reviewed-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      29eb5a3c
    • J
      KVM: arm64: Stop save/restoring ACTLR_EL1 · e8679fed
      James Morse 提交于
      KVM sets HCR_EL2.TACR via HCR_GUEST_FLAGS. This means ACTLR* accesses
      from the guest are always trapped, and always return the value in the
      sys_regs array.
      
      The guest can't change the value of these registers, so we are
      save restoring the reset value, which came from the host.
      
      Stop save/restoring this register. Keep the storage for this register
      in sys_regs[] as this is how the value is exposed to user-space,
      removing it would break migration.
      Signed-off-by: NJames Morse <james.morse@arm.com>
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      Link: https://lore.kernel.org/r/20200529150656.7339-4-james.morse@arm.com
      e8679fed
    • J
      KVM: arm64: Stop writing aarch32's CSSELR into ACTLR · 7c582bf4
      James Morse 提交于
      aarch32 has pairs of registers to access the high and low parts of 64bit
      registers. KVM has a union of 64bit sys_regs[] and 32bit copro[]. The
      32bit accessors read the high or low part of the 64bit sys_reg[] value
      through the union.
      
      Both sys_reg_descs[] and cp15_regs[] list access_csselr() as the accessor
      for CSSELR{,_EL1}. access_csselr() is only aware of the 64bit sys_regs[],
      and expects r->reg to be 'CSSELR_EL1' in the enum, index 2 of the 64bit
      array.
      
      cp15_regs[] uses the 32bit copro[] alias of sys_regs[]. Here CSSELR is
      c0_CSSELR which is the same location in sys_reg[]. r->reg is 'c0_CSSELR',
      index 4 in the 32bit array.
      
      access_csselr() uses the 32bit r->reg value to access the 64bit array,
      so reads and write the wrong value. sys_regs[4], is ACTLR_EL1, which
      is subsequently save/restored when we enter the guest.
      
      ACTLR_EL1 is supposed to be read-only for the guest. This register
      only affects execution at EL1, and the host's value is restored before
      we return to host EL1.
      
      Convert the 32bit register index back to the 64bit version.
      Suggested-by: NMarc Zyngier <maz@kernel.org>
      Signed-off-by: NJames Morse <james.morse@arm.com>
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20200529150656.7339-2-james.morse@arm.com
      7c582bf4
  11. 28 5月, 2020 3 次提交
  12. 21 5月, 2020 3 次提交
  13. 16 5月, 2020 1 次提交
  14. 18 3月, 2020 1 次提交
    • A
      KVM: arm64: limit PMU version to PMUv3 for ARMv8.1 · c854188e
      Andrew Murray 提交于
      We currently expose the PMU version of the host to the guest via
      emulation of the DFR0_EL1 and AA64DFR0_EL1 debug feature registers.
      However many of the features offered beyond PMUv3 for 8.1 are not
      supported in KVM. Examples of this include support for the PMMIR
      registers (added in PMUv3 for ARMv8.4) and 64-bit event counters
      added in (PMUv3 for ARMv8.5).
      
      Let's trap the Debug Feature Registers in order to limit
      PMUVer/PerfMon in the Debug Feature Registers to PMUv3 for ARMv8.1
      to avoid unexpected behaviour.
      
      Both ID_AA64DFR0.PMUVer and ID_DFR0.PerfMon follow the "Alternative ID
      scheme used for the Performance Monitors Extension version" where 0xF
      means an IMPLEMENTATION DEFINED PMU is implemented, and values 0x0-0xE
      are treated as with an unsigned field (with 0x0 meaning no PMU is
      present). As we don't expect to expose an IMPLEMENTATION DEFINED PMU,
      and our cap is below 0xF, we can treat these fields as unsigned when
      applying the cap.
      Signed-off-by: NAndrew Murray <andrew.murray@arm.com>
      Reviewed-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      [Mark: make field names consistent, use perfmon cap]
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      c854188e
  15. 17 3月, 2020 1 次提交
    • P
      KVM: Remove unnecessary asm/kvm_host.h includes · 4d395762
      Peter Xu 提交于
      Remove includes of asm/kvm_host.h from files that already include
      linux/kvm_host.h to make it more obvious that there is no ordering issue
      between the two headers.  linux/kvm_host.h includes asm/kvm_host.h to
      pick up architecture specific settings, and this will never change, i.e.
      including asm/kvm_host.h after linux/kvm_host.h may seem problematic,
      but in practice is simply redundant.
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4d395762
  16. 07 3月, 2020 1 次提交
  17. 15 1月, 2020 1 次提交
    • A
      arm64: Introduce ID_ISAR6 CPU register · 8e3747be
      Anshuman Khandual 提交于
      This adds basic building blocks required for ID_ISAR6 CPU register which
      identifies support for various instruction implementation on AArch32 state.
      
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Marc Zyngier <maz@kernel.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: kvmarm@lists.cs.columbia.edu
      Acked-by: NMarc Zyngier <maz@kernel.org>
      Signed-off-by: NAnshuman Khandual <anshuman.khandual@arm.com>
      [will: Ensure SPECRES is treated the same as on A64]
      Signed-off-by: NWill Deacon <will@kernel.org>
      8e3747be
  18. 12 12月, 2019 1 次提交
    • W
      KVM: arm64: Ensure 'params' is initialised when looking up sys register · 1ce74e96
      Will Deacon 提交于
      Commit 4b927b94 ("KVM: arm/arm64: vgic: Introduce find_reg_by_id()")
      introduced 'find_reg_by_id()', which looks up a system register only if
      the 'id' index parameter identifies a valid system register. As part of
      the patch, existing callers of 'find_reg()' were ported over to the new
      interface, but this breaks 'index_to_sys_reg_desc()' in the case that the
      initial lookup in the vCPU target table fails because we will then call
      into 'find_reg()' for the system register table with an uninitialised
      'param' as the key to the lookup.
      
      GCC 10 is bright enough to spot this (amongst a tonne of false positives,
      but hey!):
      
        | arch/arm64/kvm/sys_regs.c: In function ‘index_to_sys_reg_desc.part.0.isra’:
        | arch/arm64/kvm/sys_regs.c:983:33: warning: ‘params.Op2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
        |   983 |   (u32)(x)->CRn, (u32)(x)->CRm, (u32)(x)->Op2);
        | [...]
      
      Revert the hunk of 4b927b94 which breaks 'index_to_sys_reg_desc()' so
      that the old behaviour of checking the index upfront is restored.
      
      Fixes: 4b927b94 ("KVM: arm/arm64: vgic: Introduce find_reg_by_id()")
      Signed-off-by: NWill Deacon <will@kernel.org>
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20191212094049.12437-1-will@kernel.org
      1ce74e96
  19. 07 12月, 2019 1 次提交
  20. 06 12月, 2019 1 次提交
  21. 20 10月, 2019 1 次提交
  22. 09 8月, 2019 1 次提交
    • M
      KVM: arm64: Don't write junk to sysregs on reset · 03fdfb26
      Marc Zyngier 提交于
      At the moment, the way we reset system registers is mildly insane:
      We write junk to them, call the reset functions, and then check that
      we have something else in them.
      
      The "fun" thing is that this can happen while the guest is running
      (PSCI, for example). If anything in KVM has to evaluate the state
      of a system register while junk is in there, bad thing may happen.
      
      Let's stop doing that. Instead, we track that we have called a
      reset function for that register, and assume that the reset
      function has done something. This requires fixing a couple of
      sysreg refinition in the trap table.
      
      In the end, the very need of this reset check is pretty dubious,
      as it doesn't check everything (a lot of the sysregs leave outside of
      the sys_regs[] array). It may well be axed in the near future.
      Tested-by: NZenghui Yu <yuzenghui@huawei.com>
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      03fdfb26
  23. 05 7月, 2019 2 次提交
  24. 19 6月, 2019 1 次提交
  25. 02 5月, 2019 1 次提交
  26. 24 4月, 2019 1 次提交