qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Chien <jason.chien@sifive.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, qemu-riscv@nongnu.org,
	Jiri Slaby <jslaby@suse.cz>
Subject: Re: [PATCH] hw/misc/edu: Rename macros indicating the direction of DMA operations
Date: Thu, 20 Mar 2025 01:15:38 +0800	[thread overview]
Message-ID: <CADr__8rhGpOtLBh_8hhtpncAeN9OrxL19ODEcq8n1P9gp420ZA@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA8LPHEmLxDMUNN7DSHCw8pwvA7kUOAH+Ef1mDvOVH-dYQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1607 bytes --]

This is a virtual device designed for educational purposes. The only spec I
found is in QEMU documentation:
https://github.com/qemu/qemu/blob/master/docs/specs/edu.rst
According to the documentation:
direction (0: from RAM to EDU, 1: from EDU to RAM)
The macros confused me and my goal is to make the direction easier to
differentiate. Something like EDU_DMA_TO_PCI_BUS and EDU_DMA_FROM_PCI_BUS
would also work. Do you have any suggestions?

thanks

Peter Maydell <peter.maydell@linaro.org> 於 2025年3月12日 週三 上午2:41寫道:

> On Thu, 27 Feb 2025 at 07:32, Jason Chien <jason.chien@sifive.com> wrote:
> >
> > This commit renames the macros to accurately reflect the direction of
> > DMA operations.
> >
> > EDU_DMA_TO_PCI now represents reading memory content into the EDU buffer,
> > while EDU_DMA_FROM_PCI represents writing EDU buffer content to memory.
>
> The EDU device is a PCI device, so if it is reading
> then it is reading data from the PCI bus, and if it is
> writing then it is writing data to the PCI bus. So I
> think there's an argument that the current names make
> sense.
>
> Plus, presumably this device model is implementing the hardware
> half of a defined specification. The authoritative source for
> what names the 0 and 1 values of the DIR bit should be named
> would be that specification.
>
> Where is that spec, and what does it say? If it says 0 for
> FROM and 1 for TO, that's what we should use. If it's the
> other way around, that's an error in our device implementation
> that we should correct.
>
> thanks
> -- PMM
>

[-- Attachment #2: Type: text/html, Size: 2967 bytes --]

      reply	other threads:[~2025-03-19 17:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-27  7:30 [PATCH] hw/misc/edu: Rename macros indicating the direction of DMA operations Jason Chien
2025-03-11 11:15 ` Jason Chien
2025-03-11 18:40 ` Peter Maydell
2025-03-19 17:15   ` Jason Chien [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=CADr__8rhGpOtLBh_8hhtpncAeN9OrxL19ODEcq8n1P9gp420ZA@mail.gmail.com \
    --to=jason.chien@sifive.com \
    --cc=jslaby@suse.cz \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@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).