On Tue, May 05, 2009 at 09:20:02PM +0000, Andrew Doran wrote: > > I tried the following code instead: > > IDTVEC(osyscall) > > CLI(%eax) # must be first instruction > > pushfl # set eflags in trap frame > > popl 8(%esp) > > orl $PSL_I,(%esp) # re-enable ints on return to user > > pushl $7 # size of instruction for restart > > jmp syscall1 > > > > but the test binary from the PR segfaults: > > truc# kdump |less > > > > 34 0 ktrace EMUL "netbsd" > > 34 0 ktrace RET ktrace 0 > > 34 0 ktrace CALL execve(0xbf7ffc02,0xbf7feb3c,0xbf7feb44) > > 34 0 ktrace NAMI "./architextIndex" > > 34 0 architextIndex EMUL "netbsd" > > 34 0 architextIndex RET syscall JUSTRETURN > > 34 0 architextIndex PSIG SIGSEGV SIG_DFL: code=SEGV_ACCERR, > > addr=0xacb 94, trap=4) > > 34 0 architextIndex NAMI "architextIndex.core" > > > > On Xen CLI(%eax) expands to: > > movl CPUVAR(VCPU),%eax ; > > movb $1,EVTCHN_UPCALL_MASK(%eax) > > At this point the segment registers won't be set up.
I think xen restored it, at last the one pointing to curcpu. I'll have to double-check it. > And %eax contains the > syscall number. Ops. We can use another register then -- Manuel Bouyer <bou...@antioche.eu.org> NetBSD: 26 ans d'experience feront toujours la difference --