]> www.infradead.org Git - users/dwmw2/qemu.git/commit
hw/xen: Clean up event channel 'type_val' handling to use union
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 2 Aug 2023 16:04:49 +0000 (17:04 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 25 Oct 2023 11:45:22 +0000 (12:45 +0100)
commit9846ff1c9aef223a1adf926313566e74ecc78f30
tree7b088f7ce3d8cf133b4c1ccd9049f32f98e94e51
parentd0739c59f931edcb2924bdb89b219b90e7fc44e8
hw/xen: Clean up event channel 'type_val' handling to use union

A previous implementation of this stuff used a 64-bit field for all of
the port information (vcpu/type/type_val) and did atomic exchanges on
them. When I implemented that in Qemu I regretted my life choices and
just kept it simple with locking instead.

So there's no need for the XenEvtchnPort to be so simplistic. We can
use a union for the pirq/virq/interdomain information, which lets us
keep a separate bit for the 'remote domain' in interdomain ports. A
single bit is enough since the only possible targets are loopback or
qemu itself.

So now we can ditch PORT_INFO_TYPEVAL_REMOTE_QEMU and the horrid
manual masking, although the in-memory representation is identical
so there's no change in the saved state ABI.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
hw/i386/kvm/xen_evtchn.c