Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
00ea6e8
feat: added Generic PVH boot
iMilnb Dec 9, 2023
9c2f2ba
fix: beginning asm cleanup using genassym.cf instead of plain values
iMilnb Dec 9, 2023
de1ee90
fix: assembly cleanup
iMilnb Dec 10, 2023
f5d2a1b
fix: ifdef'ed pretty much all Xen related code
iMilnb Dec 10, 2023
1b4c8bc
fix: ditched pvh_consinit and xen_mainbus
iMilnb Dec 10, 2023
3ba2088
fix: no more dependency on hypervisor
iMilnb Dec 10, 2023
68ca718
fix: cleaner inclusion
iMilnb Dec 10, 2023
ccbb86e
first commit
iMilnb Dec 10, 2023
78d46c9
fix: no need for GENPVH
iMilnb Dec 10, 2023
bf1d9ba
fix: merged the much classier asm from Greg
iMilnb Dec 11, 2023
58617e2
fix: return if not XENPVH
iMilnb Dec 11, 2023
8881beb
fix: added Generic PVH
iMilnb Dec 11, 2023
7f2f59c
fix: ditched more Xen-only dependencies
iMilnb Dec 11, 2023
dcdf576
docs: shorter comment lines
iMilnb Dec 11, 2023
db94b79
fix: restore newline
iMilnb Dec 11, 2023
35d51b9
fix: restore newline
iMilnb Dec 11, 2023
70da5e4
fix: reverted GENPVH option, handle with conditions
iMilnb Dec 11, 2023
a695337
fix: restored original ifdefs
iMilnb Dec 11, 2023
235e7fd
fix: removed config file, GENPVH will land in GENERIC
iMilnb Dec 11, 2023
775aaf4
fix: initialize HYPERVISOR_shared_info_pa only when running on Xen
gcavelier Dec 11, 2023
957b9e1
fix: only copy memmap info if present
gcavelier Dec 13, 2023
0f6a6e0
fix: handle console= parameter passed via generic PVH VMM
iMilnb Dec 13, 2023
3df78dd
Merge branch 'GENPVH' of github.com:NetBSDfr/NetBSD-src into GENPVH
iMilnb Dec 13, 2023
d2e651d
fix: wrong placement and leftovers
iMilnb Dec 13, 2023
6e0b361
fix: sizeof dest, not src
iMilnb Dec 13, 2023
8d12eb8
feat: first PoC commit for MMIO boot
iMilnb Dec 18, 2023
c00c914
fix: not sure indexes relate to queues type
iMilnb Dec 18, 2023
3ac5221
fix: correctly identify if the hypervisor is Xen
gcavelier Dec 18, 2023
eb2e612
remove hardcoded value
gcavelier Dec 18, 2023
e9bf1eb
align comments
gcavelier Dec 18, 2023
916f19e
feat: added cmdline backend
iMilnb Dec 19, 2023
946a1dd
fix: use intr_establish_xname
iMilnb Dec 20, 2023
37e57b3
feat: added Linux MPTable bug for ioapic to be seen
iMilnb Dec 21, 2023
8b4c8c2
Merge branch 'trunk' into GENPVH
iMilnb Dec 21, 2023
f949adf
Merge branch 'GENPVH' into mmio_cmdline
iMilnb Dec 21, 2023
93b807f
panic on pci-virtio
iMilnb Dec 21, 2023
ca1d7ab
fix: wrongly removed dma64_tag
iMilnb Dec 21, 2023
7e84a05
fix: IRQ triggered, block device recognized. Cleanup
iMilnb Dec 26, 2023
53cd71a
chores: cleanup
iMilnb Dec 26, 2023
154c4a0
Merge branch 'NetBSD:trunk' into GENPVH
iMilnb Dec 28, 2023
bc8acfe
Merge branch 'NetBSD:trunk' into mmio_cmdline
iMilnb Dec 28, 2023
4346326
fix: works on qemu/mmio
iMilnb Dec 28, 2023
fa1392d
Merge branch 'mmio_cmdline' of github.com:NetBSDfr/NetBSD-src into mm…
iMilnb Dec 28, 2023
95a8fb2
Merge branch 'GENPVH' of github.com:NetBSDfr/NetBSD-src into GENPVH
iMilnb Dec 28, 2023
2bc2c08
fix: call ksyms_addsyms_elf() with symsize=0 because we don't have ac…
gcavelier Dec 28, 2023
c09440b
feat: added pvclock (kvm_clock) support
iMilnb Dec 31, 2023
00756da
Merge branch 'GENPVH' of github.com:NetBSDfr/NetBSD-src into GENPVH
iMilnb Jan 2, 2024
78506db
Merge branch 'trunk' into GENPVH
iMilnb Jan 2, 2024
939b804
Merge branch 'GENPVH' into mmio_cmdline
iMilnb Jan 2, 2024
74b5c3a
sync thorpej@ mmio changes
iMilnb Jan 3, 2024
36c7249
Merge branch 'trunk' into GENPVH
iMilnb Jan 3, 2024
3559001
sync with GENPVH
iMilnb Jan 3, 2024
0ce63e2
Merge branch 'GENPVH' into mmio_cmdline
iMilnb Jan 3, 2024
9645551
feat: multiple virtio devices support
iMilnb Jan 4, 2024
9929369
fix: features for Firecracker
iMilnb Jan 4, 2024
814b955
thorpej MMIOv2 fix
iMilnb Jan 5, 2024
1189c84
feat: support for Fiecracker
iMilnb Jan 6, 2024
efe198a
fix: wipe pvclock for now
iMilnb Jan 6, 2024
4434b2e
fix: wipe pvclock for now
iMilnb Jan 6, 2024
0305c7b
fix: no need for this anymore
iMilnb Jan 6, 2024
3994995
Merge branch 'trunk' into GENPVH
iMilnb Jan 6, 2024
406f197
Merge branch 'GENPVH' into mmio_cmdline
iMilnb Jan 6, 2024
ac4b48e
feat: dropped PCI bus
iMilnb Jan 7, 2024
9783ca3
feat: introduced pvbus
iMilnb Jan 8, 2024
541ecfd
fix: aprint_normal
iMilnb Jan 8, 2024
9866279
fix: no need for cmdlinebus anymore
iMilnb Jan 8, 2024
822ea51
fix: no need for cmdlinebus anymore
iMilnb Jan 8, 2024
44c287d
fix: sync with trunk
iMilnb Jan 8, 2024
71d1d98
fix: sync with trunk
iMilnb Jan 8, 2024
461d555
Merge branch 'trunk' into mmio_cmdline
iMilnb Jan 8, 2024
f791db5
Merge branch 'trunk' into GENPVH
iMilnb Jan 8, 2024
c441291
fix: licenses
iMilnb Jan 8, 2024
d10326f
fix: NetBSD license
iMilnb Jan 9, 2024
53af54c
fix: not needed anymore
iMilnb Jan 9, 2024
7a30076
Merge branch 'NetBSD:trunk' into GENPVH
iMilnb Jan 9, 2024
7d85a1f
Merge branch 'trunk' into GENPVH
iMilnb Jan 9, 2024
4f53c8f
Merge branch 'GENPVH' of github.com:NetBSDfr/NetBSD-src into GENPVH
iMilnb Jan 9, 2024
2694ee9
Merge branch 'GENPVH' into mmio_cmdline
iMilnb Jan 9, 2024
b61f6eb
fix: cleanup
iMilnb Jan 9, 2024
c66574a
fix: cleanup
iMilnb Jan 9, 2024
b146177
fix: cleanup
iMilnb Jan 9, 2024
5129f1b
fix: cleanup and comment
iMilnb Jan 10, 2024
18ae00b
fix: let's check sizes shall we
iMilnb Jan 10, 2024
4789207
doc: added pv man
iMilnb Jan 11, 2024
e1255e4
doc: added virtio_mmio man
iMilnb Jan 11, 2024
a9aee6c
Merge branch 'NetBSD:trunk' into mmio_cmdline
iMilnb Jan 11, 2024
9361b4c
fix: performance analysis and fixes
iMilnb Jan 14, 2024
1e0b369
fix: add sys/tstages.h
iMilnb Jan 15, 2024
e37dc7f
fix: correctly detect all childs
iMilnb Jan 15, 2024
16e6bb1
fix: increase cmdline length
iMilnb Jan 15, 2024
245d160
fix: don't tc_init if mc146818_read fails
iMilnb Jan 15, 2024
840e952
feat: add pvclock (again)
iMilnb Jan 15, 2024
20a1166
fix: useless print
iMilnb Jan 15, 2024
bdd66d2
feat: don't use lapic timecounter on GENPVH
iMilnb Jan 15, 2024
6eef561
fix: get TSC from CPU brand
iMilnb Jan 16, 2024
77d6ff6
fix: no need for tracing
iMilnb Jan 16, 2024
644408a
fix: we don't use lapic timer
iMilnb Jan 16, 2024
bb7c2f3
fix: avoid delay, wait for char
iMilnb Jan 16, 2024
b087212
fix: introduced hv_type for vmms using KVM
iMilnb Jan 16, 2024
799cf99
fix: s/low/high/
iMilnb Jan 16, 2024
6485c6d
fix: introduce hv_type to avoid lapic when pvclock is available
iMilnb Jan 17, 2024
e23b8c9
fix: NVMM fixed, reports freq un Mhz instead of khz
iMilnb Jan 17, 2024
e5e3fee
fix: back to return
iMilnb Jan 17, 2024
53bc7bc
fix: cleanup and organize get tsc by cpuid
iMilnb Jan 17, 2024
1134d9f
fix: cleanup cpu_tsc_freq_cpuid
iMilnb Jan 17, 2024
810119f
feat: added cperciva@ TSLOG
iMilnb Jan 18, 2024
70d01b2
feat: removed most of tstages, now to TSLOG
iMilnb Jan 18, 2024
b7cc1ae
feat: horrible python script to add TSLOG to every main() function
iMilnb Jan 18, 2024
f6ce891
fix: whitelisted ctob
iMilnb Jan 18, 2024
f46ad9c
feat: tslog_user imported, other measurements added
iMilnb Jan 19, 2024
d65d1a7
fix: remaining debug
iMilnb Jan 19, 2024
dd1db6b
fix: print before free
iMilnb Jan 19, 2024
8442b25
fix: attach to debug node
iMilnb Jan 19, 2024
6a3fad4
feat: multiline support
iMilnb Jan 19, 2024
cc30a73
fix: tslog kthread_create
iMilnb Jan 19, 2024
4719678
fix: cleaned up tslog
iMilnb Jan 20, 2024
c46d084
fix: leftover debug
iMilnb Jan 20, 2024
14d4c5c
fix: check if a thread is alive before recording it
iMilnb Jan 20, 2024
3cd2361
fix: copy thread names in order to avoir name garbage
iMilnb Jan 22, 2024
bdb316a
docs: explain the copy
iMilnb Jan 22, 2024
488c432
docs: more precision
iMilnb Jan 22, 2024
d5588e0
fix: pid0 has no process, fix spaces
iMilnb Jan 22, 2024
fd5e0bf
fix: 85
iMilnb Jan 22, 2024
058b032
feat: make boot time display optional
iMilnb Jan 22, 2024
a91f6dc
Merge branch 'NetBSD:trunk' into perf
iMilnb Jan 22, 2024
90b1b77
docs: added tslog man
iMilnb Jan 23, 2024
dcaf8a9
docs: added pvclock(4) man
iMilnb Jan 23, 2024
38ff85b
feat: added AMD 17+ family MSR freq, disabled NVMM for invtsc
iMilnb Jan 25, 2024
30a7678
feat: add vmware-style CPUID to get CPU frequency
iMilnb Jan 26, 2024
07916a1
fix: values read from NVMM are now correct (patch)
iMilnb Jan 26, 2024
1970a6c
fix: debug leftover
iMilnb Jan 26, 2024
5f661cf
fix: unused variable
iMilnb Jan 26, 2024
c4df819
fix: include pvclock.h when option activated + add prototype for tslo…
iMilnb Jan 29, 2024
5982418
fix: freq > 32 bits
iMilnb Jan 30, 2024
408f1af
Initial replication of iMil results
csdvrx Jan 31, 2024
9821027
Document the current results
csdvrx Jan 31, 2024
ee83481
Merge branch 'NetBSDfr:trunk' into result-replication
csdvrx Feb 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 105 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,116 @@
NetBSD
======

NetBSD is a free, fast, secure, and highly portable Unix-like Open
Source operating system. It is available for a [wide range of
platforms](https://wiki.NetBSD.org/ports/), from large-scale servers
and powerful desktop systems to handheld and embedded devices.
NetBSD-perf
===========

This is my attempt at replicating iMil results that were reported on https://mail-index.netbsd.org/tech-kern/2024/01/23/msg029450.html and https://old.reddit.com/r/BSD/comments/197vfmq by using the perf branch he published on https://github.com/NetBSDfr/NetBSD-src

Currently, I'm still about 5x slower as I boot in 200 ms, but this is a good beginning:

```
[ 1.0000000] cpu_rng: rdrand/rdseed
[ 1.0000000] entropy: ready
[ 1.0000000] NetBSD 10.99.10 (MICROVM) Notice: this software is protected by copyright
[ 1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
[ 1.0000000] 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,
[ 1.0000000] 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023,
[ 1.0000000] 2024
[ 1.0000000] The NetBSD Foundation, Inc. All rights reserved.
[ 1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
[ 1.0000000] The Regents of the University of California. All rights reserved.
[ 1.0000000] NetBSD 10.99.10 (MICROVM) #5: Tue Jan 30 19:22:09 CST 2024
[ 1.0000000] charlotte@x1ng2:/home/charlotte/obj/sys/arch/amd64/compile/MICROVM
[ 1.0000000] total memory = 127 MB
[ 1.0000000] avail memory = 77184 KB
[ 1.0000000] timecounter: Timecounters tick every 10.000 msec
[ 1.0000000] timecounter: Timecounter "i8254" frequency 1193182 Hz quality 100
[ 1.0000030] Hypervisor: KVM
[ 1.0000030] VMM: Generic PVH
[ 1.0000030] mainbus0 (root)
[ 1.0000030] mainbus0: Intel MP Specification (Version 1.4) (QBOOT 000000000000)
[ 1.0000030] cpu0 at mainbus0 apid 0
[ 1.0000030] cpu0: Use lfence to serialize rdtsc
[ 1.0000030] got tsc from vmware compatible cpuid
[ 1.0000030] cpu0: TSC freq CPUID 2496000000 Hz
[ 1.0000030] cpu0: 12th Gen Intel(R) Core(TM) i7-1270P, id 0x906a2
[ 1.0000030] cpu0: node 0, package 0, core 0, smt 0
[ 1.0000030] mpbios: bus 0 is type ISA
[ 1.0000030] ioapic0 at mainbus0 apid 2: pa 0xfec00000, version 0x20, 24 pins
[ 1.0000030] isa0 at mainbus0
[ 1.0000030] com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, 16-byte FIFO
[ 1.0000030] com0: console
[ 1.0000030] allocated pic ioapic0 type edge pin 4 level 8 to cpu0 slot 0 idt entry 129
[ 1.0000030] pv0 at mainbus0
[ 1.0000030] virtio0 at pv0
[ 1.0000030] kernel parameters: root=ld0c rw console=com -z -v virtio_mmio.device=512@0xfeb00e00:12 virtio_mmio.device=512@0xfeb00c00:11
[ 1.0000030] viommio: 512@0xfeb00e00:12
[ 1.0000030] virtio0: VirtIO-MMIO-v2
[ 1.0000030] virtio0: entropy device (id 4, rev. 0x01)
[ 1.0000030] viornd0 at virtio0: features: 0x110000000<V1,INDIRECT_DESC>
[ 1.0000030] virtio0: allocated 32768 byte for virtqueue 0 for Entropy request, size 1024
[ 1.0000030] allocated pic ioapic0 type level pin 12 level 6 to cpu0 slot 1 idt entry 96
[ 1.0000030] virtio0: interrupting on -1
[ 1.0000030] virtio1 at pv0
[ 1.0000030] viommio: 512@0xfeb00c00:11
[ 1.0000030] virtio1: VirtIO-MMIO-v2
[ 1.0000030] virtio1: block device (id 2, rev. 0x01)
[ 1.0000030] ld0 at virtio1: features: 0x110000a54<V1,INDIRECT_DESC,CONFIG_WCE,FLUSH,BLK_SIZE,GEOMETRY,SEG_MAX>
[ 1.0000030] virtio1: allocated 4227072 byte for virtqueue 0 for I/O request, size 1024
[ 1.0000030] virtio1: using 4194304 byte (262144 entries) indirect descriptors
[ 1.0000030] allocated pic ioapic0 type level pin 11 level 6 to cpu0 slot 2 idt entry 97
[ 1.0000030] virtio1: interrupting on -1
[ 1.0000030] ld0: 512 MB, 1040 cyl, 16 head, 63 sec, 512 bytes/sect x 1048576 sectors
[ 1.0000030] timecounter: Timecounter "lapic" frequency 999998000 Hz quality -100
[ 1.0000030] timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
[ 1.0000030] timecounter: Timecounter "TSC" frequency 2496000000 Hz quality 3000
[ 1.0001656] boot device: ld0
[ 1.0001656] root on ld0c dumps on ld0b
[ 1.0001656] root file system type: ffs
[ 1.0001656] kern.module.path=/stand/amd64/10.99.10/modules
[ 1.0001656] WARNING: clock gained 4 days
[ 1.0050716] boot: 199ms (entry tsc: 281364007)
[ 1.0050716] exec /sbin/init: error 8
[ 1.0050716] init: trying /sbin/oinit
bslinit v7 starting on NetBSD, will handle 12 signals, reaping zombies every 30 s
arg 0: oinit
oinit: mount /proc failed: Invalid argument
# Epoch 1706665417, time 2024-01-31T01:43:37
```

Note however that the qemu append doesn't seem to survive a reboot:

```
# init: can't add utmpx record for `system boot': No such file or directory
init: can't add utmpx record for `system down': No such file or directory
qemu-system-x86_64: terminating on signal 2
[ 1.0000000] cpu_rng: rdrand/rdseed
[ 1.0000000] entropy: ready
[ 1.0000000] NetBSD 10.99.10 (MICROVM) Notice: this software is protected by copyright
[ 1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
[ 1.0000000] 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,
[ 1.0000000] 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023,
[ 1.0000000] 2024
[ 1.0000000] The NetBSD Foundation, Inc. All rights reserved.
[ 1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
[ 1.0000000] The Regents of the University of California. All rights reserved.
(...)
[ 1.0155438] root on ld0c dumps on ld0b
[ 1.0155438] vfs_mountroot: can't open root device
[ 1.0155438] cannot mount root, error = 6
[ 1.0155438] root device (default ld0c): qemu-system-x86_64: terminating on signal 2
```

Building
--------

You can cross-build NetBSD from most UNIX-like operating systems.
To build for amd64 (x86_64), in the src directory:

./build.sh -U -u -j4 -m amd64 -O ~/obj release

Additional build information available in the [BUILDING](BUILDING) file.
sh ./compile.sh

Binaries
--------

- [Daily builds](https://nycdn.NetBSD.org/pub/NetBSD-daily/HEAD/latest/)
- [Releases](https://cdn.NetBSD.org/pub/NetBSD/)

Testing
-------

On a running NetBSD system:

cd /usr/tests; atf-run | atf-report

Troubleshooting
---------------

- Send bugs and patches [via web form](https://www.NetBSD.org/cgi-bin/sendpr.cgi?gndb=netbsd).
- Subscribe to the [mailing lists](https://www.NetBSD.org/mailinglists/).
The [netbsd-users](https://www.NetBSD.org/mailinglists/#netbsd-users) list is a good choice for many problems; watch [current-users](https://www.NetBSD.org/mailinglists/#current-users) if you follow the bleeding edge of NetBSD-current.
- Join the community IRC channel [#netbsd @ libera.chat](https://web.libera.chat/#netbsd).

Latest sources
--------------

To fetch the main CVS repository:

cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P src

To work in the Git mirror, which is updated every few hours from CVS:
When it'll be ready, you'll see the releases on the right handside

git clone https://github.com/NetBSD/src.git
TODO
----

Additional Links
----------------
Adding flamecharts to understand why it's so slow

- [The NetBSD Guide](https://www.NetBSD.org/docs/guide/en/)
- [NetBSD manual pages](https://man.NetBSD.org/)
- [NetBSD Cross-Reference](https://nxr.NetBSD.org/)
Adding a basic rootfs with simple tools such as bslinit, the tslog script to create flamecharts, and a shell
45 changes: 45 additions & 0 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/sh
# Replication of iMil result reported on https://mail-index.netbsd.org/tech-kern/2024/01/23/msg029450.html
KERNELCONFIG="MICROVM"
TOOLCHAIN="$HOME/obj"
CPUS=4

# Get the sources
#git clone https://github.com/NetBSDfr/NetBSD-src

# Show the branches available
#git branch -a

# Change to result-replication, based on the perf branch
git branch| grep result-replication || git switch result-replication

#cf https://www.netbsd.org/docs/guide/en/chap-build.html#chap-boot-cross-compiling-kernel
echo "# Building the cross compilation toolchain into ${TOOLCHAIN}":

stat -c "%y %A %n size: %s" ${TOOLCHAIN}/tooldir*x86_64/bin/nbmake \
|| sh ./build.sh -U -O ${TOOLCHAIN} -j ${CPUS} -m amd64 -a x86_64 tools \
|| exit 1

echo "# Using the kernel configuration ${KERNELCONFIG}":
stat -c "%y %A %n size: %s" sys/arch/amd64/conf/${KERNELCONFIG} \
|| exit 2

echo "# Checking pvclock is disabled as it requires the missing <dev/pv/pvreg.h>"
grep -v ^pvclock sys/arch/amd64/conf/${KERNELCONFIG} \
|| exit 3

echo "# Refreshing the kernel build with -u" \
&& sh ./build.sh -u -U -O ${TOOLCHAIN} -j ${CPUS} -m amd64 kernel=${KERNELCONFIG} \
&& stat -c "%y %A %n size: %s" ${TOOLCHAIN}/sys/arch/amd64/compile/${KERNELCONFIG}/netbsd \
|| exit 4

## Alternatives:
# Use nbconfig and nbmake directly with sys/arch/amd64/conf/kern-compile.sh

# Don't just update the kernel: remove the '-u' that's for update only

# Compile from scratch the release and the kernel
#sh ./build.sh -U -O ${TOOLCHAIN} -j ${CPUS} -m amd64 -a x86_64 release kernel=${KERNELCONFIG}

# TODO: add qemu scripts, which should have console=com etc
# TODO: add a basic init_args parsing arguments like sys/arch/x86/x86/x86_autoconf.c
44 changes: 44 additions & 0 deletions share/man/man4/pv.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.\" $NetBSD$
.\"
.\" Copyright (c) 2024 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.\" ported from OpenBSD
.Dd January 2024
.Dt PV 4
.Os
.Sh NAME
.Nm pv
.Nd paravirtual device tree root
.Sh SYNOPSIS
.Cd "pv* at pvbus?"
.Sh DESCRIPTION
.Nm
driver is used on virtual machines that are running on hypervisors.
It provides a pseudo-bus for all paravirtual devices that do not
attach to a well-known bus like
.Xr pci 4 .
.Sh SEE ALSO
.Xr virtio 4 ,
.Xr mmio_virtio 4
74 changes: 74 additions & 0 deletions share/man/man4/pvclock.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
.\" $NetBSD$
.\"
.\" Copyright (c) 2024 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.\" ported from OpenBSD
.\" $OpenBSD: pvclock.4,v 1.2 2018/11/23 17:21:37 jmc Exp $
.\"
.\" Copyright (c) 2018 Reyk Floeter <reyk@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd January 2024
.Dt PVCLOCK 4
.Os
.Sh NAME
.Nm pvclock
.Nd paravirtual clock driver
.Sh SYNOPSIS
.Cd "pvclock* at pv?"
.Sh DESCRIPTION
The
.Nm
driver supports the paravirtual clock that is available in KVM and
other hypervisors.
.Nm
uses a shared page between the host and the hypervisor to synchronize
the TSC clock in an efficient way.
.Sh SEE ALSO
.Xr pv 4
.Sh HISTORY
The
.Nm
driver first appeared in
.Nx 11 .
.Sh AUTHORS
.An -nosplit
The
.Nm
driver was written by
.An Reyk Floeter Aq Mt reyk@openbsd.org .
.Nx port was made by
.An Emile 'iMil' Heitor Aq Mt imil@NetBSD.org .
Loading