History log of /dragonfly/lib/libnvmm/libnvmm.c (Results 1 – 11 of 11)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v6.2.1, v6.2.0, v6.3.0, v6.0.1
# ee35a765 28-Jul-2021 Aaron LI <aly@aaronly.me>

libnvmm: Remove unneeded header inclusions and defines

They are now provided by the <dev/virtual/nvmm/nvmm.h> header file.


# cca384e4 20-Jul-2021 Aaron LI <aly@aaronly.me>

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

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"

show more ...


# 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 ...


# b8ee5f9f 04-Jul-2021 Aaron LI <aly@aaronly.me>

libnvmm: Misc cleanups

* Remove unused arguments.
* Use literal numbers instead of __BITS().
* Improve two printf()s.
* Remove NetBSD VCS markers and update copyright.


# 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 ...


# cb121188 30-Jun-2021 Aaron LI <aly@aaronly.me>

libnvmm: Fix a memory leak in nvmm_machine_create()

Also free the allocated 'pages' when ioctl(NVMM_IOC_MACHINE_CREATE)
fails.


# 7f0e1ce2 26-Jun-2021 Aaron LI <aly@aaronly.me>

NVMM: Sync with NetBSD #1: copyright headers


# 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 ...


# 3a9a09d3 09-May-2021 Aaron LI <aly@aaronly.me>

libnvmm: Port to DragonFly

* Add 'nvmm_compat.h' to adapt some macros/constants for DragonFly.
* Add some '__unused' attributes to fix compilation warnings/errors.
* Adjust header inclusions.
* Upda

libnvmm: Port to DragonFly

* Add 'nvmm_compat.h' to adapt some macros/constants for DragonFly.
* Add some '__unused' attributes to fix compilation warnings/errors.
* Adjust header inclusions.
* Update nvmm(4) kernel source path in the man page, also update
'struct nvmm_x64_state' to match DragonFly's version.

show more ...


# 9034eadb 05-May-2021 Aaron LI <aly@aaronly.me>

Import libnvmm(3) from NetBSD 9-stable

This is the virtualization API that provides a way for VMM software to
effortlessly create and manage virtual machines via NVMM(4).

Branch: NetBSD 9-stable
Da

Import libnvmm(3) from NetBSD 9-stable

This is the virtualization API that provides a way for VMM software to
effortlessly create and manage virtual machines via NVMM(4).

Branch: NetBSD 9-stable
Date: Fri Apr 30 14:08:16 2021 +0000
Path: lib/libnvmm

show more ...