From: Paolo Bonzini <pbonzini@redhat.com>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
qemu-devel@nongnu.org, hpoussin@reactos.org, famz@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/2] hw/mips/jazz: create ESP device directly via qdev
Date: Wed, 13 Jun 2018 16:12:04 +0200 [thread overview]
Message-ID: <ee19138b-fc56-abef-a556-c725fcd4841b@redhat.com> (raw)
In-Reply-To: <6515c082-3904-e077-144d-d1f3f9fd7ee1@ilande.co.uk>
On 13/06/2018 15:06, Mark Cave-Ayland wrote:
>>
>> Heh, those are disgusting indeed. :) So I guess it would have to stay,
>> only MIPS can use the pure MemoryRegion-based approach.
>
> The only option I can think of is inserting an AddressSpace between the
> esp/ledma device and the IOMMU AddressSpace which intercepts the DMA
> request (addr, len, direction).
>
> I can then grab a reference to the device from the MemoryRegion opaque,
> perform the magic, and then manually invoke address_space_rw() on iommu_as.
>
> Is there a hook somewhere in the memory API that could allow me to do this?
No, I don't think so. Only MMIO regions intercept reads/writes, and
they only do it at 1/2/4/8 byte granularity.
>> Regarding pcnet, is CSR_BSWP really a no-op on PCI cards? If not, an
>> option could be to move that handling to pcnet.c - making the ledma swap
>> unconditional and removing the do_bswap argument. The disadvantage is
>> that SPARC would swap twice, and you'd have to keep the callback because
>> of s->dmaregs[3], but maybe it's still worthwhile.
>
> Hmmm good question. If we can intercept the request above, that would be
> my preferred option as something tells it me it might be useful for
> other similar situations.
Yeah, it wouldn't be a great improvement, but there would be the benefit
of more accurate emulation.
Paolo
next prev parent reply other threads:[~2018-06-13 14:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-13 9:47 [Qemu-devel] [PATCH 0/2] scsi: remove legacy esp_init() function Mark Cave-Ayland
2018-06-13 9:47 ` [Qemu-devel] [PATCH 1/2] hw/mips/jazz: create ESP device directly via qdev Mark Cave-Ayland
2018-06-13 10:06 ` Paolo Bonzini
2018-06-13 10:36 ` Mark Cave-Ayland
2018-06-13 11:19 ` Paolo Bonzini
2018-06-13 13:06 ` Mark Cave-Ayland
2018-06-13 14:12 ` Paolo Bonzini [this message]
2018-06-13 9:47 ` [Qemu-devel] [PATCH 2/2] esp: remove legacy esp_init() function Mark Cave-Ayland
2018-06-27 20:01 ` [Qemu-devel] [PATCH 0/2] scsi: " Mark Cave-Ayland
2018-06-28 5:58 ` Hervé Poussineau
2018-06-28 7:04 ` Paolo Bonzini
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=ee19138b-fc56-abef-a556-c725fcd4841b@redhat.com \
--to=pbonzini@redhat.com \
--cc=famz@redhat.com \
--cc=hpoussin@reactos.org \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-devel@nongnu.org \
/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).