From 99b30c79b0dcd3693b5b190a50db61d8d86c48b8 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Sat, 11 Dec 1999 10:21:34 +0000 Subject: [PATCH] Don't simulate a pseudo address-space beyond VM_MAXUSER_ADDRESS that maps onto the upages. We used to use this extensively, particularly for ps and gdb. Both of these have been "fixed". ps gets the p_stats via eproc along with all the other stats, and gdb uses the regs, fpregs etc files. Once apon a time the UPAGES were mapped here, but that changed back in January '96. This essentially kills my revisions 1.16 and 1.17. The 2-page "hole" above the stack can be reclaimed now. --- sys/fs/procfs/procfs_mem.c | 40 ---------------------------------- sys/miscfs/procfs/procfs_mem.c | 40 ---------------------------------- 2 files changed, 80 deletions(-) diff --git a/sys/fs/procfs/procfs_mem.c b/sys/fs/procfs/procfs_mem.c index 8b785bf708a..ebfe53b8665 100644 --- a/sys/fs/procfs/procfs_mem.c +++ b/sys/fs/procfs/procfs_mem.c @@ -128,46 +128,6 @@ procfs_rwmem(curp, p, uio) */ len = min(PAGE_SIZE - page_offset, uio->uio_resid); - if (uva >= VM_MAXUSER_ADDRESS) { - vm_offset_t tkva; - - if (writing || - uva >= VM_MAXUSER_ADDRESS + UPAGES * PAGE_SIZE || - (ptrace_read_u_check(p, - uva - (vm_offset_t) VM_MAXUSER_ADDRESS, - (size_t) len) && - !procfs_kmemaccess(curp))) { - error = 0; - break; - } - - /* we are reading the "U area", force it into core */ - PHOLD(p); - - /* sanity check */ - if (!(p->p_flag & P_INMEM)) { - /* aiee! */ - PRELE(p); - error = EFAULT; - break; - } - - /* populate the ptrace/procfs area */ - p->p_addr->u_kproc.kp_proc = *p; - fill_eproc (p, &p->p_addr->u_kproc.kp_eproc); - - /* locate the in-core address */ - tkva = (uintptr_t)p->p_addr + uva - VM_MAXUSER_ADDRESS; - - /* transfer it */ - error = uiomove((caddr_t)tkva, len, uio); - - /* let the pages go */ - PRELE(p); - - continue; - } - /* * Fault the page on behalf of the process */ diff --git a/sys/miscfs/procfs/procfs_mem.c b/sys/miscfs/procfs/procfs_mem.c index 8b785bf708a..ebfe53b8665 100644 --- a/sys/miscfs/procfs/procfs_mem.c +++ b/sys/miscfs/procfs/procfs_mem.c @@ -128,46 +128,6 @@ procfs_rwmem(curp, p, uio) */ len = min(PAGE_SIZE - page_offset, uio->uio_resid); - if (uva >= VM_MAXUSER_ADDRESS) { - vm_offset_t tkva; - - if (writing || - uva >= VM_MAXUSER_ADDRESS + UPAGES * PAGE_SIZE || - (ptrace_read_u_check(p, - uva - (vm_offset_t) VM_MAXUSER_ADDRESS, - (size_t) len) && - !procfs_kmemaccess(curp))) { - error = 0; - break; - } - - /* we are reading the "U area", force it into core */ - PHOLD(p); - - /* sanity check */ - if (!(p->p_flag & P_INMEM)) { - /* aiee! */ - PRELE(p); - error = EFAULT; - break; - } - - /* populate the ptrace/procfs area */ - p->p_addr->u_kproc.kp_proc = *p; - fill_eproc (p, &p->p_addr->u_kproc.kp_eproc); - - /* locate the in-core address */ - tkva = (uintptr_t)p->p_addr + uva - VM_MAXUSER_ADDRESS; - - /* transfer it */ - error = uiomove((caddr_t)tkva, len, uio); - - /* let the pages go */ - PRELE(p); - - continue; - } - /* * Fault the page on behalf of the process */ -- 2.45.2