* [Qemu-devel] Question about qtest and IOMMU
@ 2016-06-29 6:32 Peter Xu
2016-06-29 6:36 ` Jan Kiszka
0 siblings, 1 reply; 4+ messages in thread
From: Peter Xu @ 2016-06-29 6:32 UTC (permalink / raw)
To: QEMU Devel Mailing List
Cc: Paolo Bonzini, Michael S. Tsirkin, Jan Kiszka, Peter Maydell,
Peter Xu, John Snow
Hi, all,
I am thinking about whether it's possible to write up a unit test
program for emulated IOMMUs (of course, Intel IOMMU would be the first
one). This can provide us the chance to do quick functional regression
tests for IOMMU just like other devices, as well as customized test
sequences which is hard to do in real guests (e.g., specific cache
invalidations, error injections), etc..
I see that current qtest framework cannot support well on testing
IOMMUs. For DMA remapping, things would be quite smooth. The problem
is that, we still do not have a complete test framework on the
interrupts. E.g., currently qtest is still an acceleration type, in
which we have no vCPUs, as well as interrupt chips like APICs (please
correct me if I am wrong). It's even further if we want to test
something like kernel irqchips with QEMU. Not sure whether it's
possible to do test based on a much realistic VM (e.g., with KVM
enabled, but just keep the CPUs stall?).
I'd say that IOMMU is still experimental, and there are only limited
number of patches for it (so maybe we do not need a unit test at all).
Just want to post this idea out, to see:
- Whether we need a IOMMU unit test after all?
- Whether there is other potential consumer who has similar needs to
IOMMU, so that we can see whether try to move qtest a step further
if there are common requirements.
Thanks.
-- peterx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] Question about qtest and IOMMU
2016-06-29 6:32 [Qemu-devel] Question about qtest and IOMMU Peter Xu
@ 2016-06-29 6:36 ` Jan Kiszka
2016-06-29 7:08 ` Paolo Bonzini
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2016-06-29 6:36 UTC (permalink / raw)
To: Peter Xu, QEMU Devel Mailing List
Cc: Paolo Bonzini, Michael S. Tsirkin, Peter Maydell, John Snow,
David kiarie, Valentine Sinitsyn
[-- Attachment #1: Type: text/plain, Size: 1708 bytes --]
On 2016-06-29 08:32, Peter Xu wrote:
> Hi, all,
>
> I am thinking about whether it's possible to write up a unit test
> program for emulated IOMMUs (of course, Intel IOMMU would be the first
> one). This can provide us the chance to do quick functional regression
> tests for IOMMU just like other devices, as well as customized test
> sequences which is hard to do in real guests (e.g., specific cache
> invalidations, error injections), etc..
>
> I see that current qtest framework cannot support well on testing
> IOMMUs. For DMA remapping, things would be quite smooth. The problem
> is that, we still do not have a complete test framework on the
> interrupts. E.g., currently qtest is still an acceleration type, in
> which we have no vCPUs, as well as interrupt chips like APICs (please
> correct me if I am wrong). It's even further if we want to test
> something like kernel irqchips with QEMU. Not sure whether it's
> possible to do test based on a much realistic VM (e.g., with KVM
> enabled, but just keep the CPUs stall?).
>
> I'd say that IOMMU is still experimental, and there are only limited
> number of patches for it (so maybe we do not need a unit test at all).
> Just want to post this idea out, to see:
>
> - Whether we need a IOMMU unit test after all?
>
> - Whether there is other potential consumer who has similar needs to
> IOMMU, so that we can see whether try to move qtest a step further
> if there are common requirements.
>
Adding David and Valentine as we were discussing this need in the
context of the AMD IOMMU as well: You cannot test errors with workload
(like Linux) that do not trigger them in normal conditions.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] Question about qtest and IOMMU
2016-06-29 6:36 ` Jan Kiszka
@ 2016-06-29 7:08 ` Paolo Bonzini
2016-06-29 7:44 ` Peter Xu
0 siblings, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2016-06-29 7:08 UTC (permalink / raw)
To: Jan Kiszka, Peter Xu, QEMU Devel Mailing List
Cc: Peter Maydell, Michael S. Tsirkin, Valentine Sinitsyn,
David kiarie, John Snow
On 29/06/2016 08:36, Jan Kiszka wrote:
> On 2016-06-29 08:32, Peter Xu wrote:
>> Hi, all,
>>
>> I am thinking about whether it's possible to write up a unit test
>> program for emulated IOMMUs (of course, Intel IOMMU would be the first
>> one). This can provide us the chance to do quick functional regression
>> tests for IOMMU just like other devices, as well as customized test
>> sequences which is hard to do in real guests (e.g., specific cache
>> invalidations, error injections), etc..
>>
>> I see that current qtest framework cannot support well on testing
>> IOMMUs. For DMA remapping, things would be quite smooth. The problem
>> is that, we still do not have a complete test framework on the
>> interrupts. E.g., currently qtest is still an acceleration type, in
>> which we have no vCPUs, as well as interrupt chips like APICs (please
>> correct me if I am wrong).
qtest does have VCPUs, they just run a dummy loop. You do have an APIC
too, but reading it doesn't work because cpu_get_current_apic() returns
NULL.
You can use kvm-unit-tests if qtest is not flexible enough. It's
probably the simplest thing to do if you also want to test kernel LAPIC
and split irqchip operation.
Paolo
>> It's even further if we want to test
>> something like kernel irqchips with QEMU. Not sure whether it's
>> possible to do test based on a much realistic VM (e.g., with KVM
>> enabled, but just keep the CPUs stall?).
>
> Adding David and Valentine as we were discussing this need in the
> context of the AMD IOMMU as well: You cannot test errors with workload
> (like Linux) that do not trigger them in normal conditions.
Paolo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] Question about qtest and IOMMU
2016-06-29 7:08 ` Paolo Bonzini
@ 2016-06-29 7:44 ` Peter Xu
0 siblings, 0 replies; 4+ messages in thread
From: Peter Xu @ 2016-06-29 7:44 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Jan Kiszka, QEMU Devel Mailing List, Peter Maydell,
Michael S. Tsirkin, Valentine Sinitsyn, David kiarie, John Snow
On Wed, Jun 29, 2016 at 09:08:29AM +0200, Paolo Bonzini wrote:
>
>
> On 29/06/2016 08:36, Jan Kiszka wrote:
> > On 2016-06-29 08:32, Peter Xu wrote:
> >> Hi, all,
> >>
> >> I am thinking about whether it's possible to write up a unit test
> >> program for emulated IOMMUs (of course, Intel IOMMU would be the first
> >> one). This can provide us the chance to do quick functional regression
> >> tests for IOMMU just like other devices, as well as customized test
> >> sequences which is hard to do in real guests (e.g., specific cache
> >> invalidations, error injections), etc..
> >>
> >> I see that current qtest framework cannot support well on testing
> >> IOMMUs. For DMA remapping, things would be quite smooth. The problem
> >> is that, we still do not have a complete test framework on the
> >> interrupts. E.g., currently qtest is still an acceleration type, in
> >> which we have no vCPUs, as well as interrupt chips like APICs (please
> >> correct me if I am wrong).
>
> qtest does have VCPUs, they just run a dummy loop. You do have an APIC
> too, but reading it doesn't work because cpu_get_current_apic() returns
> NULL.
Right, thanks to point out.
>
> You can use kvm-unit-tests if qtest is not flexible enough. It's
> probably the simplest thing to do if you also want to test kernel LAPIC
> and split irqchip operation.
Will have a look. Thanks Paolo. :)
-- peterx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-06-29 7:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-29 6:32 [Qemu-devel] Question about qtest and IOMMU Peter Xu
2016-06-29 6:36 ` Jan Kiszka
2016-06-29 7:08 ` Paolo Bonzini
2016-06-29 7:44 ` Peter Xu
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).