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
Subject: Re: [PATCH 1/2] powerpc: Reject probes on instructions that can't be single stepped
Date: Mon, 28 Mar 2022 22:50:13 +0530	[thread overview]
Message-ID: <1648487815.ub2owcvzpb.naveen@linux.ibm.com> (raw)
In-Reply-To: <8735j7gdpi.fsf@mpe.ellerman.id.au>

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.

>>> +	case 31:
>>> +		switch ((inst >> 1) & 0x3ff) {
>>> +		case 4:		/* tw */
>>> +			return false;
>>> +		case 68:	/* td */
>>> +			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.


Thanks,
Naveen


  reply	other threads:[~2022-03-28 17:21 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 [this message]
2022-03-28 18:36         ` Christophe Leroy
2022-03-30 12:03           ` Naveen N. Rao
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=1648487815.ub2owcvzpb.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.