Skip to content

Commit

Permalink
KVM: PPC: Read out syscall instruction on trap
Browse files Browse the repository at this point in the history
We have a few traps where we cache the instruction that cause the trap
for analysis later on. Since we now need to be able to distinguish
between SC 0 and SC 1 system calls and the only way to find out which
is which is by looking at the instruction, we also read out the instruction
causing the system call.

Signed-off-by: Alexander Graf <agraf@suse.de>
  • Loading branch information
Alexander Graf authored and Avi Kivity committed Sep 25, 2011
1 parent 04fcc11 commit 77e675a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/powerpc/kvm/book3s_segment.S
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,16 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)
beq ld_last_inst
cmpwi r12, BOOK3S_INTERRUPT_PROGRAM
beq ld_last_inst
cmpwi r12, BOOK3S_INTERRUPT_SYSCALL
beq ld_last_prev_inst
cmpwi r12, BOOK3S_INTERRUPT_ALIGNMENT
beq- ld_last_inst

b no_ld_last_inst

ld_last_prev_inst:
addi r3, r3, -4

ld_last_inst:
/* Save off the guest instruction we're at */

Expand Down

0 comments on commit 77e675a

Please sign in to comment.