The NetBSD Project

CVS log for src/lib/libnvmm/libnvmm.3

[BACK] Up to [cvs.NetBSD.org] / src / lib / libnvmm

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.28: download - view: text, markup, annotated - select for diffs
Fri Dec 10 11:08:45 2021 UTC (2 years, 10 months ago) by msaitoh
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, HEAD
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +4 -4 lines
s/premissions/permissions/

Revision 1.27: download - view: text, markup, annotated - select for diffs
Sat Sep 5 07:22:25 2020 UTC (4 years, 2 months ago) by maxv
Branches: MAIN
CVS tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +14 -15 lines
nvmm: update copyright headers

Revision 1.19.2.3: download - view: text, markup, annotated - select for diffs
Mon Apr 13 08:03:14 2020 UTC (4 years, 6 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.19.2.2: preferred, colored; branchpoint 1.19: preferred, colored; next MAIN 1.20: preferred, colored
Changes since revision 1.19.2.2: +111 -46 lines
Mostly merge changes from HEAD upto 20200411

Revision 1.19.4.2: download - view: text, markup, annotated - select for diffs
Mon Feb 10 19:05:05 2020 UTC (4 years, 8 months ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-4-RELEASE, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE
Diff to: previous 1.19.4.1: preferred, colored; branchpoint 1.19: preferred, colored; next MAIN 1.20: preferred, colored
Changes since revision 1.19.4.1: +5 -4 lines
Pull up following revision(s) (requested by maxv in ticket #688):

	share/man/man4/nvmm.4: revision 1.5
	lib/libnvmm/libnvmm.3: revision 1.26
	sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.47

Mmh, as noted in PR/54847, this should be uint64_t, not uint16_t. Harmless
because we use only the two lowest bits anyway.

I believe this could be caught by KUBSAN; time to do another round of
NVMM+K_SAN testing.

Reference nvmmctl(8).

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sun Feb 9 12:19:01 2020 UTC (4 years, 9 months ago) by maxv
Branches: MAIN
CVS tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +5 -4 lines
Reference nvmmctl(8).

Revision 1.19.4.1: download - view: text, markup, annotated - select for diffs
Sun Nov 10 12:58:30 2019 UTC (5 years ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-0-RC2, netbsd-9-0-RC1
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +108 -44 lines
Pull up following revision(s) (requested by maxv in ticket #405):

	usr.sbin/nvmmctl/nvmmctl.8: revision 1.2
	lib/libnvmm/libnvmm.3: revision 1.24
	sys/dev/nvmm/nvmm.h: revision 1.11
	lib/libnvmm/libnvmm.3: revision 1.25
	sys/dev/nvmm/x86/nvmm_x86.h: revision 1.16
	sys/dev/nvmm/nvmm.h: revision 1.12
	sys/dev/nvmm/x86/nvmm_x86.h: revision 1.17
	tests/lib/libnvmm/h_mem_assist.c: revision 1.12
	sys/dev/nvmm/x86/nvmm_x86.h: revision 1.18
	share/mk/bsd.hostprog.mk: revision 1.82
	lib/libnvmm/libnvmm.c: revision 1.15
	distrib/sets/lists/base/md.amd64: revision 1.281
	tests/lib/libnvmm/h_mem_assist.c: revision 1.13
	lib/libnvmm/libnvmm.c: revision 1.16
	tests/lib/libnvmm/h_mem_assist.c: revision 1.14
	lib/libnvmm/libnvmm_x86.c: revision 1.32
	lib/libnvmm/libnvmm.c: revision 1.17
	tests/lib/libnvmm/h_mem_assist.c: revision 1.15
	lib/libnvmm/libnvmm_x86.c: revision 1.33
	lib/libnvmm/libnvmm.c: revision 1.18
	usr.sbin/nvmmctl/Makefile: revision 1.1
	tests/lib/libnvmm/h_mem_assist_asm.S: revision 1.7
	tests/lib/libnvmm/h_mem_assist.c: revision 1.16
	lib/libnvmm/libnvmm_x86.c: revision 1.34
	usr.sbin/nvmmctl/Makefile: revision 1.2
	tests/lib/libnvmm/h_mem_assist_asm.S: revision 1.8
	tests/lib/libnvmm/h_mem_assist.c: revision 1.17
	sys/dev/nvmm/nvmm_internal.h: revision 1.13
	lib/libnvmm/libnvmm_x86.c: revision 1.35
	lib/libnvmm/libnvmm_x86.c: revision 1.36
	usr.sbin/postinstall/postinstall.in: revision 1.8
	lib/libnvmm/libnvmm_x86.c: revision 1.37
	lib/libnvmm/libnvmm_x86.c: revision 1.38
	lib/libnvmm/libnvmm_x86.c: revision 1.39
	usr.sbin/Makefile: revision 1.282
	lib/libnvmm/nvmm.h: revision 1.13
	lib/libnvmm/nvmm.h: revision 1.14
	lib/libnvmm/nvmm.h: revision 1.15
	sys/dev/nvmm/nvmm.c: revision 1.23
	lib/libnvmm/nvmm.h: revision 1.16
	sys/dev/nvmm/nvmm.c: revision 1.24
	lib/libnvmm/nvmm.h: revision 1.17
	sys/dev/nvmm/nvmm.c: revision 1.25
	tests/lib/libnvmm/h_io_assist.c: revision 1.9
	etc/MAKEDEV.tmpl: revision 1.209
	tests/lib/libnvmm/h_io_assist.c: revision 1.10
	tests/lib/libnvmm/h_io_assist.c: revision 1.11
	etc/group: revision 1.35
	distrib/sets/lists/man/mi: revision 1.1660
	sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.40
	sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.41
	sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.42
	sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.43
	sys/dev/nvmm/x86/nvmm_x86_vmx.c: revision 1.44
	sys/dev/nvmm/x86/nvmm_x86_svm.c: revision 1.51
	sys/dev/nvmm/nvmm_ioctl.h: revision 1.8
	sys/dev/nvmm/x86/nvmm_x86_svm.c: revision 1.52
	sys/dev/nvmm/nvmm_ioctl.h: revision 1.9
	sys/dev/nvmm/x86/nvmm_x86_svm.c: revision 1.53
	usr.sbin/nvmmctl/nvmmctl.c: revision 1.1
	lib/libnvmm/libnvmm.3: revision 1.20
	distrib/sets/lists/debug/md.amd64: revision 1.106
	lib/libnvmm/libnvmm.3: revision 1.21
	lib/libnvmm/libnvmm.3: revision 1.22
	usr.sbin/nvmmctl/nvmmctl.8: revision 1.1
	lib/libnvmm/libnvmm.3: revision 1.23

Fix incorrect parsing: the R/M field uses a special GPR map when the
address size is 16 bits, regardless of the actual operating mode. With
this special map there can be two registers referenced at once, and
also disp16-only.
Implement this special behavior, and add associated tests. While here
simplify a few things.
With this in place, the Windows 95 installer initializes correctly.
Part of PR/54611.
add missing initializer
Implement XCHG, add associated tests, and add comments to explain. With
this in place the Windows 95 installer completes successfuly.
Part of PR/54611.
Improve nvmm_vcpu_dump().
Put back 'default', because llvm apparently doesn't realize that all cases
are covered in the switch.
Miscellaneous changes in NVMM, to address several inconsistencies and
issues in the libnvmm API.
 - Rename NVMM_CAPABILITY_VERSION to NVMM_KERN_VERSION, and check it in
   libnvmm. Introduce NVMM_USER_VERSION, for future use.
 - In libnvmm, open "/dev/nvmm" as read-only and with O_CLOEXEC. This is to
   avoid sharing the VMs with the children if the process forks. In the
   NVMM driver, force O_CLOEXEC on open().
 - Rename the following things for consistency:
       nvmm_exit*              -> nvmm_vcpu_exit*
       nvmm_event*             -> nvmm_vcpu_event*
       NVMM_EXIT_*             -> NVMM_VCPU_EXIT_*
       NVMM_EVENT_INTERRUPT_HW -> NVMM_VCPU_EVENT_INTR
       NVMM_EVENT_EXCEPTION    -> NVMM_VCPU_EVENT_EXCP
   Delete NVMM_EVENT_INTERRUPT_SW, unused already.
 - Slightly reorganize the MI/MD definitions, for internal clarity.
 - Split NVMM_VCPU_EXIT_MSR in two: NVMM_VCPU_EXIT_{RD,WR}MSR. Also provide
   separate u.rdmsr and u.wrmsr fields. This is more consistent with the
   other exit reasons.
 - Change the types of several variables:
       event.type                  enum -> u_int
       event.vector                uint64_t -> uint8_t
       exit.u.*msr.msr:            uint64_t -> uint32_t
       exit.u.io.type:             enum -> bool
       exit.u.io.seg:              int -> int8_t
       cap.arch.mxcsr_mask:        uint64_t -> uint32_t
       cap.arch.conf_cpuid_maxops: uint64_t -> uint32_t
 - Delete NVMM_VCPU_EXIT_MWAIT_COND, it is AMD-only and confusing, and we
   already intercept 'monitor' so it is never armed.
 - Introduce vmx_exit_insn() for NVMM-Intel, similar to svm_exit_insn().
   The 'npc' field wasn't getting filled properly during certain VMEXITs.
 - Introduce nvmm_vcpu_configure(). Similar to nvmm_machine_configure(),
   but as its name indicates, the configuration is per-VCPU and not per-VM.
   Migrate and rename NVMM_MACH_CONF_X86_CPUID to NVMM_VCPU_CONF_CPUID.
   This becomes per-VCPU, which makes more sense than per-VM.
 - Extend the NVMM_VCPU_CONF_CPUID conf to allow triggering VMEXITs on
   specific leaves. Until now we could only mask the leaves. An uint32_t
   is added in the structure:
        uint32_t mask:1;
        uint32_t exit:1;
        uint32_t rsvd:30;
   The two first bits select the desired behavior on the leaf. Specifying
   zero on both resets the leaf to the default behavior. The new
   NVMM_VCPU_EXIT_CPUID exit reason is added.
Three changes in libnvmm:
 - Add 'mach' and 'vcpu' backpointers in the nvmm_io and nvmm_mem
   structures.
 - Rename 'nvmm_callbacks' to 'nvmm_assist_callbacks'.
 - Rename and migrate NVMM_MACH_CONF_CALLBACKS to NVMM_VCPU_CONF_CALLBACKS,
   it now becomes per-VCPU.
Update the libnvmm man page:
 - Sync the naming with reality.
 - Replace "relevant" by "desired" and "virtualizer" by "emulator", closer
   to what I meant.
 - Add a "VCPU Configuration" section.
 - Add a "Machine Ownership" section.
Add the "nvmm" group, and make nvmm_init() public. Sent to tech-kern@ a few
days ago.
Use the new PTE naming, and define CR3_FRAME_* separately. No functional
change.
Add a new VCPU conf option, that allows userland to request VMEXITs after a
TPR change. This is supported on all Intel CPUs, and not-too-old AMD CPUs.
The reason for wanting this option is that certain OSes (like Win10 64bit)
manage interrupt priority in hardware via CR8 directly, and for these OSes,
the emulator may want to sync its internal TPR state on each change.
Add two new fields in cap.arch, to report the conf capabilities. Report TPR
only on Intel for now, not AMD, because I don't have a recent AMD CPU on
which to test.
Mask CPUID leaf 0x0A on Intel, because we don't want the guest to try (and
fail) to probe the PMC MSRs. This avoids "Unexpected WRMSR" warnings in
qemu-nvmm.
Add PCID support in the guests. This speeds up most 64bit guests, because
since Meltdown, everybody uses PCID (including NetBSD).
Change the way root_owner works: consider the calling process as root_owner
not if it has root privileges, but if the /dev/nvmm device was opened with
write permissions. Introduce the undocumented nvmm_root_init() function to
achieve that.
The goal is to simplify the logic and have more granularity, eg if we want
a monitoring agent to access VMs but don't want to give this agent real
root access on the system.
A few changes:
 - Use smaller types in struct nvmm_capability.
 - Use smaller type for nvmm_io.port.
 - Switch exitstate to a compacted structure.
Add nram in struct nvmm_ctl_mach_info.
Add nvmmctl, with two commands for now.
Macro tidyness.
Sort SEE ALSO.
should be fork(2), noticed by wiz
Add debug entry for newly introduced nvmmctl utility.
Annotate a covering switch as such to avoid warnings about missing
returns.
Forgot to put nvmmctl in the "nvmm" group.
Add nvmm group.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Mon Oct 28 14:20:28 2019 UTC (5 years ago) by maxv
Branches: MAIN
CVS tags: phil-wifi-20191119
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +2 -2 lines
should be fork(2), noticed by wiz

Revision 1.24: download - view: text, markup, annotated - select for diffs
Mon Oct 28 13:43:42 2019 UTC (5 years ago) by wiz
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +3 -2 lines
Macro tidyness.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Mon Oct 28 08:30:49 2019 UTC (5 years ago) by maxv
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +6 -4 lines
A few changes:

 - Use smaller types in struct nvmm_capability.
 - Use smaller type for nvmm_io.port.
 - Switch exitstate to a compacted structure.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Sun Oct 27 10:28:55 2019 UTC (5 years ago) by maxv
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +3 -2 lines
Add a new VCPU conf option, that allows userland to request VMEXITs after a
TPR change. This is supported on all Intel CPUs, and not-too-old AMD CPUs.

The reason for wanting this option is that certain OSes (like Win10 64bit)
manage interrupt priority in hardware via CR8 directly, and for these OSes,
the emulator may want to sync its internal TPR state on each change.

Add two new fields in cap.arch, to report the conf capabilities. Report TPR
only on Intel for now, not AMD, because I don't have a recent AMD CPU on
which to test.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Sun Oct 27 07:08:15 2019 UTC (5 years ago) by maxv
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +26 -1 lines
Add the "nvmm" group, and make nvmm_init() public. Sent to tech-kern@ a few
days ago.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Fri Oct 25 09:09:24 2019 UTC (5 years ago) by maxv
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +78 -43 lines
Update the libnvmm man page:

 - Sync the naming with reality.

 - Replace "relevant" by "desired" and "virtualizer" by "emulator", closer
   to what I meant.

 - Add a "VCPU Configuration" section.

 - Add a "Machine Ownership" section.

Revision 1.19.2.2: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:05:25 2019 UTC (5 years, 5 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.19.2.1: preferred, colored; branchpoint 1.19: preferred, colored
Changes since revision 1.19.2.1: +675 -0 lines
Sync with HEAD

Revision 1.19.2.1
Sat Jun 8 07:27:44 2019 UTC (5 years, 5 months ago) by christos
Branches: phil-wifi
FILE REMOVED
Changes since revision 1.19: +0 -675 lines
file libnvmm.3 was added on branch phil-wifi on 2019-06-10 22:05:25 +0000

Revision 1.19: download - view: text, markup, annotated - select for diffs
Sat Jun 8 07:27:44 2019 UTC (5 years, 5 months ago) by maxv
Branches: MAIN
CVS tags: phil-wifi-20190609, netbsd-9-base
Branch point for: phil-wifi, netbsd-9
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +76 -36 lines
Change the NVMM API to reduce data movements. Sent to tech-kern@.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Sat May 11 07:44:00 2019 UTC (5 years, 6 months ago) by maxv
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +20 -19 lines
Replace "VMM" by "emulator", clearer.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Sat May 11 07:40:38 2019 UTC (5 years, 6 months ago) by maxv
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +13 -10 lines
Sync with reality.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Mon Apr 29 19:03:17 2019 UTC (5 years, 6 months ago) by maxv
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +16 -25 lines
sync with reality

Revision 1.15: download - view: text, markup, annotated - select for diffs
Mon Apr 29 18:54:25 2019 UTC (5 years, 6 months ago) by maxv
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +7 -15 lines
Stop taking care of the INT/NMI windows in the kernel, the emulator is
supposed to do that itself.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sun Apr 7 14:13:03 2019 UTC (5 years, 7 months ago) by maxv
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +4 -4 lines
Sync, and fix grammar.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Thu Apr 4 17:33:47 2019 UTC (5 years, 7 months ago) by maxv
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +5 -3 lines
Check the GPA permissions too in the Assists, because it is possible that
the guest traps on a page the virtualizer marked as read-only (even if it
appears as read-write in the HVA).

Revision 1.12: download - view: text, markup, annotated - select for diffs
Thu Mar 21 20:21:40 2019 UTC (5 years, 7 months ago) by maxv
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +3 -3 lines
Make it possible for an emulator to set the protection of the guest pages.
For some reason I had initially concluded that it wasn't doable; verily it
is, so let's do it.

The reserved 'flags' argument of nvmm_gpa_map() becomes 'prot' and takes
mmap-like protection codes.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Tue Feb 5 15:03:35 2019 UTC (5 years, 9 months ago) by wiz
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +3 -3 lines
Mark up NULL with Dv. Remove empty line.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Tue Feb 5 13:56:32 2019 UTC (5 years, 9 months ago) by maxv
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +114 -6 lines
Sync with reality, and improve.

Revision 1.2.2.4: download - view: text, markup, annotated - select for diffs
Fri Jan 18 08:50:10 2019 UTC (5 years, 9 months ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.2.2.3: preferred, colored; branchpoint 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2.2.3: +17 -17 lines
Synch with HEAD

Revision 1.9: download - view: text, markup, annotated - select for diffs
Mon Jan 7 22:17:02 2019 UTC (5 years, 10 months ago) by wiz
Branches: MAIN
CVS tags: pgoyette-compat-20190127, pgoyette-compat-20190118
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +2 -2 lines
Remove leading zero from date.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Mon Jan 7 16:30:25 2019 UTC (5 years, 10 months ago) by maxv
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +2 -5 lines
Optimize: on single memory operand instructions, take the GPA directly from
the exit structure provided by the kernel. This saves an MMU translation,
and sometimes complex address computation (eg SIB).

Drop the GVA field, it is not useful to virtualizers.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sun Jan 6 16:10:51 2019 UTC (5 years, 10 months ago) by maxv
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +4 -8 lines
Improvements and fixes in NVMM.

Kernel driver:

 * Don't take an extra (unneeded) reference to the UAO.

 * Provide npc for HLT. I'm not really happy with it right now, will
   likely be revisited.

 * Add the INT_SHADOW, INT_WINDOW_EXIT and NMI_WINDOW_EXIT states. Provide
   them in the exitstate too.

 * Don't take the TPR into account when processing INTs. The virtualizer
   can do that itself (Qemu already does).

 * Provide a hypervisor signature in CPUID, and hide SVM.

 * Ignore certain MSRs. One special case is MSR_NB_CFG in which we set
   NB_CFG_INITAPICCPUIDLO. Allow reads of MSR_TSC.

 * If the LWP has pending signals or softints, leave, rather than waiting
   for a rescheduling to happen later. This reduces interrupt processing
   time in the guest (Qemu sends a signal to the thread, and now we leave
   right away). This could be improved even more by sending an actual IPI
   to the CPU, but I'll see later.

Libnvmm:

 * Fix the MMU translation of large pages, we need to add the lower bits
   too.

 * Change the IO and Mem structures to take a pointer rather than a
   static array. This provides more flexibility.

 * Batch together the str+rep IO transactions. We do one big memory
   read/write, and then send the IO commands to the hypervisor all at
   once. This considerably increases performance.

 * Decode MOVZX.

With these changes in place, Qemu+NVMM works. I can install NetBSD 8.0
in a VM with multiple VCPUs, connect to the network, etc.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Thu Dec 27 07:22:31 2018 UTC (5 years, 10 months ago) by maxv
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +15 -8 lines
Several improvements and fixes:

 * Change the Assist API. Rather than passing callbacks in each call, the
   callbacks are now registered beforehand. Then change the I/O Assist to
   fetch MMIO data via the Mem callback. This allows a guest to perform an
   I/O string operation on a memory that is itself an MMIO.

 * Introduce two new functions internal to libnvmm, read_guest_memory and
   write_guest_memory. They can handle mapped memory, MMIO memory and
   cross-page transactions.

 * Allow nvmm_gva_to_gpa and nvmm_gpa_to_hva to take non-page-aligned
   addresses. This simplifies a lot of things.

 * Support the MOVS instruction, and add a test for it. This instruction
   is special, in that it takes two implicit memory operands. In
   particular, it means that the two buffers can both be in MMIO memory,
   and we handle this case.

 * Fix gross copy-pasto in nvmm_hva_unmap. Also fix a few things here and
   there.

Revision 1.2.2.3: download - view: text, markup, annotated - select for diffs
Wed Dec 26 14:01:27 2018 UTC (5 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.2.2.2: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.2.2: +43 -18 lines
Sync with HEAD, resolve a few conflicts

Revision 1.5: download - view: text, markup, annotated - select for diffs
Sat Dec 15 13:39:43 2018 UTC (5 years, 10 months ago) by maxv
Branches: MAIN
CVS tags: pgoyette-compat-1226
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +29 -10 lines
Invert the mapping logic.

Until now, the "owner" of the memory was the guest, and by calling
nvmm_gpa_map(), the virtualizer was creating a view towards the guest
memory.

Qemu expects the contrary: it wants the owner to be the virtualizer, and
nvmm_gpa_map should just create a view from the guest towards the
virtualizer's address space. Under this scheme, it is legal to have two
GPAs that point to the same HVA.

Introduce nvmm_hva_map() and nvmm_hva_unmap(), that map/unamp the HVA into
a dedicated UOBJ. Change nvmm_gpa_map() and nvmm_gpa_unmap() to just
perform an enter into the desired UOBJ.

With this change in place, all the mapping-related problems in Qemu+NVMM
are fixed.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Wed Dec 12 11:40:08 2018 UTC (5 years, 10 months ago) by wiz
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +2 -2 lines
Remove superfluous dot.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Wed Dec 12 09:09:08 2018 UTC (5 years, 10 months ago) by maxv
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +15 -9 lines
Change the "FILES" section, in the end I don't want to commit toyvirt
and smallkern, there is little interest installing them by default,
rather they can be downloaded from www. It's better this way.

While here add NVMM(4) in "SEE ALSO".

Revision 1.2.2.2: download - view: text, markup, annotated - select for diffs
Mon Nov 26 01:52:13 2018 UTC (5 years, 11 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.2.2.1: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.2.1: +513 -0 lines
Sync with HEAD, resolve a couple of conflicts

Revision 1.2.2.1
Sat Nov 10 10:57:06 2018 UTC (6 years ago) by pgoyette
Branches: pgoyette-compat
FILE REMOVED
Changes since revision 1.2: +0 -513 lines
file libnvmm.3 was added on branch pgoyette-compat on 2018-11-26 01:52:13 +0000

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sat Nov 10 10:57:06 2018 UTC (6 years ago) by maxv
Branches: MAIN
CVS tags: pgoyette-compat-1126
Branch point for: pgoyette-compat
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +30 -1 lines
Add copyright and RCSID, from wiz@.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Sat Nov 10 09:28:56 2018 UTC (6 years ago) by maxv
Branches: MAIN
Add libnvmm, NetBSD's new virtualization API. It provides a way for VMM
software to effortlessly create and manage virtual machines via NVMM.

It is mostly complete, only nvmm_assist_mem needs to be filled -- I have
a draft for that, but it needs some more care. This Mem Assist should
not be needed when emulating a system in x2apic mode, so theoretically
the current form of libnvmm is sufficient to emulate a whole class of
systems.

Generally speaking, there are so many modes in x86 that it is difficult
to handle each corner case without introducing a ton of checks that just
slow down the common-case execution. Currently we check a limited number
of things; we may add more checks in the future if they turn out to be
needed, but that's rather low priority.

Libnvmm is compiled and installed only on amd64. A man page (reviewed by
wiz@) is provided.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>