[Pdbg] [PATCH 2/2] libpdbg/p9chip: MTNIA and MTMSR fixes

Nicholas Piggin npiggin at gmail.com
Sun Sep 9 16:18:59 AEST 2018


This adjusts P9 MTNIA and MTMSR opcodes to match the workbook. Also
allows MTNIA now that the driver uses a P9 compatible sequence.

Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
 libpdbg/p9chip.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libpdbg/p9chip.c b/libpdbg/p9chip.c
index 189d80a..7e5a638 100644
--- a/libpdbg/p9chip.c
+++ b/libpdbg/p9chip.c
@@ -291,10 +291,9 @@ static int __p9_ram_instruction(struct thread *thread, uint64_t opcode, uint64_t
 
 	switch(opcode & OPCODE_MASK) {
 	case MTNIA_OPCODE:
+		opcode = 0x4c0000a4;
+		opcode |= 0x001E0000;
 		predecode = 8;
-
-		/* Not currently supported as we can only MTNIA from LR */
-		PR_ERROR("MTNIA is not currently supported\n");
 		break;
 
 	case MFNIA_OPCODE:
@@ -303,6 +302,7 @@ static int __p9_ram_instruction(struct thread *thread, uint64_t opcode, uint64_t
 		break;
 
 	case MTMSR_OPCODE:
+		opcode |= 0x001E0000;
 		predecode = 8;
 		break;
 
-- 
2.18.0



More information about the Pdbg mailing list