Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/modules/vmt move vmt(4) from MD to MI, and add support v...



details:   https://anonhg.NetBSD.org/src/rev/d9a49a786bc6
branches:  trunk
changeset: 956351:d9a49a786bc6
user:      ryo <ryo%NetBSD.org@localhost>
date:      Tue Oct 27 08:57:10 2020 +0000

description:
move vmt(4) from MD to MI, and add support vmt on aarch64. tested on ESXi-Arm Fling

- move from sys/arch/x86/x86/{vmt.c,vmtreg.h,vmtvar.h} to sys/dev/vmt/{vmt_subr.c,vmtreg.h,vmtvar.h},
  and split the attach part of the cpufeaturebus and fdt
- add aarch64 vmware backdoor op
- add include guard to vmt{reg,var}.h
- Yet there is still some little-endian dependency. it needs to be fixed in order to work properly on aarch64eb

diffstat:

 distrib/sets/lists/man/mi        |    11 +-
 share/man/man4/Makefile          |     5 +-
 share/man/man4/man4.x86/Makefile |     4 +-
 share/man/man4/man4.x86/vmt.4    |    80 --
 share/man/man4/vmt.4             |    81 ++
 sys/arch/evbarm/conf/GENERIC64   |     4 +-
 sys/arch/x86/conf/files.x86      |     3 +-
 sys/arch/x86/x86/identcpu.c      |     8 +-
 sys/arch/x86/x86/lapic.c         |     8 +-
 sys/arch/x86/x86/vmt.c           |  1053 +------------------------------------
 sys/arch/x86/x86/vmtreg.h        |   112 ---
 sys/arch/x86/x86/vmtvar.h        |   134 ----
 sys/conf/files                   |     5 +-
 sys/dev/fdt/files.fdt            |     6 +-
 sys/dev/vmt/files.vmt            |     2 +
 sys/dev/vmt/vmt_subr.c           |  1103 ++++++++++++++++++++++++++++++++++++++
 sys/dev/vmt/vmtreg.h             |   117 ++++
 sys/dev/vmt/vmtvar.h             |   221 +++++++
 sys/modules/vmt/Makefile         |     6 +-
 19 files changed, 1567 insertions(+), 1396 deletions(-)

diffs (truncated from 3226 to 300 lines):

diff -r 4c62656ce8ef -r d9a49a786bc6 distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Tue Oct 27 08:32:36 2020 +0000
+++ b/distrib/sets/lists/man/mi Tue Oct 27 08:57:10 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1706 2020/10/16 15:40:40 ryo Exp $
+# $NetBSD: mi,v 1.1707 2020/10/27 08:57:10 ryo Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2024,6 +2024,7 @@
 ./usr/share/man/cat4/vlan.0                    man-sys-catman          .cat
 ./usr/share/man/cat4/vmmon.0                   man-sys-catman          .cat
 ./usr/share/man/cat4/vmnet.0                   man-sys-catman          .cat
+./usr/share/man/cat4/vmt.0                     man-sys-catman          .cat
 ./usr/share/man/cat4/vmx.0                     man-sys-catman          .cat
 ./usr/share/man/cat4/vnd.0                     man-sys-catman          .cat
 ./usr/share/man/cat4/voodoofb.0                        man-sys-catman          .cat
@@ -2089,7 +2090,7 @@
 ./usr/share/man/cat4/x86/tco.0                 man-sys-catman          .cat
 ./usr/share/man/cat4/x86/tprof_amdpmi.0                man-obsolete            obsolete
 ./usr/share/man/cat4/x86/tprof_pmi.0           man-obsolete            obsolete
-./usr/share/man/cat4/x86/vmt.0                 man-sys-catman          .cat
+./usr/share/man/cat4/x86/vmt.0                 man-obsolete            obsolete
 ./usr/share/man/cat4/x86/vmx.0                 man-obsolete            obsolete
 ./usr/share/man/cat4/xbd.0                     man-sys-catman          .cat
 ./usr/share/man/cat4/xbdback.0                 man-sys-catman          .cat
