/* * The #defines related to the synthetic debugger are required by KDNet, but * they are not documented in the Hyper-V TLFS because the synthetic debugger * functionality has been deprecated and is subject to removal in future * versions of Windows.
*/ #define HYPERV_CPUID_SYNDBG_VENDOR_AND_MAX_FUNCTIONS 0x40000080 #define HYPERV_CPUID_SYNDBG_INTERFACE 0x40000081 #define HYPERV_CPUID_SYNDBG_PLATFORM_CAPABILITIES 0x40000082
/* * Hyper-V synthetic debugger platform capabilities * These are HYPERV_CPUID_SYNDBG_PLATFORM_CAPABILITIES.EAX bits.
*/ #define HV_X64_SYNDBG_CAP_ALLOW_KERNEL_DEBUGGING BIT(1)
/* * With HV_ACCESS_TSC_INVARIANT feature, invariant TSC (CPUID.80000007H:EDX[8]) * is only observed after HV_X64_MSR_TSC_INVARIANT_CONTROL was written to.
*/ staticinlinebool kvm_hv_invtsc_suppressed(struct kvm_vcpu *vcpu)
{ struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu);
/* * If Hyper-V's invariant TSC control is not exposed to the guest, * the invariant TSC CPUID flag is not suppressed, Windows guests were * observed to be able to handle it correctly. Going forward, VMMs are * encouraged to enable Hyper-V's invariant TSC control when invariant * TSC CPUID flag is set to make KVM's behavior match genuine Hyper-V.
*/ if (!hv_vcpu ||
!(hv_vcpu->cpuid_cache.features_eax & HV_ACCESS_TSC_INVARIANT)) returnfalse;
/* * If Hyper-V's invariant TSC control is exposed to the guest, KVM is * responsible for suppressing the invariant TSC CPUID flag if the * Hyper-V control is not enabled.
*/ return !(to_kvm_hv(vcpu->kvm)->hv_invtsc_control & HV_EXPOSE_INVARIANT_TSC);
}
staticinlineint kvm_hv_verify_vp_assist(struct kvm_vcpu *vcpu)
{ if (!to_hv_vcpu(vcpu)) return 0;
if (!kvm_hv_assist_page_enabled(vcpu)) return 0;
return kvm_hv_get_assist_page(vcpu);
}
staticinlinevoid kvm_hv_nested_transtion_tlb_flush(struct kvm_vcpu *vcpu, bool tdp_enabled)
{ /* * KVM_REQ_HV_TLB_FLUSH flushes entries from either L1's VP_ID or * L2's VP_ID upon request from the guest. Make sure we check for * pending entries in the right FIFO upon L1/L2 transition as these * requests are put by other vCPUs asynchronously.
*/ if (to_hv_vcpu(vcpu) && tdp_enabled)
kvm_make_request(KVM_REQ_HV_TLB_FLUSH, vcpu);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.