On Mon, 2025-05-19 at 16:28 -0700, Sean Christopherson wrote: > Don't bother clearing the PIT's IRQ line status when destroying the PIT, > as userspace can't possibly rely on KVM to lower the IRQ line in any sane > use case, and it's not at all obvious that clearing the PIT's IRQ line is > correct/desirable in kvm_create_pit()'s error path. > > When called from kvm_arch_pre_destroy_vm(), the entire VM is being torn > down and thus {kvm_pic,kvm_ioapic}.irq_states are unreachable. > > As for the error path in kvm_create_pit(), the only way the PIT's bit in > irq_states can be set is if userspace raises the associated IRQ before > KVM_CREATE_PIT{2} completes. Forcefully clearing the bit would clobber's ^ clobber > userspace's input, nonsensical though that input may be. Not to mention > that no known VMM will continue on if PIT creation fails.