Skip to content

Commit

Permalink
powerpc/xmon: don't access ASDR in VMs
Browse files Browse the repository at this point in the history
ASDR is HV-privileged and must only be accessed in HV-mode.
Fixes a Program Check (0x700) when xmon in a VM dumps SPRs.

Fixes: d1e1b35 ("powerpc/xmon: Add ISA v3.0 SPRs to SPR dump")
Cc: [email protected] # v4.14+
Signed-off-by: Sukadev Bhattiprolu <[email protected]>
Reviewed-by: Andrew Donnellan <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
sukadev authored and mpe committed Jan 14, 2020
1 parent eeb0991 commit c2a2071
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions arch/powerpc/xmon/xmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1949,15 +1949,14 @@ static void dump_300_sprs(void)

printf("pidr = %.16lx tidr = %.16lx\n",
mfspr(SPRN_PID), mfspr(SPRN_TIDR));
printf("asdr = %.16lx psscr = %.16lx\n",
mfspr(SPRN_ASDR), hv ? mfspr(SPRN_PSSCR)
: mfspr(SPRN_PSSCR_PR));
printf("psscr = %.16lx\n",
hv ? mfspr(SPRN_PSSCR) : mfspr(SPRN_PSSCR_PR));

if (!hv)
return;

printf("ptcr = %.16lx\n",
mfspr(SPRN_PTCR));
printf("ptcr = %.16lx asdr = %.16lx\n",
mfspr(SPRN_PTCR), mfspr(SPRN_ASDR));
#endif
}

Expand Down

0 comments on commit c2a2071

Please sign in to comment.