Thread (8 messages) flat view 8 messages, 4 authors, 2022-03-30

Re: [PATCH 1/2] powerpc: Reject probes on instructions that can't be single stepped

From: Naveen N. Rao <hidden>
Date: 2022-03-28 17:21:16

Michael Ellerman wrote:
Murilo Opsfelder Araújo [off-list ref] writes:
quoted
On 3/23/22 08:51, Naveen N. Rao wrote:
quoted
+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.
quoted
quoted
+	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help