Date: Mon, 19 Jan 2015 11:07:29 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r277379 - in stable/10/sys: amd64/amd64 kern sys vm Message-ID: <201501191107.t0JB7TF0054144@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Jan 19 11:07:29 2015 New Revision: 277379 URL: https://svnweb.freebsd.org/changeset/base/277379 Log: MFC r277055: Revert r263475: TDP_DEVMEMIO no longer needed. Modified: stable/10/sys/amd64/amd64/mem.c stable/10/sys/amd64/amd64/trap.c stable/10/sys/kern/subr_trap.c stable/10/sys/sys/proc.h stable/10/sys/vm/vm_fault.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/mem.c ============================================================================== --- stable/10/sys/amd64/amd64/mem.c Mon Jan 19 11:06:56 2015 (r277378) +++ stable/10/sys/amd64/amd64/mem.c Mon Jan 19 11:07:29 2015 (r277379) @@ -82,10 +82,9 @@ memrw(struct cdev *dev, struct uio *uio, ssize_t orig_resid; u_long v, vd; u_int c; - int error, sflags; + int error; error = 0; - sflags = curthread_pflags_set(TDP_DEVMEMIO); orig_resid = uio->uio_resid; while (uio->uio_resid > 0 && error == 0) { iov = uio->uio_iov; @@ -151,7 +150,6 @@ memrw(struct cdev *dev, struct uio *uio, break; } } - curthread_pflags_restore(sflags); /* * Don't return error if any byte was written. Read and write * can return error only if no i/o was performed. Modified: stable/10/sys/amd64/amd64/trap.c ============================================================================== --- stable/10/sys/amd64/amd64/trap.c Mon Jan 19 11:06:56 2015 (r277378) +++ stable/10/sys/amd64/amd64/trap.c Mon Jan 19 11:07:29 2015 (r277379) @@ -772,12 +772,6 @@ nogo: frame->tf_rip = (long)curpcb->pcb_onfault; return (0); } - if ((td->td_pflags & TDP_DEVMEMIO) != 0) { - KASSERT(curpcb->pcb_onfault != NULL, - ("/dev/mem without pcb_onfault")); - frame->tf_rip = (long)curpcb->pcb_onfault; - return (0); - } trap_fatal(frame, eva); return (-1); } Modified: stable/10/sys/kern/subr_trap.c ============================================================================== --- stable/10/sys/kern/subr_trap.c Mon Jan 19 11:06:56 2015 (r277378) +++ stable/10/sys/kern/subr_trap.c Mon Jan 19 11:07:29 2015 (r277379) @@ -155,8 +155,6 @@ userret(struct thread *td, struct trapfr ("userret: Returning with %d locks held", td->td_locks)); KASSERT((td->td_pflags & TDP_NOFAULTING) == 0, ("userret: Returning with pagefaults disabled")); - KASSERT((td->td_pflags & TDP_DEVMEMIO) == 0, - ("userret: Returning with /dev/mem i/o leaked")); KASSERT(td->td_no_sleeping == 0, ("userret: Returning with sleep disabled")); KASSERT(td->td_pinned == 0 || (td->td_pflags & TDP_CALLCHAIN) != 0, Modified: stable/10/sys/sys/proc.h ============================================================================== --- stable/10/sys/sys/proc.h Mon Jan 19 11:06:56 2015 (r277378) +++ stable/10/sys/sys/proc.h Mon Jan 19 11:07:29 2015 (r277379) @@ -424,7 +424,7 @@ do { \ #define TDP_RESETSPUR 0x04000000 /* Reset spurious page fault history. */ #define TDP_NERRNO 0x08000000 /* Last errno is already in td_errno */ #define TDP_UIOHELD 0x10000000 /* Current uio has pages held in td_ma */ -#define TDP_DEVMEMIO 0x20000000 /* Accessing memory for /dev/mem */ +#define TDP_UNUSED29 0x20000000 /* --available-- */ #define TDP_EXECVMSPC 0x40000000 /* Execve destroyed old vmspace */ /* Modified: stable/10/sys/vm/vm_fault.c ============================================================================== --- stable/10/sys/vm/vm_fault.c Mon Jan 19 11:06:56 2015 (r277378) +++ stable/10/sys/vm/vm_fault.c Mon Jan 19 11:07:29 2015 (r277379) @@ -334,10 +334,6 @@ RetryFault:; map_generation = fs.map->timestamp; if (fs.entry->eflags & MAP_ENTRY_NOFAULT) { - if ((curthread->td_pflags & TDP_DEVMEMIO) != 0) { - vm_map_unlock_read(fs.map); - return (KERN_FAILURE); - } panic("vm_fault: fault on nofault entry, addr: %lx", (u_long)vaddr); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501191107.t0JB7TF0054144>