[PATCH 1/2] arm: KVM: Do not update PC if the trap handler has updated it

2015-12-22 Thread Marc Zyngier
Assuming we trap a coprocessor access, and decide that the access is illegal, we will inject an exception in the guest. In this case, we shouldn't increment the PC, or the vcpu will miss the first instruction of the handler, leading to a mildly confused guest. Solve this by snapshoting PC before

Re: [PATCH 1/2] arm: KVM: Do not update PC if the trap handler has updated it

2015-12-22 Thread Peter Maydell
On 22 December 2015 at 09:55, Marc Zyngier wrote: > Assuming we trap a coprocessor access, and decide that the access > is illegal, we will inject an exception in the guest. In this > case, we shouldn't increment the PC, or the vcpu will miss the > first instruction of the

Re: [PATCH 1/2] arm: KVM: Do not update PC if the trap handler has updated it

2015-12-22 Thread Shannon Zhao
On 2015/12/22 17:55, Marc Zyngier wrote: > Assuming we trap a coprocessor access, and decide that the access > is illegal, we will inject an exception in the guest. In this > case, we shouldn't increment the PC, or the vcpu will miss the > first instruction of the handler, leading to a mildly

Re: [PATCH 1/2] arm: KVM: Do not update PC if the trap handler has updated it

2015-12-22 Thread Christoffer Dall
On Tue, Dec 22, 2015 at 11:08:10AM +, Peter Maydell wrote: > On 22 December 2015 at 09:55, Marc Zyngier wrote: > > Assuming we trap a coprocessor access, and decide that the access > > is illegal, we will inject an exception in the guest. In this > > case, we shouldn't

Re: [PATCH 1/2] arm: KVM: Do not update PC if the trap handler has updated it

2015-12-22 Thread Peter Maydell
On 22 December 2015 at 14:39, Christoffer Dall wrote: > On Tue, Dec 22, 2015 at 11:08:10AM +, Peter Maydell wrote: >> Won't this result in our incorrectly skipping the first insn >> in the fault handler if the original offending instruction >> was itself the first