Thread (42 messages) flat view 42 messages, 11 authors, 2021-05-24

Re: [PATCH 2/2] powerpc/64s: system call support for scv/rfscv instructions

From: Christophe Leroy <hidden>
Date: 2020-07-23 16:52:35
Also in: linux-api

Michael Ellerman [off-list ref] a écrit :
Nicholas Piggin [off-list ref] writes:
quoted
diff --git a/arch/powerpc/include/asm/ppc-opcode.h  
b/arch/powerpc/include/asm/ppc-opcode.h
index 2a39c716c343..b2bdc4de1292 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -257,6 +257,7 @@
 #define PPC_INST_MFVSRD			0x7c000066
 #define PPC_INST_MTVSRD			0x7c000166
 #define PPC_INST_SC			0x44000002
+#define PPC_INST_SCV			0x44000001
...
quoted
@@ -411,6 +412,7 @@
...
quoted
+#define __PPC_LEV(l)	(((l) & 0x7f) << 5)
These conflicted and didn't seem to be used so I dropped them.
quoted
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index 5abe98216dc2..161bfccbc309 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -3378,6 +3382,16 @@ int emulate_step(struct pt_regs *regs,  
struct ppc_inst instr)
 		regs->msr = MSR_KERNEL;
 		return 1;

+	case SYSCALL_VECTORED_0:	/* scv 0 */
+		regs->gpr[9] = regs->gpr[13];
+		regs->gpr[10] = MSR_KERNEL;
+		regs->gpr[11] = regs->nip + 4;
+		regs->gpr[12] = regs->msr & MSR_MASK;
+		regs->gpr[13] = (unsigned long) get_paca();
+		regs->nip = (unsigned long) &system_call_vectored_emulate;
+		regs->msr = MSR_KERNEL;
+		return 1;
+
This broke the ppc64e build:

  ld: arch/powerpc/lib/sstep.o:(.toc+0x0): undefined reference to  
`system_call_vectored_emulate'
  make[1]: *** [/home/michael/linux/Makefile:1139: vmlinux] Error 1

I wrapped it in #ifdef CONFIG_PPC64_BOOK3S.
You mean CONFIG_PPC_BOOK3S_64 ?

Christophe
cheers
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help