Revert r263475: TDP_DEVMEMIO no longer needed, since amd64 /dev/kmem
does not access kernel mappings directly. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
64807b300f
commit
18cc2ff047
@ -82,10 +82,9 @@ memrw(struct cdev *dev, struct uio *uio, int flags)
|
||||
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, int flags)
|
||||
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.
|
||||
|
@ -774,12 +774,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);
|
||||
}
|
||||
|
@ -157,8 +157,6 @@ userret(struct thread *td, struct trapframe *frame)
|
||||
td->td_rw_rlocks));
|
||||
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,
|
||||
|
@ -430,7 +430,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 */
|
||||
|
||||
/*
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user