Source-Changes-HG archive

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

[src/netbsd-8]: src/sys Pull up following revision(s) via patch (requested by...



details:   https://anonhg.NetBSD.org/src/rev/e27d2794e12d
branches:  netbsd-8
changeset: 449523:e27d2794e12d
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Mar 09 17:10:19 2019 +0000

description:
Pull up following revision(s) via patch (requested by nonaka in ticket #1210):

        sys/dev/hyperv/vmbusvar.h: revision 1.1
        sys/dev/hyperv/hvs.c: revision 1.1
        sys/dev/hyperv/if_hvn.c: revision 1.1
        sys/dev/hyperv/vmbusic.c: revision 1.1
        sys/arch/x86/x86/lapic.c: revision 1.69
        sys/arch/x86/isa/clock.c: revision 1.34
        sys/arch/x86/include/intrdefs.h: revision 1.22
        sys/arch/i386/conf/GENERIC: revision 1.1201
        sys/arch/x86/x86/hyperv.c: revision 1.1
        sys/arch/x86/include/cpu.h: revision 1.105
        sys/arch/x86/x86/x86_machdep.c: revision 1.124
        sys/arch/i386/conf/GENERIC: revision 1.1203
        sys/arch/amd64/amd64/genassym.cf: revision 1.74
        sys/arch/i386/conf/GENERIC: revision 1.1204
        sys/arch/amd64/conf/GENERIC: revision 1.520
        sys/arch/x86/x86/hypervreg.h: revision 1.1
        sys/arch/amd64/amd64/vector.S: revision 1.69
        sys/dev/hyperv/hvshutdown.c: revision 1.1
        sys/dev/hyperv/hvshutdown.c: revision 1.2
        sys/dev/usb/if_urndisreg.h: file removal
        sys/arch/x86/x86/cpu.c: revision 1.167
        sys/arch/x86/conf/files.x86: revision 1.107
        sys/dev/usb/if_urndis.c: revision 1.20
        sys/dev/hyperv/vmbusicreg.h: revision 1.1
        sys/dev/hyperv/hvheartbeat.c: revision 1.1
        sys/dev/hyperv/vmbusicreg.h: revision 1.2
        sys/dev/hyperv/hvheartbeat.c: revision 1.2
        sys/dev/hyperv/files.hyperv: revision 1.1
        sys/dev/ic/rndisreg.h: revision 1.1
        sys/arch/i386/i386/genassym.cf: revision 1.111
        sys/dev/ic/rndisreg.h: revision 1.2
        sys/dev/hyperv/hyperv_common.c: revision 1.1
        sys/dev/hyperv/hvtimesync.c: revision 1.1
        sys/dev/hyperv/hypervreg.h: revision 1.1
        sys/dev/hyperv/hvtimesync.c: revision 1.2
        sys/dev/hyperv/vmbusicvar.h: revision 1.1
        sys/dev/hyperv/if_hvnreg.h: revision 1.1
        sys/arch/x86/x86/lapic.c: revision 1.70
        sys/arch/amd64/amd64/vector.S: revision 1.70
        sys/dev/ic/ndisreg.h: revision 1.1
        sys/arch/amd64/conf/GENERIC: revision 1.516
        sys/dev/hyperv/hypervvar.h: revision 1.1
        sys/arch/amd64/conf/GENERIC: revision 1.518
        sys/arch/amd64/conf/GENERIC: revision 1.519
        sys/arch/i386/conf/files.i386: revision 1.400
        sys/dev/acpi/vmbus_acpi.c: revision 1.1
        sys/dev/hyperv/vmbus.c: revision 1.1
        sys/dev/hyperv/vmbus.c: revision 1.2
        sys/arch/x86/x86/intr.c: revision 1.144
        sys/arch/i386/i386/vector.S: revision 1.83
        sys/arch/amd64/conf/files.amd64: revision 1.112

separate RNDIS definitions from urndis(4) for use with Hyper-V NetVSC.

 -

Added Microsoft Hyper-V support.  It ported from OpenBSD and FreeBSD.
graphical console is not work on Gen.2 VM yet. To use the serial console,
enter "consdev com,0x3f8,115200" on efiboot.

 -

Add __diagused.

 -

PR/53984: Partial revert of modify lapic_calibrate_timer() in lapic.c r1.69.

 -

Update Hyper-V related drivers description.

 -

Remove unused definition.

 -

Rename the MODULE_*_HOOK() macros to MODULE_HOOK_*() as briefly
discussed on irc.
NFCI intended.

 -

commented out hvkvp entry.

 -

fix typo. pointed out by pgoyette@n.o.

 -

Use IDTVEC instead of NENTRY for handle_hyperv_hypercall.

 -

Rename the MODULE_*_HOOK() macros to MODULE_HOOK_*() as briefly
discussed on irc.

diffstat:

 sys/arch/amd64/amd64/genassym.cf |     4 +-
 sys/arch/amd64/amd64/vector.S    |    47 +-
 sys/arch/amd64/conf/GENERIC      |    14 +-
 sys/arch/amd64/conf/files.amd64  |     8 +-
 sys/arch/i386/conf/GENERIC       |    14 +-
 sys/arch/i386/conf/files.i386    |     8 +-
 sys/arch/i386/i386/genassym.cf   |     4 +-
 sys/arch/i386/i386/vector.S      |    48 +-
 sys/arch/x86/conf/files.x86      |     6 +-
 sys/arch/x86/include/cpu.h       |     4 +-
 sys/arch/x86/include/intrdefs.h  |    13 +-
 sys/arch/x86/isa/clock.c         |     8 +-
 sys/arch/x86/x86/cpu.c           |    16 +-
 sys/arch/x86/x86/hyperv.c        |   919 ++++++++++++++++
 sys/arch/x86/x86/hypervreg.h     |   155 ++
 sys/arch/x86/x86/intr.c          |    30 +-
 sys/arch/x86/x86/lapic.c         |    13 +-
 sys/arch/x86/x86/x86_machdep.c   |    35 +-
 sys/dev/acpi/vmbus_acpi.c        |   106 +
 sys/dev/hyperv/files.hyperv      |    34 +
 sys/dev/hyperv/hvheartbeat.c     |   198 +++
 sys/dev/hyperv/hvs.c             |  1139 ++++++++++++++++++++
 sys/dev/hyperv/hvshutdown.c      |   233 ++++
 sys/dev/hyperv/hvtimesync.c      |   338 ++++++
 sys/dev/hyperv/hyperv_common.c   |   183 +++
 sys/dev/hyperv/hypervreg.h       |   453 ++++++++
 sys/dev/hyperv/hypervvar.h       |   115 ++
 sys/dev/hyperv/if_hvn.c          |  1849 +++++++++++++++++++++++++++++++++
 sys/dev/hyperv/if_hvnreg.h       |   204 +++
 sys/dev/hyperv/vmbus.c           |  2112 ++++++++++++++++++++++++++++++++++++++
 sys/dev/hyperv/vmbusic.c         |   271 ++++
 sys/dev/hyperv/vmbusicreg.h      |   246 ++++
 sys/dev/hyperv/vmbusicvar.h      |    68 +
 sys/dev/hyperv/vmbusvar.h        |   273 ++++
 sys/dev/ic/ndisreg.h             |   435 +++++++
 sys/dev/ic/rndisreg.h            |   306 +++++
 sys/dev/usb/if_urndis.c          |   121 +-
 sys/dev/usb/if_urndisreg.h       |   307 -----
 38 files changed, 9953 insertions(+), 384 deletions(-)

diffs (truncated from 10993 to 300 lines):

diff -r 3bc7cb9e266a -r e27d2794e12d sys/arch/amd64/amd64/genassym.cf
--- a/sys/arch/amd64/amd64/genassym.cf  Thu Mar 07 17:43:03 2019 +0000
+++ b/sys/arch/amd64/amd64/genassym.cf  Sat Mar 09 17:10:19 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: genassym.cf,v 1.60.10.2 2018/03/22 16:59:03 martin Exp $
+#      $NetBSD: genassym.cf,v 1.60.10.3 2019/03/09 17:10:20 martin Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -329,11 +329,13 @@
 
 define IPL_NONE                IPL_NONE
 define IPL_PREEMPT             IPL_PREEMPT
+define IPL_NET                 IPL_NET
 define IPL_CLOCK               IPL_CLOCK
 define IPL_HIGH                IPL_HIGH
 
 define LIR_IPI                 LIR_IPI
 define LIR_TIMER               LIR_TIMER
+define LIR_HV                  LIR_HV
 
 define SIR_NET                 SIR_NET
 define SIR_CLOCK               SIR_CLOCK
diff -r 3bc7cb9e266a -r e27d2794e12d sys/arch/amd64/amd64/vector.S
--- a/sys/arch/amd64/amd64/vector.S     Thu Mar 07 17:43:03 2019 +0000
+++ b/sys/arch/amd64/amd64/vector.S     Sat Mar 09 17:10:19 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vector.S,v 1.49.2.3 2018/04/05 18:15:02 martin Exp $   */
+/*     $NetBSD: vector.S,v 1.49.2.4 2019/03/09 17:10:20 martin Exp $   */
 
 /*-
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -84,6 +84,9 @@
 #include "ioapic.h"
 #include "lapic.h"
 #include "assym.h"
+#ifndef XEN
+#include "hyperv.h"
+#endif
 
        .text
 
@@ -260,6 +263,48 @@
 IDTVEC_END(intr_lapic_ltimer)
        TEXT_USER_END
 
+#if NHYPERV > 0
+       /*
+        * Hyper-V event channel upcall interrupt handler.
+        * Only used when the hypervisor supports direct vector callbacks.
+        */
+IDTVEC(recurse_hyperv_hypercall)
+       INTR_RECURSE_HWFRAME
+       pushq   $0
+       pushq   $T_ASTFLT
+       INTRENTRY
+       jmp     1f
+IDTVEC_END(recurse_hyperv_hypercall)
+IDTVEC(handle_hyperv_hypercall)
+       movl    CPUVAR(ILEVEL),%ebx
+       cmpl    $IPL_NET,%ebx
+       jae     2f
+       jmp     1f
+IDTVEC_END(handle_hyperv_hypercall)
+IDTVEC(resume_hyperv_hypercall)
+1:
+       incl    CPUVAR(IDEPTH)
+       movl    $IPL_NET,CPUVAR(ILEVEL)
+       sti
+       pushq   %rbx
+       movq    %rsp,%rsi
+       call    _C_LABEL(hyperv_hypercall_intr)
+       jmp     _C_LABEL(Xdoreti)
+2:
+       orl     $(1 << LIR_HV),CPUVAR(IPENDING)
+       INTRFASTEXIT
+IDTVEC_END(resume_hyperv_hypercall)
+
+       TEXT_USER_BEGIN
+IDTVEC(intr_hyperv_hypercall)
+       pushq   $0
+       pushq   $T_ASTFLT
+       INTRENTRY
+       jmp     _C_LABEL(Xhandle_hyperv_hypercall)
+IDTVEC_END(intr_hyperv_hypercall)
+       TEXT_USER_END
+#endif /* NHYPERV > 0 */
+
 #endif /* NLAPIC > 0 */
 
 #ifndef XEN
diff -r 3bc7cb9e266a -r e27d2794e12d sys/arch/amd64/conf/GENERIC
--- a/sys/arch/amd64/conf/GENERIC       Thu Mar 07 17:43:03 2019 +0000
+++ b/sys/arch/amd64/conf/GENERIC       Sat Mar 09 17:10:19 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.459.2.13 2018/12/07 17:11:37 martin Exp $
+# $NetBSD: GENERIC,v 1.459.2.14 2019/03/09 17:10:20 martin Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident         "GENERIC-$Revision: 1.459.2.13 $"
+#ident         "GENERIC-$Revision: 1.459.2.14 $"
 
 maxusers       64              # estimated number of users
 
@@ -83,6 +83,7 @@
 acpicpu*       at cpu?         # ACPI CPU (including frequency scaling)
 coretemp*      at cpu?         # Intel on-die thermal sensor
 est0           at cpu0         # Intel Enhanced SpeedStep (non-ACPI)
+hyperv0        at cpu0         # Microsoft Hyper-V
 #odcm0         at cpu0         # On-demand clock modulation
 powernow0      at cpu0         # AMD PowerNow! and Cool'n'Quiet (non-ACPI)
 vmt0           at cpu0         # VMware Tools
@@ -1056,6 +1057,15 @@
 viornd* at virtio?                     # Virtio entropy device
 vioscsi* at virtio?                    # Virtio SCSI device
 
+# Hyper-V devices
+vmbus*         at acpi?                # Hyper-V VMBus
+hvn*           at vmbus?               # Hyper-V NetVSC
+hvs*           at vmbus?               # Hyper-V StorVSC
+hvheartbeat*   at vmbus?               # Hyper-V Heartbeat Service
+hvshutdown*    at vmbus?               # Hyper-V Guest Shutdown Service
+hvtimesync*    at vmbus?               # Hyper-V Time Synchronization Service
+#hvkvp*                at vmbus?               # Hyper-V Data Exchange Service
+
 # Pull in optional local configuration
 cinclude "arch/amd64/conf/GENERIC.local"
 
diff -r 3bc7cb9e266a -r e27d2794e12d sys/arch/amd64/conf/files.amd64
--- a/sys/arch/amd64/conf/files.amd64   Thu Mar 07 17:43:03 2019 +0000
+++ b/sys/arch/amd64/conf/files.amd64   Sat Mar 09 17:10:19 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.amd64,v 1.88.8.4 2018/06/09 15:12:21 martin Exp $
+#      $NetBSD: files.amd64,v 1.88.8.5 2019/03/09 17:10:20 martin Exp $
 #
 # new style config file for amd64 architecture
 #
@@ -198,5 +198,11 @@
 include "dev/acpi/files.acpi"
 file   arch/amd64/acpi/acpi_wakeup_low.S       acpi
 
+# Microsoft Hyper-V
+include "dev/hyperv/files.hyperv"
+
+attach vmbus at acpinodebus with vmbus_acpi
+file   dev/acpi/vmbus_acpi.c                   vmbus_acpi
+
 include        "arch/amd64/conf/majors.amd64"
 endif #xen
diff -r 3bc7cb9e266a -r e27d2794e12d sys/arch/i386/conf/GENERIC
--- a/sys/arch/i386/conf/GENERIC        Thu Mar 07 17:43:03 2019 +0000
+++ b/sys/arch/i386/conf/GENERIC        Sat Mar 09 17:10:19 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1156.2.13 2018/12/07 17:11:37 martin Exp $
+# $NetBSD: GENERIC,v 1.1156.2.14 2019/03/09 17:10:20 martin Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident         "GENERIC-$Revision: 1.1156.2.13 $"
+#ident         "GENERIC-$Revision: 1.1156.2.14 $"
 
 maxusers       64              # estimated number of users
 
@@ -38,6 +38,7 @@
 acpicpu*       at cpu?         # ACPI CPU (including frequency scaling)
 coretemp*      at cpu?         # Intel on-die thermal sensor
 est0           at cpu0         # Intel Enhanced SpeedStep (non-ACPI)
+hyperv0                at cpu0         # Microsoft Hyper-V
 #odcm0         at cpu0         # On-demand clock modulation
 #padlock0      at cpu0         # VIA PadLock
 powernow0      at cpu0         # AMD PowerNow! and Cool'n'Quiet (non-ACPI)
@@ -1436,6 +1437,15 @@
 viornd* at virtio?                     # Virtio entropy device
 vioscsi* at virtio?                    # Virtio SCSI device
 
+# Hyper-V devices
+vmbus*         at acpi?                # Hyper-V VMBus
+hvn*           at vmbus?               # Hyper-V NetVSC
+hvs*           at vmbus?               # Hyper-V StorVSC
+hvheartbeat*   at vmbus?               # Hyper-V Heartbeat Service
+hvshutdown*    at vmbus?               # Hyper-V Guest Shutdown Service
+hvtimesync*    at vmbus?               # Hyper-V Time Synchronization Service
+#hvkvp*                at vmbus?               # Hyper-V Data Exchange Service
+
 
 # Pull in optional local configuration
 cinclude "arch/i386/conf/GENERIC.local"
diff -r 3bc7cb9e266a -r e27d2794e12d sys/arch/i386/conf/files.i386
--- a/sys/arch/i386/conf/files.i386     Thu Mar 07 17:43:03 2019 +0000
+++ b/sys/arch/i386/conf/files.i386     Sat Mar 09 17:10:19 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.i386,v 1.378.6.3 2018/06/09 15:12:21 martin Exp $
+#      $NetBSD: files.i386,v 1.378.6.4 2019/03/09 17:10:20 martin Exp $
 #
 # new style config file for i386 architecture
 #
@@ -440,6 +440,12 @@
 include "dev/acpi/files.acpi"
 file   arch/i386/acpi/acpi_wakeup_low.S        acpi
 
+# Microsoft Hyper-V
+include "dev/hyperv/files.hyperv"
+
+attach vmbus at acpinodebus with vmbus_acpi
+file   dev/acpi/vmbus_acpi.c                   vmbus_acpi
+
 # Obsolete vesabios/vesafb flags
 obsolete       defflag opt_vesabios.h  VESABIOSVERBOSE
 obsolete       defparam opt_vesafb.h   VESAFB_WIDTH VESAFB_HEIGHT VESAFB_DEPTH
diff -r 3bc7cb9e266a -r e27d2794e12d sys/arch/i386/i386/genassym.cf
--- a/sys/arch/i386/i386/genassym.cf    Thu Mar 07 17:43:03 2019 +0000
+++ b/sys/arch/i386/i386/genassym.cf    Sat Mar 09 17:10:19 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: genassym.cf,v 1.99.10.1 2018/03/13 15:47:44 martin Exp $
+#      $NetBSD: genassym.cf,v 1.99.10.2 2019/03/09 17:10:21 martin Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -358,6 +358,7 @@
 
 define IPL_NONE                IPL_NONE
 define IPL_PREEMPT             IPL_PREEMPT
+define IPL_NET                 IPL_NET
 define IPL_SCHED               IPL_SCHED
 define IPL_CLOCK               IPL_CLOCK
 define IPL_HIGH                IPL_HIGH
@@ -368,6 +369,7 @@
 
 define LIR_IPI                 LIR_IPI
 define LIR_TIMER               LIR_TIMER
+define LIR_HV                  LIR_HV
 
 define SIR_NET                 SIR_NET
 define SIR_CLOCK               SIR_CLOCK
diff -r 3bc7cb9e266a -r e27d2794e12d sys/arch/i386/i386/vector.S
--- a/sys/arch/i386/i386/vector.S       Thu Mar 07 17:43:03 2019 +0000
+++ b/sys/arch/i386/i386/vector.S       Sat Mar 09 17:10:19 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vector.S,v 1.69.2.1 2018/04/05 18:15:02 martin Exp $   */
+/*     $NetBSD: vector.S,v 1.69.2.2 2019/03/09 17:10:21 martin Exp $   */
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.69.2.1 2018/04/05 18:15:02 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.69.2.2 2019/03/09 17:10:21 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -87,6 +87,9 @@
 
 #include "ioapic.h"
 #include "lapic.h"
+#ifndef XEN
+#include "hyperv.h"
+#endif
 
 #include "assym.h"
 
@@ -323,6 +326,47 @@
        orl     $(1 << LIR_TIMER),CPUVAR(IPENDING)
        INTRFASTEXIT
 IDTVEC_END(resume_lapic_ltimer)
+
+#if NHYPERV > 0
+       /*
+        * Hyper-V event channel upcall interrupt handler.
+        * Only used when the hypervisor supports direct vector callbacks.
+        */
+IDTVEC(recurse_hyperv_hypercall)
+       pushfl
+       pushl   %cs
+       pushl   %esi
+       pushl   $0
+       pushl   $T_ASTFLT
+       INTRENTRY
+       jmp     1f
+IDTVEC_END(recurse_hyperv_hypercall)
+IDTVEC(intr_hyperv_hypercall)
+       pushl   $0
+       pushl   $T_ASTFLT
+       INTRENTRY
+       movl    CPUVAR(ILEVEL),%ebx
+       cmpl    $IPL_NET,%ebx
+       jae     2f
+       jmp     1f
+IDTVEC_END(intr_hyperv_hypercall)
+IDTVEC(resume_hyperv_hypercall)



Home | Main Index | Thread Index | Old Index