tools/testing/selftests/kvm/include/x86/hyperv.h

Source file repositories/reference/linux-study-clean/tools/testing/selftests/kvm/include/x86/hyperv.h

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/kvm/include/x86/hyperv.h
Extension
.h
Size
13555 bytes
Lines
362
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

struct hv_nested_enlightenments_control {
	struct {
		__u32 directhypercall:1;
		__u32 reserved:31;
	} features;
	struct {
		__u32 reserved;
	} hypercallControls;
} __packed;

/* Define virtual processor assist page structure. */
struct hv_vp_assist_page {
	__u32 apic_assist;
	__u32 reserved1;
	__u64 vtl_control[3];
	struct hv_nested_enlightenments_control nested_control;
	__u8 enlighten_vmentry;
	__u8 reserved2[7];
	__u64 current_nested_vmcs;
} __packed;

extern struct hv_vp_assist_page *current_vp_assist;

int enable_vp_assist(u64 vp_assist_pa, void *vp_assist);

struct hyperv_test_pages {
	/* VP assist page */
	void *vp_assist_hva;
	u64 vp_assist_gpa;
	void *vp_assist;

	/* Partition assist page */
	void *partition_assist_hva;
	u64 partition_assist_gpa;
	void *partition_assist;

	/* Enlightened VMCS */
	void *enlightened_vmcs_hva;
	u64 enlightened_vmcs_gpa;
	void *enlightened_vmcs;
};

struct hyperv_test_pages *vcpu_alloc_hyperv_test_pages(struct kvm_vm *vm,
						       gva_t *p_hv_pages_gva);

/* HV_X64_MSR_TSC_INVARIANT_CONTROL bits */
#define HV_INVARIANT_TSC_EXPOSED               BIT_ULL(0)

const struct kvm_cpuid2 *kvm_get_supported_hv_cpuid(void);
const struct kvm_cpuid2 *vcpu_get_supported_hv_cpuid(struct kvm_vcpu *vcpu);
void vcpu_set_hv_cpuid(struct kvm_vcpu *vcpu);

bool kvm_hv_cpu_has(struct kvm_x86_cpu_feature feature);

#endif /* !SELFTEST_KVM_HYPERV_H */

Annotation

Implementation Notes