All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Alex Bennée" <alex.bennee@linaro.org>, qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [RFC PATCH 1/4] hw: encode accessing CPU index in MemTxAttrs
Date: Thu, 15 Sep 2022 09:05:13 +0100	[thread overview]
Message-ID: <f7de79e4-a0f4-c212-6960-afa0a82bc80a@linaro.org> (raw)
In-Reply-To: <20220914160955.812151-2-alex.bennee@linaro.org>

On 9/14/22 17:09, Alex Bennée wrote:
> @@ -1340,8 +1340,13 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry,
>       uint64_t val;
>       bool locked = false;
>       MemTxResult r;
> +    MemTxAttrs attrs = iotlbentry->attrs;
>   
> -    section = iotlb_to_section(cpu, iotlbentry->addr, iotlbentry->attrs);
> +    /* encode the accessing CPU */
> +    attrs.requester_cpu = 1;
> +    attrs.requester_id = cpu->cpu_index;
> +
> +    section = iotlb_to_section(cpu, iotlbentry->addr, attrs);
>       mr = section->mr;
>       mr_offset = (iotlbentry->addr & TARGET_PAGE_MASK) + addr;
>       cpu->mem_io_pc = retaddr;

At first I was going to suggest that this be done in tlb_set_page_with_attrs, so that it 
could be done once and not duplicate code across read/write.

But then I got to thinking how this ought to interact with MEMTXATTRS_UNSPECIFIED, and now 
I think that we simply have to leave this to the cpu's tlb_fill routine, where it fills in 
(or doesn't) all of the other transaction attributes.


r~


  reply	other threads:[~2022-09-15  8:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14 16:09 [RFC PATCH 0/4] use MemTxAttrs to signal cpu index Alex Bennée
2022-09-14 16:09 ` [RFC PATCH 1/4] hw: encode accessing CPU index in MemTxAttrs Alex Bennée
2022-09-15  8:05   ` Richard Henderson [this message]
2022-09-16 15:19   ` Peter Maydell
2022-09-14 16:09 ` [RFC PATCH 2/4] qtest: make read/write operation appear to be from CPU Alex Bennée
2022-09-15  8:08   ` Richard Henderson
2022-09-16 14:40     ` Philippe Mathieu-Daudé via
2022-09-14 16:09 ` [RFC PATCH 3/4] hw/intc/gic: use MxTxAttrs to divine accessing CPU Alex Bennée
2022-09-15  8:16   ` Richard Henderson
2022-09-16 14:49     ` Philippe Mathieu-Daudé via
2022-09-16 15:28       ` Alex Bennée
2022-09-17  8:33         ` Richard Henderson
2022-09-14 16:09 ` [RFC PATCH 4/4] hw/timer: convert mptimer access to attrs to derive cpu index Alex Bennée
2022-09-15  8:17   ` Richard Henderson

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=f7de79e4-a0f4-c212-6960-afa0a82bc80a@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.