From: Paolo Bonzini Date: Tue, 16 Jul 2024 13:53:05 +0000 (-0400) Subject: Merge tag 'kvm-x86-misc-6.11' of https://github.com/kvm-x86/linux into HEAD X-Git-Tag: v6.11-rc1~89^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5dcc1e76144f;p=thirdparty%2Flinux.git Merge tag 'kvm-x86-misc-6.11' of https://github.com/kvm-x86/linux into HEAD KVM x86 misc changes for 6.11 - Add a global struct to consolidate tracking of host values, e.g. EFER, and move "shadow_phys_bits" into the structure as "maxphyaddr". - Add KVM_CAP_X86_APIC_BUS_CYCLES_NS to allow configuring the effective APIC bus frequency, because TDX. - Print the name of the APICv/AVIC inhibits in the relevant tracepoint. - Clean up KVM's handling of vendor specific emulation to consistently act on "compatible with Intel/AMD", versus checking for a specific vendor. - Misc cleanups --- 5dcc1e76144fcf7bfe182bd98572d1957a380bac diff --cc arch/x86/kvm/vmx/x86_ops.h index 3cb0be94e7792,d4339525af544..6016883c85338 --- a/arch/x86/kvm/vmx/x86_ops.h +++ b/arch/x86/kvm/vmx/x86_ops.h @@@ -111,7 -110,7 +110,6 @@@ u64 vmx_get_l2_tsc_offset(struct kvm_vc u64 vmx_get_l2_tsc_multiplier(struct kvm_vcpu *vcpu); void vmx_write_tsc_offset(struct kvm_vcpu *vcpu); void vmx_write_tsc_multiplier(struct kvm_vcpu *vcpu); - void vmx_request_immediate_exit(struct kvm_vcpu *vcpu); -void vmx_sched_in(struct kvm_vcpu *vcpu, int cpu); void vmx_update_cpu_dirty_logging(struct kvm_vcpu *vcpu); #ifdef CONFIG_X86_64 int vmx_set_hv_timer(struct kvm_vcpu *vcpu, u64 guest_deadline_tsc, diff --cc arch/x86/kvm/x86.c index e8c34f8e19641,9ef5aaf6ad5c6..e90e1a74564eb --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@@ -4703,11 -4704,12 +4695,15 @@@ int kvm_vm_ioctl_check_extension(struc case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES: case KVM_CAP_IRQFD_RESAMPLE: case KVM_CAP_MEMORY_FAULT_INFO: + case KVM_CAP_X86_GUEST_MODE: r = 1; break; + case KVM_CAP_PRE_FAULT_MEMORY: + r = tdp_enabled; + break; + case KVM_CAP_X86_APIC_BUS_CYCLES_NS: + r = APIC_BUS_CYCLE_NS_DEFAULT; + break; case KVM_CAP_EXIT_HYPERCALL: r = KVM_EXIT_HYPERCALL_VALID_MASK; break; diff --cc include/uapi/linux/kvm.h index 1053e7c5eab91,a6ac00ec77adb..637efc0551453 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@@ -930,7 -917,8 +930,9 @@@ struct kvm_enable_cap #define KVM_CAP_MEMORY_ATTRIBUTES 233 #define KVM_CAP_GUEST_MEMFD 234 #define KVM_CAP_VM_TYPES 235 -#define KVM_CAP_X86_APIC_BUS_CYCLES_NS 236 -#define KVM_CAP_X86_GUEST_MODE 237 +#define KVM_CAP_PRE_FAULT_MEMORY 236 ++#define KVM_CAP_X86_APIC_BUS_CYCLES_NS 237 ++#define KVM_CAP_X86_GUEST_MODE 238 struct kvm_irq_routing_irqchip { __u32 irqchip;