qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ethan Chen via <qemu-devel@nongnu.org>
To: Peter Xu <peterx@redhat.com>
Cc: <qemu-devel@nongnu.org>, <peter.maydell@linaro.org>,
	<richard.henderson@linaro.org>, <pbonzini@redhat.com>,
	<palmer@dabbelt.com>, <alistair.francis@wdc.com>,
	<in.meng@windriver.com>, <liweiwei@iscas.ac.cn>,
	<dbarboza@ventanamicro.com>, <hiwei_liu@linux.alibaba.com>,
	<qemu-riscv@nongnu.org>, <david@redhat.com>
Subject: Re: [PATCH v2 1/4] exec/memattrs: Add iopmp source id, start address, end address to MemTxAttrs
Date: Fri, 3 Nov 2023 11:27:05 +0800	[thread overview]
Message-ID: <ZURoiSFQJ+eCi6Xs@ethan84-VirtualBox> (raw)
In-Reply-To: <ZUOo3fGmqM/gVyTR@x1n>

On Thu, Nov 02, 2023 at 09:49:17AM -0400, Peter Xu wrote:
> On Thu, Nov 02, 2023 at 05:40:12PM +0800, Ethan Chen wrote:
> > Signed-off-by: Ethan Chen <ethan84@andestech.com>
> > ---
> >  include/exec/memattrs.h | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h
> > index d04170aa27..fc15e5d7d3 100644
> > --- a/include/exec/memattrs.h
> > +++ b/include/exec/memattrs.h
> > @@ -64,6 +64,12 @@ typedef struct MemTxAttrs {
> >      unsigned int target_tlb_bit0 : 1;
> >      unsigned int target_tlb_bit1 : 1;
> >      unsigned int target_tlb_bit2 : 1;
> > +
> > +    /* IOPMP support up to 65535 sources */
> > +    unsigned int iopmp_sid:16;
> 
> There's MemTxAttrs.requester_id, SID for pci, same length.  Reuse it?

OK, I will reuse it.

> 
> > +    /* Transaction infomation for IOPMP */
> > +    unsigned long long iopmp_start_addr;
> > +    unsigned long long iopmp_end_addr;
> 
> PS: encoding addresses into memattrs is.. strange, but since I know nothing
> about iopmp, I'll leave that for other reviewers.

Current IOMMU translate function only have address need to be translate. 
In IOPMP, It needs the transfer start and end address to check this transfer
is valid or not.

> 
> Currently MemTxAttrs are passed as a whole int on the stack, if it keeps
> growing we may start to consider a pointer, but need to check the side
> effects of unexpected fields modified within a call.

It's good for me to use a pointer.

Thanks,
Ethan Chen


  parent reply	other threads:[~2023-11-03  3:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02  9:40 [PATCH v2 0/4] Support RISC-V IOPMP Ethan Chen via
2023-11-02  9:40 ` [PATCH v2 1/4] exec/memattrs: Add iopmp source id, start address, end address to MemTxAttrs Ethan Chen via
2023-11-02 13:49   ` Peter Xu
2023-11-02 13:53     ` Peter Maydell
2023-11-03  3:29       ` Ethan Chen via
2023-11-03 10:34         ` Peter Maydell
2023-11-06  1:56           ` Ethan Chen via
2023-11-06 10:34             ` Peter Maydell
2023-11-07  3:01               ` Ethan Chen via
2023-11-07 10:53                 ` Peter Maydell
2023-11-08  7:33                   ` Ethan Chen via
2023-11-03  3:27     ` Ethan Chen via [this message]
2023-11-02  9:40 ` [PATCH v2 2/4] Add RISC-V IOPMP support Ethan Chen via
2023-11-02  9:40 ` [PATCH v2 3/4] hw/dma: Add Andes ATCDMAC300 support Ethan Chen via
2023-11-02  9:40 ` [PATCH v2 4/4] hw/riscv/virt: Add IOPMP support Ethan Chen via

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=ZURoiSFQJ+eCi6Xs@ethan84-VirtualBox \
    --to=qemu-devel@nongnu.org \
    --cc=alistair.francis@wdc.com \
    --cc=david@redhat.com \
    --cc=dbarboza@ventanamicro.com \
    --cc=ethan84@andestech.com \
    --cc=hiwei_liu@linux.alibaba.com \
    --cc=in.meng@windriver.com \
    --cc=liweiwei@iscas.ac.cn \
    --cc=palmer@dabbelt.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=qemu-riscv@nongnu.org \
    --cc=richard.henderson@linaro.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).