@@ -5164,6 +5165,7 @@
 ./usr/share/man/html4/vlan.html                        man-sys-htmlman         html
 ./usr/share/man/html4/vmmon.html               man-sys-htmlman         html
 ./usr/share/man/html4/vmnet.html               man-sys-htmlman         html
+./usr/share/man/html4/vmt.html                 man-sys-htmlman         html
 ./usr/share/man/html4/vmx.html                 man-sys-htmlman         html
 ./usr/share/man/html4/vnd.html                 man-sys-htmlman         html
 ./usr/share/man/html4/voodoofb.html            man-sys-htmlman         html
@@ -5229,7 +5231,7 @@
 ./usr/share/man/html4/x86/tco.html             man-sys-htmlman         html
 ./usr/share/man/html4/x86/tprof_amdpmi.html    man-obsolete            obsolete
 ./usr/share/man/html4/x86/tprof_pmi.html       man-obsolete            obsolete
-./usr/share/man/html4/x86/vmt.html             man-sys-htmlman         html
+./usr/share/man/html4/x86/vmt.html             man-obsolete            obsolete
 ./usr/share/man/html4/x86/vmx.html             man-obsolete            obsolete
 ./usr/share/man/html4/xbd.html                 man-sys-htmlman         html
 ./usr/share/man/html4/xbdback.html             man-sys-htmlman         html
@@ -8236,6 +8238,7 @@
 ./usr/share/man/man4/vlan.4                    man-sys-man             .man
 ./usr/share/man/man4/vmmon.4                   man-sys-man             .man
 ./usr/share/man/man4/vmnet.4                   man-sys-man             .man
+./usr/share/man/man4/vmt.4                     man-sys-man             .man
 ./usr/share/man/man4/vmx.4                     man-sys-man             .man
 ./usr/share/man/man4/vnd.4                     man-sys-man             .man
 ./usr/share/man/man4/voodoofb.4                        man-sys-man             .man
@@ -8301,7 +8304,7 @@
 ./usr/share/man/man4/x86/tco.4                 man-sys-man             .man
 ./usr/share/man/man4/x86/tprof_amdpmi.4                man-obsolete            obsolete
 ./usr/share/man/man4/x86/tprof_pmi.4           man-obsolete            obsolete
-./usr/share/man/man4/x86/vmt.4                 man-sys-man             .man
+./usr/share/man/man4/x86/vmt.4                 man-obsolete            obsolete
 ./usr/share/man/man4/x86/vmx.4                 man-obsolete            obsolete
 ./usr/share/man/man4/xbd.4                     man-sys-man             .man
 ./usr/share/man/man4/xbdback.4                 man-sys-man             .man
diff -r 4c62656ce8ef -r d9a49a786bc6 share/man/man4/Makefile
--- a/share/man/man4/Makefile   Tue Oct 27 08:32:36 2020 +0000
+++ b/share/man/man4/Makefile   Tue Oct 27 08:57:10 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.710 2020/10/14 10:19:11 ryo Exp $
+#      $NetBSD: Makefile,v 1.711 2020/10/27 08:57:10 ryo Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/18/93
 
 MAN=   aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -69,7 +69,8 @@
        unix.4 userconf.4 \
        vald.4 valz.4 veriexec.4 vga.4 vge.4 viaide.4 video.4 \
        vio9p.4 vioif.4 viomb.4 viornd.4 vioscsi.4 virt.4 virtio.4 \
-       vether.4 vlan.4 vmmon.4 vmnet.4 vmx.4 vnd.4 voodoofb.4 vr.4 vte.4 \
+       vether.4 vlan.4 vmmon.4 vmnet.4 vmt.4 vmx.4 vnd.4 voodoofb.4 vr.4 \
+       vte.4 \
        wapbl.4 wb.4 wbsio.4 wd.4 wdc.4 wg.4 wi.4 wm.4 wpi.4 \
        wsbell.4 wscons.4 wsdisplay.4 wsfont.4 wskbd.4 wsmouse.4 wsmux.4 \
        xbox.4 xge.4 \
