Skip to content

Commit

Permalink
Merge tag 'hyperv-next-signed-20250123' of git://git.kernel.org/pub/s…
Browse files Browse the repository at this point in the history
…cm/linux/kernel/git/hyperv/linux

Pull hyperv updates from Wei Liu:

 - Introduce a new set of Hyper-V headers in include/hyperv and replace
   the old hyperv-tlfs.h with the new headers (Nuno Das Neves)

 - Fixes for the Hyper-V VTL mode (Roman Kisel)

 - Fixes for cpu mask usage in Hyper-V code (Michael Kelley)

 - Document the guest VM hibernation behaviour (Michael Kelley)

 - Miscellaneous fixes and cleanups (Jacob Pan, John Starks, Naman Jain)

* tag 'hyperv-next-signed-20250123' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
  Documentation: hyperv: Add overview of guest VM hibernation
  hyperv: Do not overlap the hvcall IO areas in hv_vtl_apicid_to_vp_id()
  hyperv: Do not overlap the hvcall IO areas in get_vtl()
  hyperv: Enable the hypercall output page for the VTL mode
  hv_balloon: Fallback to generic_online_page() for non-HV hot added mem
  Drivers: hv: vmbus: Log on missing offers if any
  Drivers: hv: vmbus: Wait for boot-time offers during boot and resume
  uio_hv_generic: Add a check for HV_NIC for send, receive buffers setup
  iommu/hyper-v: Don't assume cpu_possible_mask is dense
  Drivers: hv: Don't assume cpu_possible_mask is dense
  x86/hyperv: Don't assume cpu_possible_mask is dense
  hyperv: Remove the now unused hyperv-tlfs.h files
  hyperv: Switch from hyperv-tlfs.h to hyperv/hvhdk.h
  hyperv: Add new Hyper-V headers in include/hyperv
  hyperv: Clean up unnecessary #includes
  hyperv: Move hv_connection_id to hyperv-tlfs.h
  • Loading branch information
Linus Torvalds committed Jan 25, 2025
2 parents b46c89c + 2e03358 commit 382e391
Show file tree
Hide file tree
Showing 43 changed files with 3,261 additions and 1,922 deletions.
336 changes: 336 additions & 0 deletions Documentation/virt/hyperv/hibernation.rst

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Documentation/virt/hyperv/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ Hyper-V Enlightenments
vmbus
clocks
vpci
hibernation
coco
8 changes: 5 additions & 3 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -10739,10 +10739,8 @@ F: Documentation/devicetree/bindings/bus/microsoft,vmbus.yaml
F: Documentation/networking/device_drivers/ethernet/microsoft/netvsc.rst
F: Documentation/virt/hyperv
F: arch/arm64/hyperv
F: arch/arm64/include/asm/hyperv-tlfs.h
F: arch/arm64/include/asm/mshyperv.h
F: arch/x86/hyperv
F: arch/x86/include/asm/hyperv-tlfs.h
F: arch/x86/include/asm/mshyperv.h
F: arch/x86/include/asm/trace/hyperv.h
F: arch/x86/kernel/cpu/mshyperv.c
Expand All @@ -10758,9 +10756,13 @@ F: drivers/pci/controller/pci-hyperv.c
F: drivers/scsi/storvsc_drv.c
F: drivers/uio/uio_hv_generic.c
F: drivers/video/fbdev/hyperv_fb.c
F: include/asm-generic/hyperv-tlfs.h
F: include/asm-generic/mshyperv.h
F: include/clocksource/hyperv_timer.h
F: include/hyperv/hvgdk.h
F: include/hyperv/hvgdk_ext.h
F: include/hyperv/hvgdk_mini.h
F: include/hyperv/hvhdk.h
F: include/hyperv/hvhdk_mini.h
F: include/linux/hyperv.h
F: include/net/mana
F: include/uapi/linux/hyperv.h
Expand Down
3 changes: 1 addition & 2 deletions arch/arm64/hyperv/hv_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
#include <linux/types.h>
#include <linux/export.h>
#include <linux/mm.h>
#include <linux/hyperv.h>
#include <linux/arm-smccc.h>
#include <linux/module.h>
#include <asm-generic/bug.h>
#include <asm/hyperv-tlfs.h>
#include <hyperv/hvhdk.h>
#include <asm/mshyperv.h>

/*
Expand Down
4 changes: 2 additions & 2 deletions arch/arm64/hyperv/mshyperv.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ static int __init hyperv_init(void)
hv_set_vpreg(HV_REGISTER_GUEST_OS_ID, guest_id);

/* Get the features and hints from Hyper-V */
hv_get_vpreg_128(HV_REGISTER_FEATURES, &result);
hv_get_vpreg_128(HV_REGISTER_PRIVILEGES_AND_FEATURES_INFO, &result);
ms_hyperv.features = result.as32.a;
ms_hyperv.priv_high = result.as32.b;
ms_hyperv.misc_features = result.as32.c;

hv_get_vpreg_128(HV_REGISTER_ENLIGHTENMENTS, &result);
hv_get_vpreg_128(HV_REGISTER_FEATURES_INFO, &result);
ms_hyperv.hints = result.as32.a;

pr_info("Hyper-V: privilege flags low 0x%x, high 0x%x, hints 0x%x, misc 0x%x\n",
Expand Down
71 changes: 0 additions & 71 deletions arch/arm64/include/asm/hyperv-tlfs.h

This file was deleted.

7 changes: 3 additions & 4 deletions arch/arm64/include/asm/mshyperv.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
* the ARM64 architecture. See include/asm-generic/mshyperv.h for
* definitions are that architecture independent.
*
* Definitions that are specified in the Hyper-V Top Level Functional
* Spec (TLFS) should not go in this file, but should instead go in
* hyperv-tlfs.h.
* Definitions that are derived from Hyper-V code or headers should not go in
* this file, but should instead go in the relevant files in include/hyperv.
*
* Copyright (C) 2021, Microsoft, Inc.
*
Expand All @@ -20,7 +19,7 @@

#include <linux/types.h>
#include <linux/arm-smccc.h>
#include <asm/hyperv-tlfs.h>
#include <hyperv/hvhdk.h>

/*
* Declare calls to get and set Hyper-V VP register values on ARM64, which
Expand Down
1 change: 0 additions & 1 deletion arch/x86/hyperv/hv_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <linux/vmalloc.h>
#include <linux/mm.h>
#include <linux/clockchips.h>
#include <linux/hyperv.h>
#include <linux/slab.h>
#include <linux/cpuhotplug.h>
#include <asm/hypervisor.h>
Expand Down
23 changes: 11 additions & 12 deletions arch/x86/hyperv/hv_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@
#include <asm/sev.h>
#include <asm/ibt.h>
#include <asm/hypervisor.h>
#include <asm/hyperv-tlfs.h>
#include <hyperv/hvhdk.h>
#include <asm/mshyperv.h>
#include <asm/idtentry.h>
#include <asm/set_memory.h>
#include <linux/kexec.h>
#include <linux/version.h>
#include <linux/vmalloc.h>
#include <linux/mm.h>
#include <linux/hyperv.h>
#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/cpuhotplug.h>
Expand Down Expand Up @@ -416,24 +415,24 @@ static void __init hv_get_partition_id(void)
static u8 __init get_vtl(void)
{
u64 control = HV_HYPERCALL_REP_COMP_1 | HVCALL_GET_VP_REGISTERS;
struct hv_get_vp_registers_input *input;
struct hv_get_vp_registers_output *output;
struct hv_input_get_vp_registers *input;
struct hv_output_get_vp_registers *output;
unsigned long flags;
u64 ret;

local_irq_save(flags);
input = *this_cpu_ptr(hyperv_pcpu_input_arg);
output = (struct hv_get_vp_registers_output *)input;
output = *this_cpu_ptr(hyperv_pcpu_output_arg);

memset(input, 0, struct_size(input, element, 1));
input->header.partitionid = HV_PARTITION_ID_SELF;
input->header.vpindex = HV_VP_INDEX_SELF;
input->header.inputvtl = 0;
input->element[0].name0 = HV_X64_REGISTER_VSM_VP_STATUS;
memset(input, 0, struct_size(input, names, 1));
input->partition_id = HV_PARTITION_ID_SELF;
input->vp_index = HV_VP_INDEX_SELF;
input->input_vtl.as_uint8 = 0;
input->names[0] = HV_REGISTER_VSM_VP_STATUS;

ret = hv_do_hypercall(control, input, output);
if (hv_result_success(ret)) {
ret = output->as64.low & HV_X64_VTL_MASK;
ret = output->values[0].reg8 & HV_X64_VTL_MASK;
} else {
pr_err("Failed to get VTL(error: %lld) exiting...\n", ret);
BUG();
Expand Down Expand Up @@ -473,7 +472,7 @@ void __init hyperv_init(void)
if (hv_isolation_type_tdx())
hv_vp_assist_page = NULL;
else
hv_vp_assist_page = kcalloc(num_possible_cpus(),
hv_vp_assist_page = kcalloc(nr_cpu_ids,
sizeof(*hv_vp_assist_page),
GFP_KERNEL);
if (!hv_vp_assist_page) {
Expand Down
3 changes: 1 addition & 2 deletions arch/x86/hyperv/hv_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <linux/vmalloc.h>
#include <linux/mm.h>
#include <linux/clockchips.h>
#include <linux/hyperv.h>
#include <linux/slab.h>
#include <linux/cpuhotplug.h>
#include <linux/minmax.h>
Expand Down Expand Up @@ -177,7 +176,7 @@ int hv_call_create_vp(int node, u64 partition_id, u32 vp_index, u32 flags)
input->partition_id = partition_id;
input->vp_index = vp_index;
input->flags = flags;
input->subnode_type = HvSubnodeAny;
input->subnode_type = HV_SUBNODE_ANY;
input->proximity_domain_info = hv_numa_node_to_pxm_info(node);
status = hv_do_hypercall(HVCALL_CREATE_VP, input, NULL);
local_irq_restore(irq_flags);
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/hyperv/hv_vtl.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ static int hv_vtl_apicid_to_vp_id(u32 apic_id)
input->partition_id = HV_PARTITION_ID_SELF;
input->apic_ids[0] = apic_id;

output = (u32 *)input;
output = *this_cpu_ptr(hyperv_pcpu_output_arg);

control = HV_HYPERCALL_REP_COMP_1 | HVCALL_GET_VP_ID_FROM_APIC_ID;
status = hv_do_hypercall(control, input, output);
Expand Down
1 change: 0 additions & 1 deletion arch/x86/hyperv/ivm.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/

#include <linux/bitfield.h>
#include <linux/hyperv.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <asm/svm.h>
Expand Down
1 change: 0 additions & 1 deletion arch/x86/hyperv/mmu.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#define pr_fmt(fmt) "Hyper-V: " fmt

#include <linux/hyperv.h>
#include <linux/log2.h>
#include <linux/slab.h>
#include <linux/types.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/hyperv/nested.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


#include <linux/types.h>
#include <asm/hyperv-tlfs.h>
#include <hyperv/hvhdk.h>
#include <asm/mshyperv.h>
#include <asm/tlbflush.h>

Expand Down
Loading

0 comments on commit 382e391

Please sign in to comment.