Commit 429fe139 authored by Will Deacon's avatar Will Deacon
Browse files

Revert "ANDROID: KVM: arm64: Avoid switching to guest context if guest is already loaded"



This reverts commit ecf2308e.

If the guest issues a 'memunshare' hypercall, then we will attempt to
switch to the host context using __tlb_switch_to_guest() when invalidating
the previously shared mapping in the host stage-2 page-table. This results
in a fatal WARN_ON():

  | kvm [346]: nVHE hyp BUG at: ffff800010dfa86c!
  | kvm [346]: Hyp Offset: 0xfffecb8c68d20000
  | Kernel panic - not syncing: HYP panic:
  | PS:200003c9 PC:0000b473a80da86c ESR:f2000800
  | FAR:00000000000003f8 HPFAR:0000000000000000 PAR:0000000000000000
  | VCPU:0000b472c4a3d380
  | CPU: 3 PID: 346 Comm: crosvm_vcpu0 Not tainted 5.10.92-00347-g6d54ce01086a #1
  | Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015
  | Call trace:
  |  dump_backtrace+0x0/0x1a0
  |  show_stack+0x18/0x68
  |  dump_stack_lvl+0xcc/0xf4
  |  dump_stack+0x18/0x58
  |  panic+0x16c/0x334
  |  arm64_kernel_unmapped_at_el0+0x0/0x34
  |  kvm_arch_vcpu_ioctl_run+0x170/0x740
  |  kvm_vcpu_ioctl+0x310/0x9e8
  |  __arm64_sys_ioctl+0xa8/0xf0
  |  el0_svc_common.constprop.0+0x74/0x1b8
  |  do_el0_svc+0x24/0x90
  |  el0_svc+0x14/0x20
  |  el0_sync_handler+0xb0/0xb8
  |  el0_sync+0x1a0/0x1c0
  | SMP: stopping secondary CPUs
  | Kernel Offset: 0x20125c0e0000 from 0xffff800010000000
  | PHYS_OFFSET: 0xffffaf7640000000
  | CPU features: 0x000,10240022,61806008
  | Memory Limit: none
  | ---[ end Kernel panic - not syncing: HYP panic:
  | PS:200003c9 PC:0000b473a80da86c ESR:f2000800
  | FAR:00000000000003f8 HPFAR:0000000000000000 PAR:0000000000000000
  | VCPU:0000b472c4a3d380 ]---

Revert the change introducing the WARN_ON() for now, as we'll fix this
properly in a subsequent patch.

Bug: 209580772
Signed-off-by: default avatarWill Deacon <willdeacon@google.com>
Change-Id: If8f9901e1c9a36ede412bbf1b7ab4aa381e12424
parent eb69f26f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment