Commit da46b58f authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'hyperv-next-signed-20230424' of...

Merge tag 'hyperv-next-signed-20230424' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux

Pull hyperv updates from Wei Liu:

 - PCI passthrough for Hyper-V confidential VMs (Michael Kelley)

 - Hyper-V VTL mode support (Saurabh Sengar)

 - Move panic report initialization code earlier (Long Li)

 - Various improvements and bug fixes (Dexuan Cui and Michael Kelley)

* tag 'hyperv-next-signed-20230424' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: (22 commits)
  PCI: hv: Replace retarget_msi_interrupt_params with hyperv_pcpu_input_arg
  Drivers: hv: move panic report code from vmbus to hv early init code
  x86/hyperv: VTL support for Hyper-V
  Drivers: hv: Kconfig: Add HYPERV_VTL_MODE
  x86/hyperv: Make hv_get_nmi_reason public
  x86/hyperv: Add VTL specific structs and hypercalls
  x86/init: Make get/set_rtc_noop() public
  x86/hyperv: Exclude lazy TLB mode CPUs from enlightened TLB flushes
  x86/hyperv: Add callback filter to cpumask_to_vpset()
  Drivers: hv: vmbus: Remove the per-CPU post_msg_page
  clocksource: hyper-v: make sure Invariant-TSC is used if it is available
  PCI: hv: Enable PCI pass-thru devices in Confidential VMs
  Drivers: hv: Don't remap addresses that are above shared_gpa_boundary
  hv_netvsc: Remove second mapping of send and recv buffers
  Drivers: hv: vmbus: Remove second way of mapping ring buffers
  Drivers: hv: vmbus: Remove second mapping of VMBus monitor pages
  swiotlb: Remove bounce buffer remapping for Hyper-V
  Driver: VMBus: Add Devicetree support
  dt-bindings: bus: Add Hyper-V VMBus
  Drivers: hv: vmbus: Convert acpi_device to more generic platform_device
  ...
parents 8ccd54fe a494aef2
Loading
Loading
Loading
Loading
+54 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/bus/microsoft,vmbus.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Microsoft Hyper-V VMBus

maintainers:
  - Saurabh Sengar <ssengar@linux.microsoft.com>

description:
  VMBus is a software bus that implement the protocols for communication
  between the root or host OS and guest OSs (virtual machines).

properties:
  compatible:
    const: microsoft,vmbus

  ranges: true

  '#address-cells':
    const: 2

  '#size-cells':
    const: 1

required:
  - compatible
  - ranges
  - '#address-cells'
  - '#size-cells'

additionalProperties: false

examples:
  - |
    soc {
        #address-cells = <2>;
        #size-cells = <1>;
        bus {
            compatible = "simple-bus";
            #address-cells = <2>;
            #size-cells = <1>;
            ranges;

            vmbus@ff0000000 {
                compatible = "microsoft,vmbus";
                #address-cells = <2>;
                #size-cells = <1>;
                ranges = <0x0f 0xf0000000 0x0f 0xf0000000 0x10000000>;
            };
        };
    };
+1 −0
Original line number Diff line number Diff line
@@ -9588,6 +9588,7 @@ S: Supported
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git
F:	Documentation/ABI/stable/sysfs-bus-vmbus
F:	Documentation/ABI/testing/debugfs-hyperv
F:	Documentation/devicetree/bindings/bus/microsoft,vmbus.yaml
F:	Documentation/virt/hyperv
F:	Documentation/networking/device_drivers/ethernet/microsoft/netvsc.rst
F:	arch/arm64/hyperv
+1 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
obj-y			:= hv_init.o mmu.o nested.o irqdomain.o ivm.o
obj-$(CONFIG_X86_64)	+= hv_apic.o hv_proc.o
obj-$(CONFIG_HYPERV_VTL_MODE)	+= hv_vtl.o

ifdef CONFIG_X86_64
obj-$(CONFIG_PARAVIRT_SPINLOCKS)	+= hv_spinlock.o
+8 −4
Original line number Diff line number Diff line
@@ -96,6 +96,11 @@ static void hv_apic_eoi_write(u32 reg, u32 val)
	wrmsr(HV_X64_MSR_EOI, val, 0);
}

static bool cpu_is_self(int cpu)
{
	return cpu == smp_processor_id();
}

/*
 * IPI implementation on Hyper-V.
 */
@@ -128,10 +133,9 @@ static bool __send_ipi_mask_ex(const struct cpumask *mask, int vector,
	 */
	if (!cpumask_equal(mask, cpu_present_mask) || exclude_self) {
		ipi_arg->vp_set.format = HV_GENERIC_SET_SPARSE_4K;
		if (exclude_self)
			nr_bank = cpumask_to_vpset_noself(&(ipi_arg->vp_set), mask);
		else
			nr_bank = cpumask_to_vpset(&(ipi_arg->vp_set), mask);

		nr_bank = cpumask_to_vpset_skip(&(ipi_arg->vp_set), mask,
				exclude_self ? cpu_is_self : NULL);

		/*
		 * 'nr_bank <= 0' means some CPUs in cpumask can't be
+5 −2
Original line number Diff line number Diff line
@@ -63,7 +63,10 @@ static int hyperv_init_ghcb(void)
	 * memory boundary and map it here.
	 */
	rdmsrl(MSR_AMD64_SEV_ES_GHCB, ghcb_gpa);
	ghcb_va = memremap(ghcb_gpa, HV_HYP_PAGE_SIZE, MEMREMAP_WB);

	/* Mask out vTOM bit. ioremap_cache() maps decrypted */
	ghcb_gpa &= ~ms_hyperv.shared_gpa_boundary;
	ghcb_va = (void *)ioremap_cache(ghcb_gpa, HV_HYP_PAGE_SIZE);
	if (!ghcb_va)
		return -ENOMEM;

@@ -217,7 +220,7 @@ static int hv_cpu_die(unsigned int cpu)
	if (hv_ghcb_pg) {
		ghcb_va = (void **)this_cpu_ptr(hv_ghcb_pg);
		if (*ghcb_va)
			memunmap(*ghcb_va);
			iounmap(*ghcb_va);
		*ghcb_va = NULL;
	}

Loading