On Thu, Jul 02, 2026 at 10:51:35AM +0200, Paolo Bonzini wrote:

> What are the additional fields that aren't covered (i.e. cannot be copied
> from hv_lapic_state to the struct and back) by the common APIC state?
>

that would be those:

    uint32_t apic_version;
    uint32_t apic_lvt_lint0;
    uint32_t apic_lvt_lint1;
    uint32_t apic_lvt_cmci;
    uint32_t apic_error_status;
    uint32_t apic_counter_value;
    uint32_t apic_remote_read;

Reference struct is this: hv_local_interrupt_controller_state

https://gitlab.com/qemu/qemu/-/blob/master/include/hw/hyperv/hvgdk_mini.h

Notably we have to do this for lvt_lint0+1. We cannot use the respective
fields in the common APIC state, because writing to those has a side effect
in QEMU: If unmasked, it will trigger a chain of events,

pic_irq_request() => apic_accept_pic_intr() => apic_deliver_pic_intr()

For MSHV (and WHPX afaiu) we're currently not able to trigger legacy
interrupts from userspace in this fashion. Hence we roundtrip
lint0/lint1 in a dedicated mshv struct.

best,

magnus

Reply via email to