| 63935017 | 04-Jul-2021 |
Aaron LI <aly@aaronly.me> |
libnvmm: More OS independence
* Define PTE_* values in 'libnvmm_x86.c' to avoid including some OS headers: <machine/pte.h>, <machine/vmparam.h> and <machine/pmap.h>. * Redefine __BIT() macro to av
libnvmm: More OS independence
* Define PTE_* values in 'libnvmm_x86.c' to avoid including some OS headers: <machine/pte.h>, <machine/vmparam.h> and <machine/pmap.h>. * Redefine __BIT() macro to avoid handling its difference between NetBSD and DragonFly. * 'nvmm_compat.h' is no longer needed and thus removed.
show more ...
|
| ec2ba064 | 03-Jul-2021 |
Aaron LI <aly@aaronly.me> |
Revert "libnvmm: Fix mmap() failure with 'permission denied'"
Because libnvmm no longer calls mmap() to map the VCPU comm page, revert to the original code to distinguish root owner (open '/dev/nvmm
Revert "libnvmm: Fix mmap() failure with 'permission denied'"
Because libnvmm no longer calls mmap() to map the VCPU comm page, revert to the original code to distinguish root owner (open '/dev/nvmm' with O_WRONLY) vs. non-root owner (open with O_RDONLY).
show more ...
|
| 9aa070ef | 03-Jul-2021 |
Aaron LI <aly@aaronly.me> |
nvmm: Create comm page in nvmm_vcpu_create() rather than via mmap()
Create the VCPU comm page in nvmm_vcpu_create() in kernel, rather than via mmap() in userland. With this change, the 'mmap' opera
nvmm: Create comm page in nvmm_vcpu_create() rather than via mmap()
Create the VCPU comm page in nvmm_vcpu_create() in kernel, rather than via mmap() in userland. With this change, the 'mmap' operation support is no longer needed by the '/dev/nvmm' device.
This change breaks ABI, so bump NVMM_KERN_VERSION accordingly.
No API change.
show more ...
|
| 23b2397d | 03-Jul-2021 |
Aaron LI <aly@aaronly.me> |
nvmm: Make FPU state more OS-indenpendent
* Introduce an OS-indenpendent 'nvmm_x64_state_fpu' structure, derived from NetBSD's current FPU implementation. * Also introduce the 'nvmm_x86_xsave' str
nvmm: Make FPU state more OS-indenpendent
* Introduce an OS-indenpendent 'nvmm_x64_state_fpu' structure, derived from NetBSD's current FPU implementation. * Also introduce the 'nvmm_x86_xsave' structure, containing the FPU area and the XSAVE header. * Add the 'nvmm_x86_xsave_size()' that determines the XSAVE area size to simplify the code. * Rename gfpu -> gxsave, for clarity. * Define 'CTASSERT' because 'nvmm.h' and 'nvmm_x86.h' headers will be used by libnvmm(3), but <sys/cdefs.h> only defines 'CTASSERT' for kernel. * Update libnvmm.3 man page accordingly.
show more ...
|
| 7f94978c | 30-May-2021 |
Aaron LI <aly@aaronly.me> |
libnvmm: Fix mmap() failure with 'permission denied'
The mmap() in nvmm_vcpu_create() was always failing with the EACCES (permission denied) error code. It was because mmap() was requesting prot =
libnvmm: Fix mmap() failure with 'permission denied'
The mmap() in nvmm_vcpu_create() was always failing with the EACCES (permission denied) error code. It was because mmap() was requesting prot = PROT_READ|PROT_WRITE and flags = MAP_SHARED, but the fd was opened with O_RDONLY (or O_WRONLY in nvmm_root_init()) and thus disallowed such a mmap request.
Fix this issue by opening the nvmm fd with O_RDWR flag. This also requires to change the mode of '/dev/nvmm' from 0640 to 0660. However, this makes root owner distinguishing in nvmm kernel module useless. So change to identify root owner by checking whether the caller has root privilege.
In addition, refactor nvmm_root_init() to also check for root privilege first and then call nvmm_init().
show more ...
|