hyperv: Switch from hyperv-tlfs.h to hyperv/hvhdk.h
JIRA: https://issues.redhat.com/browse/RHEL-80096 commit ef5a3c92a81a1a892ae9edf949625beb68b4bd43 Author: Nuno Das Neves <nunodasneves@linux.microsoft.com> Date: Mon Nov 25 15:24:43 2024 -0800 hyperv: Switch from hyperv-tlfs.h to hyperv/hvhdk.h Switch to using hvhdk.h everywhere in the kernel. This header includes all the new Hyper-V headers in include/hyperv, which form a superset of the definitions found in hyperv-tlfs.h. This makes it easier to add new Hyper-V interfaces without being restricted to those in the TLFS doc (reflected in hyperv-tlfs.h). To be more consistent with the original Hyper-V code, the names of some definitions are changed slightly. Update those where needed. Update comments in mshyperv.h files to point to include/hyperv for adding new definitions. Signed-off-by: Nuno Das Neves <nunodasneves@linux.microsoft.com> Reviewed-by: Michael Kelley <mhklinux@outlook.com> Reviewed-by: Easwar Hariharan <eahariha@linux.microsoft.com> Signed-off-by: Roman Kisel <romank@linux.microsoft.com> Reviewed-by: Easwar Hariharan <eahariha@linux.microsoft.com> Link: https://lore.kernel.org/r/1732577084-2122-5-git-send-email-nunodasneves@linux.microsoft.com Link: https://lore.kernel.org/r/20250108222138.1623703-3-romank@linux.microsoft.com Signed-off-by: Wei Liu <wei.liu@kernel.org> Conflicts: apply the same treatment to fcopy driver which is not removed in RHEL9 Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
This commit is contained in:
parent
b001e684f7
commit
b54733d583
|
@ -14,7 +14,7 @@
|
||||||
#include <linux/arm-smccc.h>
|
#include <linux/arm-smccc.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <asm-generic/bug.h>
|
#include <asm-generic/bug.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
#include <asm/mshyperv.h>
|
#include <asm/mshyperv.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -49,12 +49,12 @@ static int __init hyperv_init(void)
|
||||||
hv_set_vpreg(HV_REGISTER_GUEST_OS_ID, guest_id);
|
hv_set_vpreg(HV_REGISTER_GUEST_OS_ID, guest_id);
|
||||||
|
|
||||||
/* Get the features and hints from Hyper-V */
|
/* 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.features = result.as32.a;
|
||||||
ms_hyperv.priv_high = result.as32.b;
|
ms_hyperv.priv_high = result.as32.b;
|
||||||
ms_hyperv.misc_features = result.as32.c;
|
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;
|
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",
|
pr_info("Hyper-V: privilege flags low 0x%x, high 0x%x, hints 0x%x, misc 0x%x\n",
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* the ARM64 architecture. See include/asm-generic/mshyperv.h for
|
* the ARM64 architecture. See include/asm-generic/mshyperv.h for
|
||||||
* definitions are that architecture independent.
|
* definitions are that architecture independent.
|
||||||
*
|
*
|
||||||
* Definitions that are specified in the Hyper-V Top Level Functional
|
* Definitions that are derived from Hyper-V code or headers should not go in
|
||||||
* Spec (TLFS) should not go in this file, but should instead go in
|
* this file, but should instead go in the relevant files in include/hyperv.
|
||||||
* hyperv-tlfs.h.
|
|
||||||
*
|
*
|
||||||
* Copyright (C) 2021, Microsoft, Inc.
|
* Copyright (C) 2021, Microsoft, Inc.
|
||||||
*
|
*
|
||||||
|
@ -20,7 +19,7 @@
|
||||||
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/arm-smccc.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
|
* Declare calls to get and set Hyper-V VP register values on ARM64, which
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include <asm/sev.h>
|
#include <asm/sev.h>
|
||||||
#include <asm/ibt.h>
|
#include <asm/ibt.h>
|
||||||
#include <asm/hypervisor.h>
|
#include <asm/hypervisor.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
#include <asm/mshyperv.h>
|
#include <asm/mshyperv.h>
|
||||||
#include <asm/idtentry.h>
|
#include <asm/idtentry.h>
|
||||||
#include <asm/set_memory.h>
|
#include <asm/set_memory.h>
|
||||||
|
@ -415,24 +415,24 @@ static void __init hv_get_partition_id(void)
|
||||||
static u8 __init get_vtl(void)
|
static u8 __init get_vtl(void)
|
||||||
{
|
{
|
||||||
u64 control = HV_HYPERCALL_REP_COMP_1 | HVCALL_GET_VP_REGISTERS;
|
u64 control = HV_HYPERCALL_REP_COMP_1 | HVCALL_GET_VP_REGISTERS;
|
||||||
struct hv_get_vp_registers_input *input;
|
struct hv_input_get_vp_registers *input;
|
||||||
struct hv_get_vp_registers_output *output;
|
struct hv_output_get_vp_registers *output;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
u64 ret;
|
u64 ret;
|
||||||
|
|
||||||
local_irq_save(flags);
|
local_irq_save(flags);
|
||||||
input = *this_cpu_ptr(hyperv_pcpu_input_arg);
|
input = *this_cpu_ptr(hyperv_pcpu_input_arg);
|
||||||
output = (struct hv_get_vp_registers_output *)input;
|
output = (struct hv_output_get_vp_registers *)input;
|
||||||
|
|
||||||
memset(input, 0, struct_size(input, element, 1));
|
memset(input, 0, struct_size(input, names, 1));
|
||||||
input->header.partitionid = HV_PARTITION_ID_SELF;
|
input->partition_id = HV_PARTITION_ID_SELF;
|
||||||
input->header.vpindex = HV_VP_INDEX_SELF;
|
input->vp_index = HV_VP_INDEX_SELF;
|
||||||
input->header.inputvtl = 0;
|
input->input_vtl.as_uint8 = 0;
|
||||||
input->element[0].name0 = HV_X64_REGISTER_VSM_VP_STATUS;
|
input->names[0] = HV_REGISTER_VSM_VP_STATUS;
|
||||||
|
|
||||||
ret = hv_do_hypercall(control, input, output);
|
ret = hv_do_hypercall(control, input, output);
|
||||||
if (hv_result_success(ret)) {
|
if (hv_result_success(ret)) {
|
||||||
ret = output->as64.low & HV_X64_VTL_MASK;
|
ret = output->values[0].reg8 & HV_X64_VTL_MASK;
|
||||||
} else {
|
} else {
|
||||||
pr_err("Failed to get VTL(error: %lld) exiting...\n", ret);
|
pr_err("Failed to get VTL(error: %lld) exiting...\n", ret);
|
||||||
BUG();
|
BUG();
|
||||||
|
|
|
@ -176,7 +176,7 @@ int hv_call_create_vp(int node, u64 partition_id, u32 vp_index, u32 flags)
|
||||||
input->partition_id = partition_id;
|
input->partition_id = partition_id;
|
||||||
input->vp_index = vp_index;
|
input->vp_index = vp_index;
|
||||||
input->flags = flags;
|
input->flags = flags;
|
||||||
input->subnode_type = HvSubnodeAny;
|
input->subnode_type = HV_SUBNODE_ANY;
|
||||||
input->proximity_domain_info = hv_numa_node_to_pxm_info(node);
|
input->proximity_domain_info = hv_numa_node_to_pxm_info(node);
|
||||||
status = hv_do_hypercall(HVCALL_CREATE_VP, input, NULL);
|
status = hv_do_hypercall(HVCALL_CREATE_VP, input, NULL);
|
||||||
local_irq_restore(irq_flags);
|
local_irq_restore(irq_flags);
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
#include <asm/mshyperv.h>
|
#include <asm/mshyperv.h>
|
||||||
#include <asm/tlbflush.h>
|
#include <asm/tlbflush.h>
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
#include <asm/asm.h>
|
#include <asm/asm.h>
|
||||||
#include <asm/kvm_page_track.h>
|
#include <asm/kvm_page_track.h>
|
||||||
#include <asm/kvm_vcpu_regs.h>
|
#include <asm/kvm_vcpu_regs.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
|
||||||
#include <asm/reboot.h>
|
#include <asm/reboot.h>
|
||||||
|
#include <hyperv/hvhdk.h>
|
||||||
|
|
||||||
#define __KVM_HAVE_ARCH_VCPU_DEBUGFS
|
#define __KVM_HAVE_ARCH_VCPU_DEBUGFS
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
#include <linux/nmi.h>
|
#include <linux/nmi.h>
|
||||||
#include <linux/msi.h>
|
#include <linux/msi.h>
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
|
||||||
#include <asm/nospec-branch.h>
|
#include <asm/nospec-branch.h>
|
||||||
#include <asm/paravirt.h>
|
#include <asm/paravirt.h>
|
||||||
|
#include <hyperv/hvhdk.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Hyper-V always provides a single IO-APIC at this MMIO address.
|
* Hyper-V always provides a single IO-APIC at this MMIO address.
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <uapi/asm/svm.h>
|
#include <uapi/asm/svm.h>
|
||||||
#include <uapi/asm/kvm.h>
|
#include <uapi/asm/kvm.h>
|
||||||
|
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 32-bit intercept words in the VMCB Control Area, starting
|
* 32-bit intercept words in the VMCB Control Area, starting
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include <linux/random.h>
|
#include <linux/random.h>
|
||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
#include <asm/hypervisor.h>
|
#include <asm/hypervisor.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
#include <asm/mshyperv.h>
|
#include <asm/mshyperv.h>
|
||||||
#include <asm/desc.h>
|
#include <asm/desc.h>
|
||||||
#include <asm/idtentry.h>
|
#include <asm/idtentry.h>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#ifndef __KVM_X86_VMX_HYPERV_EVMCS_H
|
#ifndef __KVM_X86_VMX_HYPERV_EVMCS_H
|
||||||
#define __KVM_X86_VMX_HYPERV_EVMCS_H
|
#define __KVM_X86_VMX_HYPERV_EVMCS_H
|
||||||
|
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
|
|
||||||
#include "capabilities.h"
|
#include "capabilities.h"
|
||||||
#include "vmcs12.h"
|
#include "vmcs12.h"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#ifndef __ARCH_X86_KVM_VMX_ONHYPERV_H__
|
#ifndef __ARCH_X86_KVM_VMX_ONHYPERV_H__
|
||||||
#define __ARCH_X86_KVM_VMX_ONHYPERV_H__
|
#define __ARCH_X86_KVM_VMX_ONHYPERV_H__
|
||||||
|
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
#include <asm/mshyperv.h>
|
#include <asm/mshyperv.h>
|
||||||
|
|
||||||
#include <linux/jump_label.h>
|
#include <linux/jump_label.h>
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <linux/acpi.h>
|
#include <linux/acpi.h>
|
||||||
#include <linux/hyperv.h>
|
#include <linux/hyperv.h>
|
||||||
#include <clocksource/hyperv_timer.h>
|
#include <clocksource/hyperv_timer.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
#include <asm/mshyperv.h>
|
#include <asm/mshyperv.h>
|
||||||
|
|
||||||
static struct clock_event_device __percpu *hv_clock_event;
|
static struct clock_event_device __percpu *hv_clock_event;
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include <linux/sizes.h>
|
#include <linux/sizes.h>
|
||||||
|
|
||||||
#include <linux/hyperv.h>
|
#include <linux/hyperv.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
|
|
||||||
#include <asm/mshyperv.h>
|
#include <asm/mshyperv.h>
|
||||||
|
|
||||||
|
@ -1586,7 +1586,7 @@ static int hv_free_page_report(struct page_reporting_dev_info *pr_dev_info,
|
||||||
return -ENOSPC;
|
return -ENOSPC;
|
||||||
}
|
}
|
||||||
|
|
||||||
hint->type = HV_EXT_MEMORY_HEAT_HINT_TYPE_COLD_DISCARD;
|
hint->heat_type = HV_EXTMEM_HEAT_HINT_COLD_DISCARD;
|
||||||
hint->reserved = 0;
|
hint->reserved = 0;
|
||||||
for_each_sg(sgl, sg, nents, i) {
|
for_each_sg(sgl, sg, nents, i) {
|
||||||
union hv_gpa_page_range *range;
|
union hv_gpa_page_range *range;
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/dma-map-ops.h>
|
#include <linux/dma-map-ops.h>
|
||||||
#include <linux/set_memory.h>
|
#include <linux/set_memory.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
#include <asm/mshyperv.h>
|
#include <asm/mshyperv.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include <linux/workqueue.h>
|
#include <linux/workqueue.h>
|
||||||
#include <linux/hyperv.h>
|
#include <linux/hyperv.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
|
|
||||||
#include "hyperv_vmbus.h"
|
#include "hyperv_vmbus.h"
|
||||||
#include "hv_utils_transport.h"
|
#include "hv_utils_transport.h"
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include <linux/connector.h>
|
#include <linux/connector.h>
|
||||||
#include <linux/workqueue.h>
|
#include <linux/workqueue.h>
|
||||||
#include <linux/hyperv.h>
|
#include <linux/hyperv.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
|
|
||||||
#include "hyperv_vmbus.h"
|
#include "hyperv_vmbus.h"
|
||||||
#include "hv_utils_transport.h"
|
#include "hv_utils_transport.h"
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <linux/connector.h>
|
#include <linux/connector.h>
|
||||||
#include <linux/workqueue.h>
|
#include <linux/workqueue.h>
|
||||||
#include <linux/hyperv.h>
|
#include <linux/hyperv.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
|
|
||||||
#include "hyperv_vmbus.h"
|
#include "hyperv_vmbus.h"
|
||||||
#include "hv_utils_transport.h"
|
#include "hv_utils_transport.h"
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
|
|
||||||
#include <linux/list.h>
|
#include <linux/list.h>
|
||||||
#include <asm/sync_bitops.h>
|
#include <asm/sync_bitops.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
|
||||||
#include <linux/atomic.h>
|
#include <linux/atomic.h>
|
||||||
#include <linux/hyperv.h>
|
#include <linux/hyperv.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
|
#include <hyperv/hvhdk.h>
|
||||||
|
|
||||||
#include "hv_trace.h"
|
#include "hv_trace.h"
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
* independent. See arch/<arch>/include/asm/mshyperv.h for definitions
|
* independent. See arch/<arch>/include/asm/mshyperv.h for definitions
|
||||||
* that are specific to architecture <arch>.
|
* that are specific to architecture <arch>.
|
||||||
*
|
*
|
||||||
* Definitions that are specified in the Hyper-V Top Level Functional
|
* Definitions that are derived from Hyper-V code or headers should not go in
|
||||||
* Spec (TLFS) should not go in this file, but should instead go in
|
* this file, but should instead go in the relevant files in include/hyperv.
|
||||||
* hyperv-tlfs.h.
|
|
||||||
*
|
*
|
||||||
* Copyright (C) 2019, Microsoft, Inc.
|
* Copyright (C) 2019, Microsoft, Inc.
|
||||||
*
|
*
|
||||||
|
@ -25,7 +24,7 @@
|
||||||
#include <linux/cpumask.h>
|
#include <linux/cpumask.h>
|
||||||
#include <linux/nmi.h>
|
#include <linux/nmi.h>
|
||||||
#include <asm/ptrace.h>
|
#include <asm/ptrace.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
|
|
||||||
#define VTPM_BASE_ADDRESS 0xfed40000
|
#define VTPM_BASE_ADDRESS 0xfed40000
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
#include <linux/clocksource.h>
|
#include <linux/clocksource.h>
|
||||||
#include <linux/math64.h>
|
#include <linux/math64.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
|
|
||||||
#define HV_MAX_MAX_DELTA_TICKS 0xffffffff
|
#define HV_MAX_MAX_DELTA_TICKS 0xffffffff
|
||||||
#define HV_MIN_DELTA_TICKS 1
|
#define HV_MIN_DELTA_TICKS 1
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <linux/mod_devicetable.h>
|
#include <linux/mod_devicetable.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/reciprocal_div.h>
|
#include <linux/reciprocal_div.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
|
|
||||||
#define MAX_PAGE_BUFFER_COUNT 32
|
#define MAX_PAGE_BUFFER_COUNT 32
|
||||||
#define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */
|
#define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */
|
||||||
|
|
|
@ -13,12 +13,12 @@
|
||||||
#include <linux/hyperv.h>
|
#include <linux/hyperv.h>
|
||||||
#include <net/sock.h>
|
#include <net/sock.h>
|
||||||
#include <net/af_vsock.h>
|
#include <net/af_vsock.h>
|
||||||
#include <asm/hyperv-tlfs.h>
|
#include <hyperv/hvhdk.h>
|
||||||
|
|
||||||
/* Older (VMBUS version 'VERSION_WIN10' or before) Windows hosts have some
|
/* Older (VMBUS version 'VERSION_WIN10' or before) Windows hosts have some
|
||||||
* stricter requirements on the hv_sock ring buffer size of six 4K pages.
|
* stricter requirements on the hv_sock ring buffer size of six 4K pages.
|
||||||
* hyperv-tlfs defines HV_HYP_PAGE_SIZE as 4K. Newer hosts don't have this
|
* HV_HYP_PAGE_SIZE is defined as 4K. Newer hosts don't have this limitation;
|
||||||
* limitation; but, keep the defaults the same for compat.
|
* but, keep the defaults the same for compat.
|
||||||
*/
|
*/
|
||||||
#define RINGBUFFER_HVS_RCV_SIZE (HV_HYP_PAGE_SIZE * 6)
|
#define RINGBUFFER_HVS_RCV_SIZE (HV_HYP_PAGE_SIZE * 6)
|
||||||
#define RINGBUFFER_HVS_SND_SIZE (HV_HYP_PAGE_SIZE * 6)
|
#define RINGBUFFER_HVS_SND_SIZE (HV_HYP_PAGE_SIZE * 6)
|
||||||
|
|
Loading…
Reference in New Issue