qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Nicholas Piggin" <npiggin@gmail.com>
To: "Fabiano Rosas" <farosas@suse.de>, <qemu-ppc@nongnu.org>
Cc: "Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Coiby Xu" <Coiby.Xu@gmail.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Emanuele Giuseppe Esposito" <e.emanuelegiuseppe@gmail.com>,
	<qemu-devel@nongnu.org>, <qemu-block@nongnu.org>
Subject: Re: [RFC PATCH 2/2] tests/qtest: Enable spapr dma with linear iommu map
Date: Wed, 16 Apr 2025 12:06:12 +1000	[thread overview]
Message-ID: <D97P1WO754K9.160CCPB9PO1FH@gmail.com> (raw)
In-Reply-To: <87ikn5fgd8.fsf@suse.de>

On Wed Apr 16, 2025 at 4:07 AM AEST, Fabiano Rosas wrote:
> Nicholas Piggin <npiggin@gmail.com> writes:
>
>> qtests spapr dma was broken because the iommu was not set up.
>>
>> spapr requires hypercalls to set up the iommu (TCE tables), but
>> there is no support for that or a side-channel to the iommu in
>> qtests at the moment, so add a quick workaround in QEMU to have
>> the spapr iommu provide a linear map to memory when running
>> qtests.
>
> That's fine.
>
> But what would it take to add support? Add another callback such as
> qtest_rtas_call() to handle hcalls and call H_PUT_TCE from the test? Or
> is there some other complication?

Yeah, exactly. qtest_ppc_spapr_rtas_call() and/or _spapr_hcall() in
the qtest interface I think would do it.

It would be nice to do that in general to be able to test various spapr
bits with qtests. It's just getting all the pieces together would be a
bit more work than this simple bandaid.

>
>>
>> The buggy msix checks can all be removed since the tests all work
>> now.
>>
>> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>> ---
>>  tests/qtest/libqos/pci.h             |  4 ----
>>  hw/ppc/spapr_iommu.c                 |  9 ++++++++-
>>  tests/qtest/e1000e-test.c            | 23 +++--------------------
>>  tests/qtest/igb-test.c               | 21 ---------------------
>>  tests/qtest/libqos/generic-pcihost.c |  1 -
>>  tests/qtest/libqos/pci-pc.c          |  3 ---
>>  tests/qtest/libqos/pci-spapr.c       |  7 ++++---
>>  tests/qtest/libqos/pci.c             | 14 --------------
>>  tests/qtest/vhost-user-blk-test.c    |  6 ------
>>  tests/qtest/virtio-blk-test.c        | 12 ------------
>>  10 files changed, 15 insertions(+), 85 deletions(-)
>>
>
> ...
>
>> @@ -173,13 +159,10 @@ static void test_e1000e_multiple_transfers(void *obj, void *data,
>>  
>>      QE1000E_PCI *e1000e = obj;
>>      QE1000E *d = &e1000e->e1000e;
>> -    QOSGraphObject *e_object = obj;
>> -    QPCIDevice *dev = e_object->get_driver(e_object, "pci-device");
>>  
>> -    /* FIXME: add spapr support */
>> -    if (qpci_check_buggy_msi(dev)) {
>> -        return;
>> -    }
>> +    /* Use EITR for one irq and disable it for the other, for testing */
>> +    e1000e_macreg_write(d, E1000_EITR + E1000E_RX0_MSG_ID * 4, 500);
>> +    e1000e_macreg_write(d, E1000_EITR + E1000E_TX0_MSG_ID * 4, 0);
>
> What's this about?

It's a rebase bug, thanks for catching it.

Thanks,
Nick


      reply	other threads:[~2025-04-16  2:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-15  8:19 [RFC PATCH 0/2] tests/qtest: Enable spapr dma tests Nicholas Piggin
2025-04-15  8:19 ` [RFC PATCH 1/2] tests/qtest: Fix virtio msix message endianness Nicholas Piggin
2025-04-15 18:01   ` Fabiano Rosas
2025-04-16  6:29   ` Philippe Mathieu-Daudé
2025-04-15  8:19 ` [RFC PATCH 2/2] tests/qtest: Enable spapr dma with linear iommu map Nicholas Piggin
2025-04-15 18:07   ` Fabiano Rosas
2025-04-16  2:06     ` Nicholas Piggin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D97P1WO754K9.160CCPB9PO1FH@gmail.com \
    --to=npiggin@gmail.com \
    --cc=Coiby.Xu@gmail.com \
    --cc=danielhb413@gmail.com \
    --cc=e.emanuelegiuseppe@gmail.com \
    --cc=farosas@suse.de \
    --cc=harshpb@linux.ibm.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).