1. 10 11月, 2020 2 次提交
  2. 30 10月, 2020 2 次提交
  3. 02 10月, 2020 1 次提交
  4. 19 9月, 2020 1 次提交
    • M
      KVM: arm64: Assume write fault on S1PTW permission fault on instruction fetch · c4ad98e4
      Marc Zyngier 提交于
      KVM currently assumes that an instruction abort can never be a write.
      This is in general true, except when the abort is triggered by
      a S1PTW on instruction fetch that tries to update the S1 page tables
      (to set AF, for example).
      
      This can happen if the page tables have been paged out and brought
      back in without seeing a direct write to them (they are thus marked
      read only), and the fault handling code will make the PT executable(!)
      instead of writable. The guest gets stuck forever.
      
      In these conditions, the permission fault must be considered as
      a write so that the Stage-1 update can take place. This is essentially
      the I-side equivalent of the problem fixed by 60e21a0e ("arm64: KVM:
      Take S1 walks into account when determining S2 write faults").
      
      Update kvm_is_write_fault() to return true on IABT+S1PTW, and introduce
      kvm_vcpu_trap_is_exec_fault() that only return true when no faulting
      on a S1 fault. Additionally, kvm_vcpu_dabt_iss1tw() is renamed to
      kvm_vcpu_abt_iss1tw(), as the above makes it plain that it isn't
      specific to data abort.
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      Reviewed-by: NWill Deacon <will@kernel.org>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20200915104218.1284701-2-maz@kernel.org
      c4ad98e4
  5. 18 9月, 2020 3 次提交
  6. 11 9月, 2020 13 次提交
  7. 04 9月, 2020 2 次提交
  8. 22 8月, 2020 2 次提交
    • W
      KVM: arm64: Only reschedule if MMU_NOTIFIER_RANGE_BLOCKABLE is not set · b5331379
      Will Deacon 提交于
      When an MMU notifier call results in unmapping a range that spans multiple
      PGDs, we end up calling into cond_resched_lock() when crossing a PGD boundary,
      since this avoids running into RCU stalls during VM teardown. Unfortunately,
      if the VM is destroyed as a result of OOM, then blocking is not permitted
      and the call to the scheduler triggers the following BUG():
      
       | BUG: sleeping function called from invalid context at arch/arm64/kvm/mmu.c:394
       | in_atomic(): 1, irqs_disabled(): 0, non_block: 1, pid: 36, name: oom_reaper
       | INFO: lockdep is turned off.
       | CPU: 3 PID: 36 Comm: oom_reaper Not tainted 5.8.0 #1
       | Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015
       | Call trace:
       |  dump_backtrace+0x0/0x284
       |  show_stack+0x1c/0x28
       |  dump_stack+0xf0/0x1a4
       |  ___might_sleep+0x2bc/0x2cc
       |  unmap_stage2_range+0x160/0x1ac
       |  kvm_unmap_hva_range+0x1a0/0x1c8
       |  kvm_mmu_notifier_invalidate_range_start+0x8c/0xf8
       |  __mmu_notifier_invalidate_range_start+0x218/0x31c
       |  mmu_notifier_invalidate_range_start_nonblock+0x78/0xb0
       |  __oom_reap_task_mm+0x128/0x268
       |  oom_reap_task+0xac/0x298
       |  oom_reaper+0x178/0x17c
       |  kthread+0x1e4/0x1fc
       |  ret_from_fork+0x10/0x30
      
      Use the new 'flags' argument to kvm_unmap_hva_range() to ensure that we
      only reschedule if MMU_NOTIFIER_RANGE_BLOCKABLE is set in the notifier
      flags.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 8b3405e3 ("kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd")
      Cc: Marc Zyngier <maz@kernel.org>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Cc: James Morse <james.morse@arm.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      Message-Id: <20200811102725.7121-3-will@kernel.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b5331379
    • W
      KVM: Pass MMU notifier range flags to kvm_unmap_hva_range() · fdfe7cbd
      Will Deacon 提交于
      The 'flags' field of 'struct mmu_notifier_range' is used to indicate
      whether invalidate_range_{start,end}() are permitted to block. In the
      case of kvm_mmu_notifier_invalidate_range_start(), this field is not
      forwarded on to the architecture-specific implementation of
      kvm_unmap_hva_range() and therefore the backend cannot sensibly decide
      whether or not to block.
      
      Add an extra 'flags' parameter to kvm_unmap_hva_range() so that
      architectures are aware as to whether or not they are permitted to block.
      
      Cc: <stable@vger.kernel.org>
      Cc: Marc Zyngier <maz@kernel.org>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Cc: James Morse <james.morse@arm.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      Message-Id: <20200811102725.7121-2-will@kernel.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fdfe7cbd
  9. 30 7月, 2020 4 次提交
  10. 28 7月, 2020 1 次提交
  11. 10 7月, 2020 4 次提交
  12. 07 7月, 2020 2 次提交
  13. 06 7月, 2020 1 次提交
    • G
      KVM: arm64: Rename HSR to ESR · 3a949f4c
      Gavin Shan 提交于
      kvm/arm32 isn't supported since commit 541ad015 ("arm: Remove
      32bit KVM host support"). So HSR isn't meaningful since then. This
      renames HSR to ESR accordingly. This shouldn't cause any functional
      changes:
      
         * Rename kvm_vcpu_get_hsr() to kvm_vcpu_get_esr() to make the
           function names self-explanatory.
         * Rename variables from @hsr to @esr to make them self-explanatory.
      
      Note that the renaming on uapi and tracepoint will cause ABI changes,
      which we should avoid. Specificly, there are 4 related source files
      in this regard:
      
         * arch/arm64/include/uapi/asm/kvm.h  (struct kvm_debug_exit_arch::hsr)
         * arch/arm64/kvm/handle_exit.c       (struct kvm_debug_exit_arch::hsr)
         * arch/arm64/kvm/trace_arm.h         (tracepoints)
         * arch/arm64/kvm/trace_handle_exit.h (tracepoints)
      Signed-off-by: NGavin Shan <gshan@redhat.com>
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      Acked-by: NAndrew Scull <ascull@google.com>
      Link: https://lore.kernel.org/r/20200630015705.103366-1-gshan@redhat.com
      3a949f4c
  14. 10 6月, 2020 1 次提交
  15. 05 6月, 2020 1 次提交
    • M
      arm64: add support for folded p4d page tables · e9f63768
      Mike Rapoport 提交于
      Implement primitives necessary for the 4th level folding, add walks of p4d
      level where appropriate, replace 5level-fixup.h with pgtable-nop4d.h and
      remove __ARCH_USE_5LEVEL_HACK.
      
      [arnd@arndb.de: fix gcc-10 shift warning]
        Link: http://lkml.kernel.org/r/20200429185657.4085975-1-arnd@arndb.deSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Brian Cain <bcain@codeaurora.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: James Morse <james.morse@arm.com>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Julien Thierry <julien.thierry.kdev@gmail.com>
      Cc: Ley Foon Tan <ley.foon.tan@intel.com>
      Cc: Marc Zyngier <maz@kernel.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Link: http://lkml.kernel.org/r/20200414153455.21744-4-rppt@kernel.orgSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e9f63768