Deleted Added
full compact
vmbus.c (307452) vmbus.c (307454)
1/*-
2 * Copyright (c) 2009-2012,2016 Microsoft Corp.
3 * Copyright (c) 2012 NetApp Inc.
4 * Copyright (c) 2012 Citrix Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 16 unchanged lines hidden (view full) ---

25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/*
30 * VM Bus Driver Implementation
31 */
32#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2009-2012,2016 Microsoft Corp.
3 * Copyright (c) 2012 NetApp Inc.
4 * Copyright (c) 2012 Citrix Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 16 unchanged lines hidden (view full) ---

25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/*
30 * VM Bus Driver Implementation
31 */
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: stable/11/sys/dev/hyperv/vmbus/vmbus.c 307452 2016-10-17 02:19:55Z sephe $");
33__FBSDID("$FreeBSD: stable/11/sys/dev/hyperv/vmbus/vmbus.c 307454 2016-10-17 02:25:43Z sephe $");
34
35#include <sys/param.h>
36#include <sys/bus.h>
37#include <sys/kernel.h>
38#include <sys/lock.h>
39#include <sys/malloc.h>
40#include <sys/module.h>
41#include <sys/proc.h>

--- 679 unchanged lines hidden (view full) ---

721vmbus_synic_setup(void *xsc)
722{
723 struct vmbus_softc *sc = xsc;
724 int cpu = curcpu;
725 uint64_t val, orig;
726 uint32_t sint;
727
728 if (hyperv_features & CPUID_HV_MSR_VP_INDEX) {
34
35#include <sys/param.h>
36#include <sys/bus.h>
37#include <sys/kernel.h>
38#include <sys/lock.h>
39#include <sys/malloc.h>
40#include <sys/module.h>
41#include <sys/proc.h>

--- 679 unchanged lines hidden (view full) ---

721vmbus_synic_setup(void *xsc)
722{
723 struct vmbus_softc *sc = xsc;
724 int cpu = curcpu;
725 uint64_t val, orig;
726 uint32_t sint;
727
728 if (hyperv_features & CPUID_HV_MSR_VP_INDEX) {
729 /*
730 * Save virtual processor id.
731 */
729 /* Save virtual processor id. */
732 VMBUS_PCPU_GET(sc, vcpuid, cpu) = rdmsr(MSR_HV_VP_INDEX);
733 } else {
730 VMBUS_PCPU_GET(sc, vcpuid, cpu) = rdmsr(MSR_HV_VP_INDEX);
731 } else {
734 /*
735 * XXX
736 * Virtual processoor id is only used by a pretty broken
737 * channel selection code from storvsc. It's nothing
738 * critical even if CPUID_HV_MSR_VP_INDEX is not set; keep
739 * moving on.
740 */
741 VMBUS_PCPU_GET(sc, vcpuid, cpu) = cpu;
732 /* Set virtual processor id to 0 for compatibility. */
733 VMBUS_PCPU_GET(sc, vcpuid, cpu) = 0;
742 }
743
744 /*
745 * Setup the SynIC message.
746 */
747 orig = rdmsr(MSR_HV_SIMP);
748 val = MSR_HV_SIMP_ENABLE | (orig & MSR_HV_SIMP_RSVD_MASK) |
749 ((VMBUS_PCPU_GET(sc, message_dma.hv_paddr, cpu) >> PAGE_SHIFT) <<

--- 591 unchanged lines hidden ---
734 }
735
736 /*
737 * Setup the SynIC message.
738 */
739 orig = rdmsr(MSR_HV_SIMP);
740 val = MSR_HV_SIMP_ENABLE | (orig & MSR_HV_SIMP_RSVD_MASK) |
741 ((VMBUS_PCPU_GET(sc, message_dma.hv_paddr, cpu) >> PAGE_SHIFT) <<

--- 591 unchanged lines hidden ---