qemu/hw/i386/kvm
David Woodhouse eeedfe6c63 hw/xen: Simplify emulated Xen platform init
I initially put the basic platform init (overlay pages, grant tables,
event channels) into mc->kvm_type because that was the earliest place
that could sensibly test for xen_mode==XEN_EMULATE.

The intent was to do this early enough that we could then initialise the
XenBus and other parts which would have depended on them, from a generic
location for both Xen and KVM/Xen in the PC-specific code, as seen in
https://lore.kernel.org/qemu-devel/20230116221919.1124201-16-dwmw2@infradead.org/

However, then the Xen on Arm patches came along, and *they* wanted to
do the XenBus init from a 'generic' Xen-specific location instead:
https://lore.kernel.org/qemu-devel/20230210222729.957168-4-sstabellini@kernel.org/

Since there's no generic location that covers all three, I conceded to
do it for XEN_EMULATE mode in pc_basic_devices_init().

And now there's absolutely no point in having some of the platform init
done from pc_machine_kvm_type(); we can move it all up to live in a
single place in pc_basic_devices_init(). This has the added benefit that
we can drop the separate xen_evtchn_connect_gsis() function completely,
and pass just the system GSIs in directly to xen_evtchn_create().

While I'm at it, it does no harm to explicitly pass in the *number* of
said GSIs, because it does make me twitch a bit to pass an array of
impicit size. During the lifetime of the KVM/Xen patchset, that had
already changed (albeit just cosmetically) from GSI_NUM_PINS to
IOAPIC_NUM_PINS.

And document a bit better that this is for the *output* GSI for raising
CPU0's events when the per-CPU vector isn't available. The fact that
we create a whole set of them and then only waggle the one we're told
to, instead of having a single output and only *connecting* it to the
GSI that it should be connected to, is still non-intuitive for me.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
Message-Id: <20230412185102.441523-2-dwmw2@infradead.org>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
2023-06-07 15:07:10 +01:00
..
apic.c i386/kvm: The value passed to strerror should be positive 2021-06-05 21:01:17 +02:00
clock.c i386/kvm: The value passed to strerror should be positive 2021-06-05 21:01:17 +02:00
i8254.c hw/timer/i8254_common: Share "iobase" property via base class 2023-06-05 07:43:23 +01:00
i8259.c hw/intc: Extract the IRQ counting functions into a separate file 2023-01-13 16:22:57 +01:00
ioapic.c hw: Move ioapic*.h to intc/ 2023-02-27 22:29:01 +01:00
meson.build hw/xen: Add xenstore wire implementation and implementation stubs 2023-03-07 17:04:30 +00:00
trace-events hw/xen: Add xenstore wire implementation and implementation stubs 2023-03-07 17:04:30 +00:00
trace.h hw/xen: Implement emulated PIRQ hypercall support 2023-03-01 09:09:01 +00:00
xen_evtchn.c hw/xen: Simplify emulated Xen platform init 2023-06-07 15:07:10 +01:00
xen_evtchn.h hw/xen: Simplify emulated Xen platform init 2023-06-07 15:07:10 +01:00
xen_gnttab.c hw/xen: Implement soft reset for emulated gnttab 2023-03-07 17:04:30 +00:00
xen_gnttab.h hw/xen: Implement soft reset for emulated gnttab 2023-03-07 17:04:30 +00:00
xen_overlay.c hw/xen: Support mapping grant frames 2023-03-01 09:07:52 +00:00
xen_overlay.h hw/xen: Support mapping grant frames 2023-03-01 09:07:52 +00:00
xen_xenstore.c aio: remove aio_disable_external() API 2023-05-30 17:37:26 +02:00
xen_xenstore.h hw/xen: Add xen_xenstore device for xenstore emulation 2023-03-01 09:08:26 +00:00
xen-stubs.c hw/xen: Support MSI mapping to PIRQ 2023-03-01 09:09:22 +00:00
xenstore_impl.c hw/xen: Implement core serialize/deserialize methods for xenstore_impl 2023-03-07 17:04:30 +00:00
xenstore_impl.h hw/xen: Add xenstore operations to allow redirection to internal emulation 2023-03-07 17:04:30 +00:00