Skip to content

Commit 382e391

Browse files
committed
Merge tag 'hyperv-next-signed-20250123' of git://git.kernel.org/pub/scm/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
2 parents b46c89c + 2e03358 commit 382e391

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3261
-1922
lines changed

Documentation/virt/hyperv/hibernation.rst

Lines changed: 336 additions & 0 deletions
Large diffs are not rendered by default.

Documentation/virt/hyperv/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ Hyper-V Enlightenments
1111
vmbus
1212
clocks
1313
vpci
14+
hibernation
1415
coco

MAINTAINERS

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10739,10 +10739,8 @@ F: Documentation/devicetree/bindings/bus/microsoft,vmbus.yaml
1073910739
F: Documentation/networking/device_drivers/ethernet/microsoft/netvsc.rst
1074010740
F: Documentation/virt/hyperv
1074110741
F: arch/arm64/hyperv
10742-
F: arch/arm64/include/asm/hyperv-tlfs.h
1074310742
F: arch/arm64/include/asm/mshyperv.h
1074410743
F: arch/x86/hyperv
10745-
F: arch/x86/include/asm/hyperv-tlfs.h
1074610744
F: arch/x86/include/asm/mshyperv.h
1074710745
F: arch/x86/include/asm/trace/hyperv.h
1074810746
F: arch/x86/kernel/cpu/mshyperv.c
@@ -10758,9 +10756,13 @@ F: drivers/pci/controller/pci-hyperv.c
1075810756
F: drivers/scsi/storvsc_drv.c
1075910757
F: drivers/uio/uio_hv_generic.c
1076010758
F: drivers/video/fbdev/hyperv_fb.c
10761-
F: include/asm-generic/hyperv-tlfs.h
1076210759
F: include/asm-generic/mshyperv.h
1076310760
F: include/clocksource/hyperv_timer.h
10761+
F: include/hyperv/hvgdk.h
10762+
F: include/hyperv/hvgdk_ext.h
10763+
F: include/hyperv/hvgdk_mini.h
10764+
F: include/hyperv/hvhdk.h
10765+
F: include/hyperv/hvhdk_mini.h
1076410766
F: include/linux/hyperv.h
1076510767
F: include/net/mana
1076610768
F: include/uapi/linux/hyperv.h

arch/arm64/hyperv/hv_core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111
#include <linux/types.h>
1212
#include <linux/export.h>
1313
#include <linux/mm.h>
14-
#include <linux/hyperv.h>
1514
#include <linux/arm-smccc.h>
1615
#include <linux/module.h>
1716
#include <asm-generic/bug.h>
18-
#include <asm/hyperv-tlfs.h>
17+
#include <hyperv/hvhdk.h>
1918
#include <asm/mshyperv.h>
2019

