All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: "Christophe Leroy" <christophe.leroy@csgroup.eu>,
	"Murilo Opsfelder Araújo" <mopsfelder@gmail.com>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Nicholas Piggin" <npiggin@gmail.com>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH 1/2] powerpc: Reject probes on instructions that can't be single stepped
Date: Wed, 30 Mar 2022 17:33:46 +0530	[thread overview]
Message-ID: <1648641741.ou8oiwfxd2.naveen@linux.ibm.com> (raw)
In-Reply-To: <0ce827d8-cd2b-b113-d645-a469d687d615@csgroup.eu>

Christophe Leroy wrote:
> 
> 
> Le 28/03/2022 à 19:20, Naveen N. Rao a écrit :
>> Michael Ellerman wrote:
>>> Murilo Opsfelder Araújo <mopsfelder@gmail.com> writes:
>>>> On 3/23/22 08:51, Naveen N. Rao wrote:
>>>>> +static inline bool can_single_step(u32 inst)
>>>>> +{
>>>>> +    switch (inst >> 26) {
>>>>
>>>> Can't ppc_inst_primary_opcode() be used instead?
>> 
>> I didn't want to add a dependency on inst.h. But I guess I can very well 
>> move this out of the header into some .c file. I will see if I can make 
>> that work.
> 
> Maybe use get_op() from asm/disassemble.h ?
> 
>> 
>>>>> +    case 31:
>>>>> +        switch ((inst >> 1) & 0x3ff) {
> 
> For that one you have get_xop() in asm/disassemble.h

Nice! I will use those.

> 
>>>>> +        case 4:        /* tw */
> 
> OP_31_XOP_TRAP
> 
>>>>> +            return false;
>>>>> +        case 68:    /* td */
> 
> OP_31_XOP_TRAP_64
> 
>>>>> +            return false;
>>>>> +        case 146:    /* mtmsr */
>>>>> +            return false;
>>>>> +        case 178:    /* mtmsrd */
>>>>> +            return false;
>>>>> +        }
>>>>> +        break;
>>>>> +    }
>>>>> +    return true;
>>>>> +}
>>>>> +
>>>>
>>>> Can't OP_* definitions from ppc-opcode.h be used for all of these 
>>>> switch-case statements?
>>>
>>> Yes please. And add any that are missing.
>> 
>> We only have OP_31 from the above list now. I'll add the rest.
> 
> Isn't there also OP_TRAP and OP_TRAP_64 ?

Ah, the list clearly isn't sorted, and there are some duplicates 
there :)


Thanks,
Naveen


  reply	other threads:[~2022-03-30 12:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-23 11:51 [PATCH 0/2] powerpc: Remove system call emulation Naveen N. Rao
2022-03-23 11:51 ` [PATCH 1/2] powerpc: Reject probes on instructions that can't be single stepped Naveen N. Rao
2022-03-24 14:15   ` Murilo Opsfelder Araújo
2022-03-24 22:58     ` Michael Ellerman
2022-03-28 17:20       ` Naveen N. Rao
2022-03-28 18:36         ` Christophe Leroy
2022-03-30 12:03           ` Naveen N. Rao [this message]
2022-03-23 11:51 ` [PATCH 2/2] powerpc/64: remove system call instruction emulation Naveen N. Rao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1648641741.ou8oiwfxd2.naveen@linux.ibm.com \
    --to=naveen.n.rao@linux.vnet.ibm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mopsfelder@gmail.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.