diff mbox series

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

Message ID 20180909061859.21445-2-npiggin@gmail.com
State Accepted
Headers show
Series [1/2] libpdbg/chip: implement putnia with a sequence compatible with P9 | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied
snowpatch_ozlabs/build-multiarch fail Test build-multiarch on branch master

Commit Message

Nicholas Piggin Sept. 9, 2018, 6:18 a.m. UTC
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@gmail.com>
---
 libpdbg/p9chip.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Rashmica Gupta Sept. 9, 2018, 11:34 p.m. UTC | #1
On Sun, 2018-09-09 at 16:18 +1000, Nicholas Piggin wrote:
> This adjusts P9 MTNIA and MTMSR opcodes to match the workbook. Also
> allows MTNIA now that the driver uses a P9 compatible sequence.
> 
Tested-by: Rashmica Gupta <rashmica.g@gmail.com>

> Signed-off-by: Nicholas Piggin <npiggin@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;
>
diff mbox series

Patch

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;