diff -r 4c62656ce8ef -r d9a49a786bc6 share/man/man4/man4.x86/Makefile
--- a/share/man/man4/man4.x86/Makefile  Tue Oct 27 08:32:36 2020 +0000
+++ b/share/man/man4/man4.x86/Makefile  Tue Oct 27 08:57:10 2020 +0000
@@ -1,8 +1,8 @@
-#      $NetBSD: Makefile,v 1.20 2020/10/14 10:19:11 ryo Exp $
+#      $NetBSD: Makefile,v 1.21 2020/10/27 08:57:10 ryo Exp $
 
 MAN=   amdpcib.4 apic.4 balloon.4 coretemp.4 est.4 fdc.4 \
        fwhrng.4 hpet.4 ichlpcib.4 imcsmb.4 lpt.4 mem.4 odcm.4 powernow.4 \
-       soekrisgpio.4 tco.4 vmt.4 \
+       soekrisgpio.4 tco.4 \
        amdsmn.4 amdzentemp.4
 
 MLINKS+=apic.4 ioapic.4 \
diff -r 4c62656ce8ef -r d9a49a786bc6 share/man/man4/man4.x86/vmt.4
--- a/share/man/man4/man4.x86/vmt.4     Tue Oct 27 08:32:36 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-.\"    $NetBSD: vmt.4,v 1.6 2013/10/07 04:04:57 dholland Exp $
-.\"    $OpenBSD: vmt.4,v 1.4 2010/10/26 05:07:31 jmc Exp $
-.\"
-.\" Copyright (c) 2008 Marco Peereboom <marco%openbsd.org@localhost>
-.\" Text was heavily borrowed from the IPMI spec V1.5
-.\"
-.\" 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 TORTIOUS ACTION, ARISING OUT OF
-.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.Dd October 6, 2013
-.Dt VMT 4 x86
-.Os
-.Sh NAME
-.Nm vmt
-.Nd VMware Tools driver
-.Sh SYNOPSIS
-.Cd "vmt0 at cpu0"
-.Sh DESCRIPTION
-The
-.Nm
-driver is a kernel level implementation of VMware Tools.
-VMware Tools are intended to provide better support for operating systems
-running inside virtual machines.
-.Pp
-.Nm
-handles shutdown, reboot, resume requests from the host by sending
-events using
-.Xr sysmon_pswitch 9
-of type PSWITCH_TYPE_POWER, PSWITCH_TYPE_RESET, and PSWITCH_TYPE_SLEEP that
-can be handled by
-.Xr powerd 8 .
-.Nm
-will log notifications that the guest has been suspended or resumed by the
-host.
-.\" It also provides access to the host machine's clock as a timedelta sensor.
-.Pp
-.Nm
-reports the guest's hostname and first non-loopback IP address to the host.
-.Ss Clock synchronization
-The
-.Nm
-driver synchronizes the virtual machine's clock with the host clock in the
-following situations:
-.Bl -bullet
-.It
-When the virtual machine resumes after having been suspended.
-.It
-Periodically with the interval indicated by the
-.Va machdep.vmt0.clock_sync.period
-.Xr sysctl 8
-variable.
-This is done so that the virtual machine can keep its clock synchronized
-when the host is suspended, because in this case the
-.Nm
-driver receives no notification of such an event.
-Setting this tunable to zero disables clock synchronization.
-.El
-.Sh SEE ALSO
-.\" .Xr cpu 4 ,
-.Xr powerd 8
-.Sh HISTORY
-The
-.Nm
-driver first appeared in
-.Ox 4.4
-and was then ported to
-.Nx 6.0 .
-.Sh AUTHORS
-The
-.Nm
-driver was written by
-.An David Gwynne Aq Mt dlg%openbsd.org@localhost .
diff -r 4c62656ce8ef -r d9a49a786bc6 share/man/man4/vmt.4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/vmt.4      Tue Oct 27 08:57:10 2020 +0000
@@ -0,0 +1,81 @@
+.\"    $NetBSD: vmt.4,v 1.3 2020/10/27 08:57:10 ryo Exp $
+.\"    $OpenBSD: vmt.4,v 1.4 2010/10/26 05:07:31 jmc Exp $
+.\"
+.\" Copyright (c) 2008 Marco Peereboom <marco%openbsd.org@localhost>
+.\" Text was heavily borrowed from the IPMI spec V1.5
+.\"
+.\" 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 TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.Dd October 6, 2013
+.Dt VMT 4 x86
+.Os
+.Sh NAME
+.Nm vmt
+.Nd VMware Tools driver
+.Sh SYNOPSIS
+.Cd "vmt0 at cpu0"
+.Cd "vmt0 at fdt?"
+.Sh DESCRIPTION
+The
+.Nm
+driver is a kernel level implementation of VMware Tools.
+VMware Tools are intended to provide better support for operating systems
+running inside virtual machines.
+.Pp
+.Nm
+handles shutdown, reboot, resume requests from the host by sending
+events using
+.Xr sysmon_pswitch 9
+of type PSWITCH_TYPE_POWER, PSWITCH_TYPE_RESET, and PSWITCH_TYPE_SLEEP that
+can be handled by
+.Xr powerd 8 .
+.Nm
+will log notifications that the guest has been suspended or resumed by the
+host.
+.\" It also provides access to the host machine's clock as a timedelta sensor.
+.Pp
+.Nm
+reports the guest's hostname and first non-loopback IP address to the host.
+.Ss Clock synchronization
+The
+.Nm
+driver synchronizes the virtual machine's clock with the host clock in the
+following situations:
+.Bl -bullet
+.It
+When the virtual machine resumes after having been suspended.
+.It
+Periodically with the interval indicated by the
+.Va machdep.vmt0.clock_sync.period
+.Xr sysctl 8
+variable.
+This is done so that the virtual machine can keep its clock synchronized
+when the host is suspended, because in this case the
+.Nm
+driver receives no notification of such an event.
+Setting this tunable to zero disables clock synchronization.
+.El
+.Sh SEE ALSO
+.\" .Xr cpu 4 ,
+.Xr powerd 8
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Ox 4.4
+and was then ported to
+.Nx 6.0 .
+.Sh AUTHORS
+The
+.Nm
+driver was written by
+.An David Gwynne Aq Mt dlg%openbsd.org@localhost .
diff -r 4c62656ce8ef -r d9a49a786bc6 sys/arch/evbarm/conf/GENERIC64
--- a/sys/arch/evbarm/conf/GENERIC64    Tue Oct 27 08:32:36 2020 +0000
+++ b/sys/arch/evbarm/conf/GENERIC64    Tue Oct 27 08:57:10 2020 +0000
@@ -1,5 +1,5 @@
 #
