• D
    KVM: x86/xen: Make kvm_xen_set_evtchn() reusable from other places · 8733068b
    David Woodhouse 提交于
    Clean it up to return -errno on error consistently, while still being
    compatible with the return conventions for kvm_arch_set_irq_inatomic()
    and the kvm_set_irq() callback.
    
    We use -ENOTCONN to indicate when the port is masked. No existing users
    care, except that it's negative.
    
    Also allow it to optimise the vCPU lookup. Unless we abuse the lapic
    map, there is no quick lookup from APIC ID to a vCPU; the logic in
    kvm_get_vcpu_by_id() will just iterate over all vCPUs till it finds
    the one it wants. So do that just once and stash the result in the
    struct kvm_xen_evtchn for next time.
    Signed-off-by: NDavid Woodhouse <dwmw@amazon.co.uk>
    Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
    Message-Id: <20220303154127.202856-8-dwmw2@infradead.org>
    Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
    8733068b
xen.c 30.2 KB