2120
/*

arch/arm64/hyperv/mshyperv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ static int __init hyperv_init(void)
4949
hv_set_vpreg(HV_REGISTER_GUEST_OS_ID, guest_id);
5050

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

57-
hv_get_vpreg_128(HV_REGISTER_ENLIGHTENMENTS, &result);
57+
hv_get_vpreg_128(HV_REGISTER_FEATURES_INFO, &result);
5858
ms_hyperv.hints = result.as32.a;
5959

6060
pr_info("Hyper-V: privilege flags low 0x%x, high 0x%x, hints 0x%x, misc 0x%x\n",

arch/arm64/include/asm/hyperv-tlfs.h

Lines changed: 0 additions & 71 deletions
This file was deleted.

arch/arm64/include/asm/mshyperv.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
* the ARM64 architecture. See include/asm-generic/mshyperv.h for
77
* definitions are that architecture independent.
88
*
9-
* Definitions that are specified in the Hyper-V Top Level Functional
10-
* Spec (TLFS) should not go in this file, but should instead go in
11-
* hyperv-tlfs.h.
9+
* Definitions that are derived from Hyper-V code or headers should not go in
10+
* this file, but should instead go in the relevant files in include/hyperv.
1211
*
1312
* Copyright (C) 2021, Microsoft, Inc.
1413
*
@@ -20,7 +19,7 @@
2019

2120
#include <linux/types.h>
2221
#include <linux/arm-smccc.h>
23-
#include <asm/hyperv-tlfs.h>
22+
#include <hyperv/hvhdk.h>
2423

2524
/*
2625
* Declare calls to get and set Hyper-V VP register values on ARM64, which

arch/x86/hyperv/hv_apic.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <linux/vmalloc.h>
2424
#include <linux/mm.h>
2525
#include <linux/clockchips.h>
26-
#include <linux/hyperv.h>
2726
#include <linux/slab.h>
2827
#include <linux/cpuhotplug.h>
2928
#include <asm/hypervisor.h>

arch/x86/hyperv/hv_init.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@
1919
#include <asm/sev.h>
2020
#include <asm/ibt.h>
2121
#include <asm/hypervisor.h>
22-
#include <asm/hyperv-tlfs.h>
22+
#include <hyperv/hvhdk.h>
2323
#include <asm/mshyperv.h>
2424
#include <asm/idtentry.h>
2525
#include <asm/set_memory.h>
2626
#include <linux/kexec.h>
2727
#include <linux/version.h>
2828
#include <linux/vmalloc.h>
2929
#include <linux/mm.h>
30-
#include <linux/hyperv.h>
3130
#include <linux/slab.h>
3231
#include <linux/kernel.h>
3332
#include <linux/cpuhotplug.h>
@@ -416,24 +415,24 @@ static void __init hv_get_partition_id(void)
416415
static u8 __init get_vtl(void)
417416
{
418417
u64 control = HV_HYPERCALL_REP_COMP_1 | HVCALL_GET_VP_REGISTERS;
419-
struct hv_get_vp_registers_input *input;
420-
struct hv_get_vp_registers_output *output;
418+
struct hv_input_get_vp_registers *input;
419+
struct hv_output_get_vp_registers *output;
421420
unsigned long flags;
422421
u64 ret;
423422

424423
local_irq_save(flags);
425424
input = *this_cpu_ptr(hyperv_pcpu_input_arg);
426-
output = (struct hv_get_vp_registers_output *)input;
425+
output = *this_cpu_ptr(hyperv_pcpu_output_arg);
427426

428-
memset(input, 0, struct_size(input, element, 1));
429-
input->header.partitionid = HV_PARTITION_ID_SELF;
430-
input->header.vpindex = HV_VP_INDEX_SELF;
431-
input->header.inputvtl = 0;
432-
input->element[0].name0 = HV_X64_REGISTER_VSM_VP_STATUS;
427+
memset(input, 0, struct_size(input, names, 1));
428+
input->partition_id = HV_PARTITION_ID_SELF;
429+
input->vp_index = HV_VP_INDEX_SELF;
430+
input->input_vtl.as_uint8 = 0;
431+
input->names[0] = HV_REGISTER_VSM_VP_STATUS;
433432

434433
ret = hv_do_hypercall(control, input, output);
435434
if (hv_result_success(ret)) {
436-
ret = output->as64.low & HV_X64_VTL_MASK;
435+
ret = output->values[0].reg8 & HV_X64_VTL_MASK;
437436
} else {
438437
pr_err("Failed to get VTL(error: %lld) exiting...\n", ret);
439438
BUG();
@@ -473,7 +472,7 @@ void __init hyperv_init(void)
473472
if (hv_isolation_type_tdx())
474473
hv_vp_assist_page = NULL;
475474
else
476-
hv_vp_assist_page = kcalloc(num_possible_cpus(),
475+
hv_vp_assist_page = kcalloc(nr_cpu_ids,
477476
sizeof(*hv_vp_assist_page),
478477
GFP_KERNEL);
479478
if (!hv_vp_assist_page) {

arch/x86/hyperv/hv_proc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include <linux/vmalloc.h>
44
#include <linux/mm.h>
55
#include <linux/clockchips.h>
6-
#include <linux/hyperv.h>
76
#include <linux/slab.h>
87
#include <linux/cpuhotplug.h>
98
#include <linux/minmax.h>
@@ -177,7 +176,7 @@ int hv_call_create_vp(int node, u64 partition_id, u32 vp_index, u32 flags)
177176
input->partition_id = partition_id;
178177
input->vp_index = vp_index;
179178
input->flags = flags;
180-
input->subnode_type = HvSubnodeAny;
179+
input->subnode_type = HV_SUBNODE_ANY;
181180
input->proximity_domain_info = hv_numa_node_to_pxm_info(node);
182181
status = hv_do_hypercall(HVCALL_CREATE_VP, input, NULL);
183182
local_irq_restore(irq_flags);

arch/x86/hyperv/hv_vtl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static int hv_vtl_apicid_to_vp_id(u32 apic_id)
189189
input->partition_id = HV_PARTITION_ID_SELF;
190190
input->apic_ids[0] = apic_id;
191191

192-
output = (u32 *)input;
192+
output = *this_cpu_ptr(hyperv_pcpu_output_arg);
193193

194194
control = HV_HYPERCALL_REP_COMP_1 | HVCALL_GET_VP_ID_FROM_APIC_ID;
195195
status = hv_do_hypercall(control, input, output);

arch/x86/hyperv/ivm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
#include <linux/bitfield.h>
10-
#include <linux/hyperv.h>
1110
#include <linux/types.h>
1211
#include <linux/slab.h>
1312
#include <asm/svm.h>

arch/x86/hyperv/mmu.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#define pr_fmt(fmt) "Hyper-V: " fmt
22

3-
#include <linux/hyperv.h>
43
#include <linux/log2.h>
54
#include <linux/slab.h>
65
#include <linux/types.h>

arch/x86/hyperv/nested.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
#include <linux/types.h>
14-
#include <asm/hyperv-tlfs.h>
14+
#include <hyperv/hvhdk.h>
1515
#include <asm/mshyperv.h>
1616
#include <asm/tlbflush.h>
1717

0 commit comments

Comments
 (0)