From: Jordan Gordeev Date: Sat, 13 Feb 2010 13:08:18 +0000 (+0200) Subject: amd64: Fixes for the vkernel. X-Git-Tag: v2.7.0~35 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/2deef24cfece74d8c93458da64edb6d89e79eb6b amd64: Fixes for the vkernel. --- diff --git a/sys/platform/pc64/x86_64/trap.c b/sys/platform/pc64/x86_64/trap.c index 08afdeec51..ecdcdd9582 100644 --- a/sys/platform/pc64/x86_64/trap.c +++ b/sys/platform/pc64/x86_64/trap.c @@ -747,16 +747,6 @@ trap(struct trapframe *frame) } MAKEMPSAFE(have_mplock); trap_fatal(frame, 0); - goto out2; - } - - /* - * Virtual kernel intercept - if the fault is directly related to a - * VM context managed by a virtual kernel then let the virtual kernel - * handle it. - */ - if (lp->lwp_vkernel && lp->lwp_vkernel->ve) { - vkernel_trap(lp, frame); goto out; } @@ -895,8 +885,10 @@ nogo: * kludge is needed to pass the fault address to signal handlers. */ struct proc *p = td->td_proc; - kprintf("seg-fault accessing address %p rip=%p pid=%d p_comm=%s\n", - (void *)va, (void *)frame->tf_rip, p->p_pid, p->p_comm); + if (td->td_lwp->lwp_vkernel == NULL) { + kprintf("seg-fault accessing address %p rip=%p pid=%d p_comm=%s\n", + (void *)va, (void *)frame->tf_rip, p->p_pid, p->p_comm); + } /* Debugger("seg-fault"); */ return((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV); @@ -1320,7 +1312,15 @@ generic_lwp_return(struct lwp *lp, struct trapframe *frame) void set_vkernel_fp(struct trapframe *frame) { - /* JGXXX */ + struct thread *td = curthread; + + if (frame->tf_xflags & PGEX_FPFAULT) { + td->td_pcb->pcb_flags |= FP_VIRTFP; + if (mdcpu->gd_npxthread == td) + npxexit(); + } else { + td->td_pcb->pcb_flags &= ~FP_VIRTFP; + } } /*