-#      $NetBSD: GENERIC64,v 1.163 2020/10/15 04:39:24 ryo Exp $
+#      $NetBSD: GENERIC64,v 1.164 2020/10/27 08:57:10 ryo Exp $
 #
 #      GENERIC ARM (aarch64) kernel
 #
@@ -100,6 +100,8 @@
 cpu*           at fdt? pass 0
 cpu*           at acpi?
 
+vmt*           at fdt?                 # VMware Tools
+
 # Performance monitors
 armpmu*                at fdt?
 pseudo-device  tprof
diff -r 4c62656ce8ef -r d9a49a786bc6 sys/arch/x86/conf/files.x86
--- a/sys/arch/x86/conf/files.x86       Tue Oct 27 08:32:36 2020 +0000
+++ b/sys/arch/x86/conf/files.x86       Tue Oct 27 08:57:10 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.x86,v 1.119 2020/08/01 12:15:40 jdolecek Exp $
+#      $NetBSD: files.x86,v 1.120 2020/10/27 08:57:11 ryo Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPDEBUG MPBIOS_SCANPCI
@@ -74,7 +74,6 @@
 attach viac7temp at cpufeaturebus
 file   arch/x86/x86/viac7temp.c        viac7temp
 
-device vmt: sysmon_power, sysmon_taskq
 attach vmt at cpufeaturebus
 file   arch/x86/x86/vmt.c              vmt
 
diff -r 4c62656ce8ef -r d9a49a786bc6 sys/arch/x86/x86/identcpu.c
--- a/sys/arch/x86/x86/identcpu.c       Tue Oct 27 08:32:36 2020 +0000



Home | Main Index | Thread Index | Old Index