Re: [PATCH][for stable/linux-5.15.y] KVM: VMX: Move preemption timer <=> hrtimer dance to common x86

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On 3/29/23 17:17, Tudor Ambarus wrote:
From: Sean Christopherson<seanjc@xxxxxxxxxx>

commit 98c25ead5eda5e9d41abe57839ad3e8caf19500c upstream.

Handle the switch to/from the hypervisor/software timer when a vCPU is
blocking in common x86 instead of in VMX.  Even though VMX is the only
user of a hypervisor timer, the logic and all functions involved are
generic x86 (unless future CPUs do something completely different and
implement a hypervisor timer that runs regardless of mode).

Handling the switch in common x86 will allow for the elimination of the
pre/post_blocks hooks, and also lets KVM switch back to the hypervisor
timer if and only if it was in use (without additional params).  Add a
comment explaining why the switch cannot be deferred to kvm_sched_out()
or kvm_vcpu_block().

Signed-off-by: Sean Christopherson<seanjc@xxxxxxxxxx>
Reviewed-by: Maxim Levitsky<mlevitsk@xxxxxxxxxx>
Signed-off-by: Paolo Bonzini<pbonzini@xxxxxxxxxx>
[ta: Fix conflicts in vmx_pre_block and vmx_post_block as per Paolo's
suggestion. Add Reported-by and Link tags.]
Tested-by: Tudor Ambarus<tudor.ambarus@xxxxxxxxxx>
Signed-off-by: Tudor Ambarus<tudor.ambarus@xxxxxxxxxx>

Acked-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>

[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux