From owner-svn-src-head@freebsd.org Fri Apr 15 02:20:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1BB8AED6FB; Fri, 15 Apr 2016 02:20:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADA3E1448; Fri, 15 Apr 2016 02:20:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3F2KJ6J032101; Fri, 15 Apr 2016 02:20:19 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3F2KIMv032087; Fri, 15 Apr 2016 02:20:18 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604150220.u3F2KIMv032087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 15 Apr 2016 02:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298022 - in head/sys: amd64/amd64 amd64/conf conf dev/hyperv/vmbus dev/hyperv/vmbus/amd64 dev/hyperv/vmbus/i386 i386/conf i386/i386 modules/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2016 02:20:20 -0000 Author: sephe Date: Fri Apr 15 02:20:18 2016 New Revision: 298022 URL: https://svnweb.freebsd.org/changeset/base/298022 Log: hyperv: Deprecate HYPERV option by moving Hyper-V IDT vector into vmbus Submitted by: Jun Su Reviewed by: jhb, kib, sephe Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5910 Added: head/sys/dev/hyperv/vmbus/amd64/ head/sys/dev/hyperv/vmbus/amd64/hv_vector.S (contents, props changed) head/sys/dev/hyperv/vmbus/i386/ head/sys/dev/hyperv/vmbus/i386/hv_vector.S (contents, props changed) Modified: head/sys/amd64/amd64/apic_vector.S head/sys/amd64/conf/GENERIC head/sys/amd64/conf/NOTES head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/options.amd64 head/sys/conf/options.i386 head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/i386/conf/GENERIC head/sys/i386/i386/apic_vector.s head/sys/modules/hyperv/vmbus/Makefile Modified: head/sys/amd64/amd64/apic_vector.S ============================================================================== --- head/sys/amd64/amd64/apic_vector.S Fri Apr 15 02:14:11 2016 (r298021) +++ head/sys/amd64/amd64/apic_vector.S Fri Apr 15 02:20:18 2016 (r298022) @@ -174,22 +174,6 @@ IDTVEC(xen_intr_upcall) jmp doreti #endif -#ifdef HYPERV -/* - * This is the Hyper-V vmbus channel direct callback interrupt. - * Only used when it is running on Hyper-V. - */ - .text - SUPERALIGN_TEXT -IDTVEC(hv_vmbus_callback) - PUSH_FRAME - FAKE_MCOUNT(TF_RIP(%rsp)) - movq %rsp, %rdi - call hv_vector_handler - MEXITCOUNT - jmp doreti -#endif - #ifdef SMP /* * Global address space TLB shootdown. Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri Apr 15 02:14:11 2016 (r298021) +++ head/sys/amd64/conf/GENERIC Fri Apr 15 02:20:18 2016 (r298022) @@ -350,8 +350,6 @@ device virtio_scsi # VirtIO SCSI devic device virtio_balloon # VirtIO Memory Balloon device # HyperV drivers and enchancement support -# NOTE: HYPERV depends on hyperv. They must be added or removed together. -options HYPERV # Hyper-V kernel infrastructure device hyperv # HyperV drivers # Xen HVM Guest Optimizations Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Fri Apr 15 02:14:11 2016 (r298021) +++ head/sys/amd64/conf/NOTES Fri Apr 15 02:20:18 2016 (r298022) @@ -515,7 +515,6 @@ device virtio_random # VirtIO Entropy d device virtio_console # VirtIO Console device # Microsoft Hyper-V enchancement support -options HYPERV # Hyper-V kernel infrastructure device hyperv # HyperV drivers # Xen HVM Guest Optimizations Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Fri Apr 15 02:14:11 2016 (r298021) +++ head/sys/conf/files.amd64 Fri Apr 15 02:20:18 2016 (r298022) @@ -277,6 +277,7 @@ dev/hyperv/vmbus/hv_hv.c optional hyp dev/hyperv/vmbus/hv_et.c optional hyperv dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c optional hyperv +dev/hyperv/vmbus/amd64/hv_vector.S optional hyperv dev/nfe/if_nfe.c optional nfe pci dev/ntb/if_ntb/if_ntb.c optional if_ntb dev/ntb/ntb_hw/ntb_hw.c optional if_ntb | ntb_hw Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri Apr 15 02:14:11 2016 (r298021) +++ head/sys/conf/files.i386 Fri Apr 15 02:20:18 2016 (r298022) @@ -252,6 +252,7 @@ dev/hyperv/vmbus/hv_hv.c optional hyp dev/hyperv/vmbus/hv_et.c optional hyperv dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c optional hyperv +dev/hyperv/vmbus/i386/hv_vector.S optional hyperv dev/ichwd/ichwd.c optional ichwd dev/if_ndis/if_ndis.c optional ndis dev/if_ndis/if_ndis_pccard.c optional ndis pccard Modified: head/sys/conf/options.amd64 ============================================================================== --- head/sys/conf/options.amd64 Fri Apr 15 02:14:11 2016 (r298021) +++ head/sys/conf/options.amd64 Fri Apr 15 02:20:18 2016 (r298022) @@ -63,7 +63,5 @@ BPF_JITTER opt_bpf.h XENHVM opt_global.h -HYPERV opt_global.h - # options for the Intel C600 SAS driver (isci) ISCI_LOGGING opt_isci.h Modified: head/sys/conf/options.i386 ============================================================================== --- head/sys/conf/options.i386 Fri Apr 15 02:14:11 2016 (r298021) +++ head/sys/conf/options.i386 Fri Apr 15 02:20:18 2016 (r298022) @@ -123,7 +123,5 @@ BPF_JITTER opt_bpf.h XENHVM opt_global.h -HYPERV opt_global.h - # options for the Intel C600 SAS driver (isci) ISCI_LOGGING opt_isci.h Added: head/sys/dev/hyperv/vmbus/amd64/hv_vector.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/amd64/hv_vector.S Fri Apr 15 02:20:18 2016 (r298022) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * 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 unmodified, 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 AUTHOR ``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 AUTHOR 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. + * + * $FreeBSD$ + */ + +#include +#include + +#include "assym.s" + +/* + * This is the Hyper-V vmbus channel direct callback interrupt. + * Only used when it is running on Hyper-V. + */ + .text + SUPERALIGN_TEXT +IDTVEC(hv_vmbus_callback) + PUSH_FRAME + FAKE_MCOUNT(TF_RIP(%rsp)) + movq %rsp, %rdi + call hv_vector_handler + MEXITCOUNT + jmp doreti Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Fri Apr 15 02:14:11 2016 (r298021) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Fri Apr 15 02:20:18 2016 (r298022) @@ -370,9 +370,7 @@ vmbus_probe(device_t dev) { return (BUS_PROBE_DEFAULT); } -#ifdef HYPERV extern inthand_t IDTVEC(hv_vmbus_callback); -#endif /** * @brief Main vmbus driver initialization routine. @@ -406,14 +404,10 @@ vmbus_bus_init(void) return (ret); } -#ifdef HYPERV /* * Find a free IDT slot for vmbus callback. */ hv_vmbus_g_context.hv_cb_vector = lapic_ipi_alloc(IDTVEC(hv_vmbus_callback)); -#else - hv_vmbus_g_context.hv_cb_vector = -1; -#endif if (hv_vmbus_g_context.hv_cb_vector < 0) { if(bootverbose) printf("Error VMBUS: Cannot find free IDT slot for " Added: head/sys/dev/hyperv/vmbus/i386/hv_vector.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/i386/hv_vector.S Fri Apr 15 02:20:18 2016 (r298022) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * 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 unmodified, 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 AUTHOR ``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 AUTHOR 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. + * + * $FreeBSD$ + */ + +#include +#include + +#include "assym.s" + +/* + * This is the Hyper-V vmbus channel direct callback interrupt. + * Only used when it is running on Hyper-V. + */ + .text + SUPERALIGN_TEXT +IDTVEC(hv_vmbus_callback) + PUSH_FRAME + SET_KERNEL_SREGS + cld + FAKE_MCOUNT(TF_EIP(%esp)) + pushl %esp + call hv_vector_handler + add $4, %esp + MEXITCOUNT + jmp doreti Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri Apr 15 02:14:11 2016 (r298021) +++ head/sys/i386/conf/GENERIC Fri Apr 15 02:20:18 2016 (r298022) @@ -367,8 +367,6 @@ device virtio_scsi # VirtIO SCSI devic device virtio_balloon # VirtIO Memory Balloon device # HyperV drivers and enchancement support -# NOTE: HYPERV depends on hyperv. They must be added or removed together. -options HYPERV # Hyper-V kernel infrastructure device hyperv # HyperV drivers # Xen HVM Guest Optimizations Modified: head/sys/i386/i386/apic_vector.s ============================================================================== --- head/sys/i386/i386/apic_vector.s Fri Apr 15 02:14:11 2016 (r298021) +++ head/sys/i386/i386/apic_vector.s Fri Apr 15 02:20:18 2016 (r298022) @@ -181,25 +181,6 @@ IDTVEC(xen_intr_upcall) jmp doreti #endif -#ifdef HYPERV -/* - * This is the Hyper-V vmbus channel direct callback interrupt. - * Only used when it is running on Hyper-V. - */ - .text - SUPERALIGN_TEXT -IDTVEC(hv_vmbus_callback) - PUSH_FRAME - SET_KERNEL_SREGS - cld - FAKE_MCOUNT(TF_EIP(%esp)) - pushl %esp - call hv_vector_handler - add $4, %esp - MEXITCOUNT - jmp doreti -#endif - #ifdef SMP /* * Global address space TLB shootdown. Modified: head/sys/modules/hyperv/vmbus/Makefile ============================================================================== --- head/sys/modules/hyperv/vmbus/Makefile Fri Apr 15 02:14:11 2016 (r298021) +++ head/sys/modules/hyperv/vmbus/Makefile Fri Apr 15 02:20:18 2016 (r298022) @@ -1,7 +1,7 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../../dev/hyperv/vmbus \ - ${.CURDIR}/../../../dev/hyperv/utilities + ${.CURDIR}/../../../dev/hyperv/vmbus/${MACHINE_CPUARCH} KMOD= hv_vmbus SRCS= hv_channel.c \ @@ -14,8 +14,17 @@ SRCS= hv_channel.c \ hv_vmbus_priv.h SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h +# XXX: for assym.s +SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_hwpmc_hooks.h opt_compat.h + +SRCS+= assym.s \ + hv_vector.S + +hv_vector.o: + ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ + ${.IMPSRC} -o ${.TARGET} + CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/include \ - -I${.CURDIR}/../../../dev/hyperv/vmbus \ - -I${.CURDIR}/../../../dev/hyperv/utilities + -I${.CURDIR}/../../../dev/hyperv/vmbus .include