Browse Source

Fix the AC syscall handling.

Somehow, in 2011, we managed to pick the wrong register for system
call #. Fix that, which will allow us to fix linux procs on ACs next.

As a side effect, because 60s is no longer quite enough, jack up the jenkinshook
time to 90s. Else the test for this commit may fail. It has once.

Change-Id: I4a314c5cc54af10cb546ef765faf640725aaf76a
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-on: http://nxm.coreboot.org/review/418
Tested-by: Jenkins QA
Reviewed-by: Akshat Kumar <seed@mail.nanosouffle.net>
Ronald G. Minnich 11 years ago
parent
commit
3c061cc39b
3 changed files with 10 additions and 5 deletions
  1. 1 1
      jenkinshook
  2. 2 1
      sys/src/nxm/k10/l64acsyscall.s
  3. 7 3
      sys/src/nxm/k10/tcore.c

+ 1 - 1
jenkinshook

@@ -27,7 +27,7 @@ mk kernels
 # I think we'll want to get the diff output rather than bailing
 # out immediately
 set +e
-timeout 60s qemu-system-x86_64 --kernel nxm/k10/9k8regression.elf  \
+timeout 90s qemu-system-x86_64 --kernel nxm/k10/9k8regression.elf  \
 	-no-reboot  --nographic -m 512 </dev/null > qemuout
 set -e
 

+ 2 - 1
sys/src/nxm/k10/l64acsyscall.s

@@ -29,7 +29,8 @@ TEXT acsyscallentry(SB), 1, $-4
 	MOVW	FS,  124(R12)
 	MOVW	GS,  126(R12)
 
-	MOVQ	RARG, 	0(R12)			/* system call number: up->dbgregs->ax  */
+	MOVQ	RARG, 	0(R12)			/* system call modifier: up->dbgregs->ax  */
+	MOVQ	RARG, 	(6*8)(R12)		/* system call number: up->dbgregs->bp  */
 	CALL	acsyscall(SB)
 NDNR:	JMP NDNR
 

+ 7 - 3
sys/src/nxm/k10/tcore.c

@@ -288,10 +288,14 @@ runacore(void)
 			fn = actrapret;
 			break;
 		case ICCSYSCALL:
-			DBG("runacore: syscall ax %#ullx ureg %#p\n",
-				ureg->ax, ureg);
+			DBG("runacore: syscall ax %#ullx bp %#ullx ureg %#p\n",
+				ureg->ax, ureg->bp, ureg);
 			cr3put(m->pml4->pa);
-			syscall(ureg->ax, ureg);
+			/* The call to error might even work ... */
+			if(ureg->ax & 0x8000)
+				syscall(ureg->bp, ureg);
+			else
+				error("sys:no Linux calls from AC yet");
 			flush = 1;
 			fn = acsysret;
 			if(0)