git: nvmm: Fix comm page unmapping issue by doing it on userland side

Aaron LI aly at crater.dragonflybsd.org
Tue Jul 20 16:30:37 PDT 2021


commit cca384e4794b145c2db2c13903239d9c019de498
Author: Aaron LI <aly at aaronly.me>
Date:   Tue Jul 20 19:47:38 2021 +0800

    nvmm: Fix comm page unmapping issue by doing it on userland side
    
    Previously, we're mapping and unmapping the comm page for userland
    process both on the kernel side.  The unmapping was called at the point
    of closing the fd.
    
    However, the kernel may destroy process' vmspace before or after closing
    the fd, so there is no guarantee that kernel can get the correct address
    space to unmap the comm page for the userland process.  Therefore, do
    the comm page unmapping on the userland side in libnvmm to fix the above
    issue.
    
    In addition, add the 'comm_size' member to 'struct nvmm_capability' to
    expose the comm page size to userland, which is required for the
    unmapping operation.  This breaks ABI, so bump NVMM_KERN_VERSION.
    Update nvmmctl(8) accordingly to print the comm page size.
    
    This commit partially reverts:
    "nvmm: Add missing comm page unmapping"

Summary of changes:
 lib/libnvmm/libnvmm.3                |  3 ++-
 lib/libnvmm/libnvmm.c                |  9 +++++++++
 sys/dev/virtual/nvmm/nvmm.c          | 14 +++++++-------
 sys/dev/virtual/nvmm/nvmm.h          |  3 ++-
 sys/dev/virtual/nvmm/nvmm_internal.h |  1 -
 usr.sbin/nvmmctl/nvmmctl.c           |  1 +
 6 files changed, 21 insertions(+), 10 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/cca384e4794b145c2db2c13903239d9c019de498


-- 
DragonFly BSD source repository


More information about the Commits mailing list