All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Lindsay <aaron@os.amperecomputing.com>
To: qemu-devel@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>
Cc: cota@braap.org, richard.henderson@linaro.org,
	Paolo Bonzini <pbonzini@redhat.com>, Peter Xu <peterx@redhat.com>
Subject: Re: [PATCH] plugins: Fix physical address calculation for IO regions
Date: Tue, 20 Jul 2021 16:04:16 -0400	[thread overview]
Message-ID: <YPcsQMsN9uqj/PT6@strawberry.localdomain> (raw)
In-Reply-To: <20210720195735.3934473-1-aaron@os.amperecomputing.com>

For reference, this patch is intended to address this conversation:
https://lists.nongnu.org/archive/html/qemu-devel/2021-07/msg01293.html

This appears to be better than the previous version in my testing, but I
absolutely welcome being told there is a better way to solve this!

Thanks!

-Aaron

On Jul 20 15:57, Aaron Lindsay wrote:
> The address calculation for IO regions introduced by
> 
> commit 787148bf928a54b5cc86f5b434f9399e9737679c
> Author: Aaron Lindsay <aaron@os.amperecomputing.com>
>     plugins: Expose physical addresses instead of device offsets
> 
> is not always accurate. Use the more correct
> MemoryRegionSection.offset_within_address_space.

Whoops, forgot my:

Signed-off-by: Aaron Lindsay <aaron@os.amperecomputing.com>

> ---
>  plugins/api.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/plugins/api.c b/plugins/api.c
> index 5c1a413928..ba14e6f2b2 100644
> --- a/plugins/api.c
> +++ b/plugins/api.c
> @@ -319,7 +319,7 @@ uint64_t qemu_plugin_hwaddr_phys_addr(const struct qemu_plugin_hwaddr *haddr)
>              return block->offset + offset + block->mr->addr;
>          } else {
>              MemoryRegionSection *mrs = haddr->v.io.section;
> -            return haddr->v.io.offset + mrs->mr->addr;
> +            return mrs->offset_within_address_space + haddr->v.io.offset;
>          }
>      }
>  #endif
> -- 
> 2.17.1
> 


  parent reply	other threads:[~2021-07-20 20:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 19:57 [PATCH] plugins: Fix physical address calculation for IO regions Aaron Lindsay
2021-07-20 20:02 ` [PATCH-for-6.1?] " Philippe Mathieu-Daudé
2021-07-20 20:04 ` Aaron Lindsay [this message]
2021-07-20 22:14 ` [PATCH] " Alex Bennée

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=YPcsQMsN9uqj/PT6@strawberry.localdomain \
    --to=aaron@os.amperecomputing.com \
    --cc=alex.bennee@linaro.org \
    --cc=cota@braap.org \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@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 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.