Skip to content

Commit

Permalink
Merge tag 'kvm-arm-for-v3.17-rc3' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/kvmarm/kvmarm into HEAD

These fixes fix two issues in KVM for arm/arm64:
 - hyp mode initialization issues on certian boards/bootloader combos.
 - incorrect return address from trapped WFI/WFE instrucitons, which
   breaks non-linux guests.
  • Loading branch information
Paolo Bonzini committed Aug 29, 2014
2 parents 0ac625d + 05e0127 commit 8d68f67
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm/kvm/handle_exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ static int kvm_handle_wfx(struct kvm_vcpu *vcpu, struct kvm_run *run)
else
kvm_vcpu_block(vcpu);

kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu));

return 1;
}

Expand Down
4 changes: 4 additions & 0 deletions arch/arm/kvm/init.S
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ __do_hyp_init:
mrc p15, 0, r0, c10, c2, 1
mcr p15, 4, r0, c10, c2, 1

@ Invalidate the stale TLBs from Bootloader
mcr p15, 4, r0, c8, c7, 0 @ TLBIALLH
dsb ish

@ Set the HSCTLR to:
@ - ARM/THUMB exceptions: Kernel config (Thumb-2 kernel)
@ - Endianness: Kernel config
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/kvm/handle_exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ static int kvm_handle_wfx(struct kvm_vcpu *vcpu, struct kvm_run *run)
else
kvm_vcpu_block(vcpu);

kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu));

return 1;
}

Expand Down
4 changes: 4 additions & 0 deletions arch/arm64/kvm/hyp-init.S
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ __do_hyp_init:
msr mair_el2, x4
isb

/* Invalidate the stale TLBs from Bootloader */
tlbi alle2
dsb sy

mrs x4, sctlr_el2
and x4, x4, #SCTLR_EL2_EE // preserve endianness of EL2
ldr x5, =SCTLR_EL2_FLAGS
Expand Down

0 comments on commit 8d68f67

Please sign in to comment.