* Adding MSI support for virtio-pci to QEMU as Xen backend on ARM
@ 2023-12-08 9:59 Mykyta Poturai
2023-12-08 22:15 ` Stefano Stabellini
0 siblings, 1 reply; 3+ messages in thread
From: Mykyta Poturai @ 2023-12-08 9:59 UTC (permalink / raw)
To: qemu-devel@nongnu.org
Cc: David Woodhouse, sstabellini@kernel.org, sstabellini@kernel.org,
Julien Grall, Volodymyr Babchuk, Volodymyr Babchuk,
xen-devel@lists.xenproject.org, Vikram Garhwal,
Oleksandr Tyshchenko
Hello everyone,
I am currently working on adding MSI support to virtio-pci on ARM with Xen.
As far as I understand QEMU Xen ARM machine that is used for virtio-pci device emulation does not initialize any interrupt controllers. And that makes it somewhat unclear what is the best approach to adding the MSI support. So, I would appreciate some thoughts on this.
To trigger the MSI interrupt in Xen guests we basically need to call a single DMOP, which I am also implementing.
So far, I have come up with 3 possible approaches:
1. Hooking up the existing GIC code to the Xen Arm machine and extending it with the DMOP call.
2. Writing some new barebones GIC implementation with only the required methods (something similar to xen_apic.c).
3. Just hooking up the DMOP call to the existing PCI code based on xen_enabled() check.
Maybe there is something else that is better that I have missed.
Best regards
Mykyta
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Adding MSI support for virtio-pci to QEMU as Xen backend on ARM
2023-12-08 9:59 Adding MSI support for virtio-pci to QEMU as Xen backend on ARM Mykyta Poturai
@ 2023-12-08 22:15 ` Stefano Stabellini
2023-12-12 16:02 ` Alex Bennée
0 siblings, 1 reply; 3+ messages in thread
From: Stefano Stabellini @ 2023-12-08 22:15 UTC (permalink / raw)
To: Mykyta Poturai
Cc: qemu-devel@nongnu.org, David Woodhouse, sstabellini@kernel.org,
sstabellini@kernel.org, Julien Grall, Volodymyr Babchuk,
Volodymyr Babchuk, xen-devel@lists.xenproject.org, Vikram Garhwal,
Oleksandr Tyshchenko, stewart.hildebrand
+Stewart
On Fri, 8 Dec 2023, Mykyta Poturai wrote:
> Hello everyone,
>
> I am currently working on adding MSI support to virtio-pci on ARM with Xen.
Excellent!
> As far as I understand QEMU Xen ARM machine that is used for virtio-pci device emulation does not initialize any interrupt controllers. And that makes it somewhat unclear what is the best approach to adding the MSI support. So, I would appreciate some thoughts on this.
> To trigger the MSI interrupt in Xen guests we basically need to call a single DMOP, which I am also implementing.
You should be able to call xen_inject_msi
> So far, I have come up with 3 possible approaches:
> 1. Hooking up the existing GIC code to the Xen Arm machine and extending it with the DMOP call.
No, I would rather avoid this for a couple of reasons. In reality, the
GIC is emulated by Xen, not QEMU. So letting QEMU think that QEMU is
emulating a GIC is more error prone than the alternatives and also it
would allocate resources needlessly.
> 2. Writing some new barebones GIC implementation with only the required methods (something similar to xen_apic.c).
> 3. Just hooking up the DMOP call to the existing PCI code based on xen_enabled() check.
I would rather not introduce any more if (xen_enabled()) checks beyond
the ones we already have unless it is the only option. So I would go
with option 2). Even better if we could reuse xen_apic.c. xen_apic.c is
just a stub, which is basically the same thing that we need here.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Adding MSI support for virtio-pci to QEMU as Xen backend on ARM
2023-12-08 22:15 ` Stefano Stabellini
@ 2023-12-12 16:02 ` Alex Bennée
0 siblings, 0 replies; 3+ messages in thread
From: Alex Bennée @ 2023-12-12 16:02 UTC (permalink / raw)
To: Stefano Stabellini
Cc: Mykyta Poturai, qemu-devel@nongnu.org, David Woodhouse,
Julien Grall, Volodymyr Babchuk, xen-devel@lists.xenproject.org,
Vikram Garhwal, Oleksandr Tyshchenko, stewart.hildebrand
Stefano Stabellini <sstabellini@kernel.org> writes:
> +Stewart
>
> On Fri, 8 Dec 2023, Mykyta Poturai wrote:
>> Hello everyone,
>>
>> I am currently working on adding MSI support to virtio-pci on ARM with Xen.
>
> Excellent!
>
>
>> As far as I understand QEMU Xen ARM machine that is used for
>> virtio-pci device emulation does not initialize any interrupt
>> controllers. And that makes it somewhat unclear what is the best
>> approach to adding the MSI support. So, I would appreciate some
>> thoughts on this.
>> To trigger the MSI interrupt in Xen guests we basically need to call a single DMOP, which I am also implementing.
>
> You should be able to call xen_inject_msi
>
>
>> So far, I have come up with 3 possible approaches:
>> 1. Hooking up the existing GIC code to the Xen Arm machine and extending it with the DMOP call.
>
> No, I would rather avoid this for a couple of reasons. In reality, the
> GIC is emulated by Xen, not QEMU. So letting QEMU think that QEMU is
> emulating a GIC is more error prone than the alternatives and also it
> would allocate resources needlessly.
>
>
>> 2. Writing some new barebones GIC implementation with only the required methods (something similar to xen_apic.c).
>> 3. Just hooking up the DMOP call to the existing PCI code based on xen_enabled() check.
>
> I would rather not introduce any more if (xen_enabled()) checks beyond
> the ones we already have unless it is the only option. So I would go
> with option 2). Even better if we could reuse xen_apic.c. xen_apic.c is
> just a stub, which is basically the same thing that we need here.
I guess the APIC part of the name is part of the historical baggage of
x86 - really it's just a xenpv-irq controller?
Anyway yeah I think just move it from hw/i386/xen to hw/xen and maybe
give it a new name with an alias to the old one we can deprecate over
time?
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-12 16:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-08 9:59 Adding MSI support for virtio-pci to QEMU as Xen backend on ARM Mykyta Poturai
2023-12-08 22:15 ` Stefano Stabellini
2023-12-12 16:02 ` Alex Bennée
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).