All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dave@treblig.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	qemu-riscv@nongnu.org, qemu-s390x@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Alexandre Iooss" <erdnaxe@crans.org>,
	"Mahmoud Mandour" <ma.mandourr@gmail.com>,
	"Peter Xu" <peterx@redhat.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Chinmay Rath" <rathc@linux.ibm.com>,
	"Glenn Miles" <milesg@linux.ibm.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Weiwei Li" <liwei1518@gmail.com>,
	"Daniel Henrique Barboza" <daniel.barboza@oss.qualcomm.com>,
	"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
	"Chao Liu" <chao.liu.zevorn@gmail.com>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"David Hildenbrand" <david@kernel.org>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>
Subject: Re: [PATCH 12/17] monitor: hmp_gva2gpa: Don't page-align cpu_get_phys_addr_debug() arg and return
Date: Fri, 17 Apr 2026 17:46:35 +0000	[thread overview]
Message-ID: <aeJx-_s-n46m-zBf@gallifrey> (raw)
In-Reply-To: <20260417173105.1648172-13-peter.maydell@linaro.org>

* Peter Maydell (peter.maydell@linaro.org) wrote:
> In hmp_gva2gpa() we currently have a workaround for not all implementations
> of get_phys_addr_debug handling non-page-aligned addresses: we round the
> input address from the user down to the target page boundary before the
> call and then add the page offset back to the returned value.
> 
> Now that we guarantee that all implementations will return the correct
> exact physaddr for a virtual address, we can drop this handling.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  monitor/hmp-cmds.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
> index e6d8322bcc..f8380bda58 100644
> --- a/monitor/hmp-cmds.c
> +++ b/monitor/hmp-cmds.c
> @@ -720,12 +720,11 @@ void hmp_gva2gpa(Monitor *mon, const QDict *qdict)
>          return;
>      }
>  
> -    gpa  = cpu_get_phys_addr_debug(cs, addr & TARGET_PAGE_MASK);
> +    gpa  = cpu_get_phys_addr_debug(cs, addr);
>      if (gpa == -1) {
>          monitor_printf(mon, "Unmapped\n");
>      } else {
> -        monitor_printf(mon, "gpa: 0x%" HWADDR_PRIx "\n",
> -                       gpa + (addr & ~TARGET_PAGE_MASK));
> +        monitor_printf(mon, "gpa: 0x%" HWADDR_PRIx "\n", gpa);

For HMP:

Acked-by: Dr. David Alan Gilbert <dave@treblig.org>

>      }
>  }
>  
> -- 
> 2.43.0
> 
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/


  reply	other threads:[~2026-04-17 17:47 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-17 17:30 [PATCH 00/17] Handle sub-page granularity in cpu_memory_rw_debug() Peter Maydell
2026-04-17 17:30 ` [PATCH 01/17] target/riscv: Make get_phys_page_debug handle non-page-aligned addrs Peter Maydell
2026-04-18  3:43   ` Chao Liu
2026-04-18 22:18   ` Philippe Mathieu-Daudé
2026-04-23  2:13   ` Richard Henderson
2026-04-17 17:30 ` [PATCH 02/17] target/alpha: " Peter Maydell
2026-04-23  2:14   ` Richard Henderson
2026-04-17 17:30 ` [PATCH 03/17] target/microblaze: Make get_phys_page_attrs_debug " Peter Maydell
2026-04-18 22:18   ` Philippe Mathieu-Daudé
2026-04-23  2:24   ` Richard Henderson
2026-04-17 17:30 ` [PATCH 04/17] target/sparc: Make get_phys_page_debug " Peter Maydell
2026-04-23  2:26   ` Richard Henderson
2026-04-17 17:30 ` [PATCH 05/17] target/x86: Make get_phys_page_attrs_debug " Peter Maydell
2026-04-23  2:27   ` Richard Henderson
2026-04-17 17:30 ` [PATCH 06/17] target/s390x: Make get_phys_page_debug " Peter Maydell
2026-04-21 11:04   ` Ilya Leoshkevich
2026-04-23  2:29   ` Richard Henderson
2026-04-17 17:30 ` [PATCH 07/17] target/ppc: " Peter Maydell
2026-04-23  2:30   ` Richard Henderson
2026-04-17 17:30 ` [PATCH 08/17] target: Rename get_phys_page_debug to get_phys_addr_debug Peter Maydell
2026-04-18 22:14   ` Philippe Mathieu-Daudé
2026-04-23  2:32   ` Richard Henderson
2026-04-17 17:30 ` [PATCH 09/17] target: Rename cpu_get_phys_page_{,attrs_}debug Peter Maydell
2026-04-18 22:15   ` Philippe Mathieu-Daudé
2026-04-23  2:34   ` Richard Henderson
2026-04-17 17:30 ` [PATCH 10/17] hw/core: Update docs for get_phys_addr_{attrs_,}debug Peter Maydell
2026-04-18 22:16   ` Philippe Mathieu-Daudé
2026-04-23  2:42   ` Richard Henderson
2026-04-17 17:30 ` [PATCH 11/17] target/arm: Rename arm_cpu_get_phys_page() Peter Maydell
2026-04-18 22:16   ` Philippe Mathieu-Daudé
2026-04-17 17:31 ` [PATCH 12/17] monitor: hmp_gva2gpa: Don't page-align cpu_get_phys_addr_debug() arg and return Peter Maydell
2026-04-17 17:46   ` Dr. David Alan Gilbert [this message]
2026-04-18 22:16   ` Philippe Mathieu-Daudé
2026-04-17 17:31 ` [PATCH 13/17] plugins/api.c: Trust cpu_get_phys_addr_debug() return address Peter Maydell
2026-04-23  2:44   ` Richard Henderson
2026-04-17 17:31 ` [PATCH 14/17] hw/core: Implement new cpu_translate_for_debug() Peter Maydell
2026-04-18 22:25   ` Philippe Mathieu-Daudé
2026-04-23  3:05   ` Richard Henderson
2026-04-28 10:42     ` Peter Maydell
2026-04-17 17:31 ` [PATCH 15/17] hw/core: Implement cpu_get_phys_addr_attrs_debug() with cpu_translate_for_debug() Peter Maydell
2026-04-23  3:08   ` Richard Henderson
2026-04-28 10:43     ` Peter Maydell
2026-04-17 17:31 ` [PATCH 16/17] target/arm: Implement translate_for_debug Peter Maydell
2026-04-18 22:29   ` Philippe Mathieu-Daudé
2026-04-23  3:12   ` Richard Henderson
2026-04-28 10:26     ` Peter Maydell
2026-04-17 17:31 ` [PATCH 17/17] system/physmem: Use translate_for_debug() in cpu_memory_rw_debug() Peter Maydell
2026-04-18 22:33   ` Philippe Mathieu-Daudé
2026-04-23  3:17   ` Richard Henderson
2026-04-28 10:32     ` Peter Maydell

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=aeJx-_s-n46m-zBf@gallifrey \
    --to=dave@treblig.org \
    --cc=alex.bennee@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=atar4qemu@gmail.com \
    --cc=chao.liu.zevorn@gmail.com \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=david@kernel.org \
    --cc=edgar.iglesias@gmail.com \
    --cc=erdnaxe@crans.org \
    --cc=iii@linux.ibm.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=liwei1518@gmail.com \
    --cc=ma.mandourr@gmail.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=milesg@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=rathc@linux.ibm.com \
    --cc=richard.henderson@linaro.org \
    --cc=wangyanan55@huawei.com \
    --cc=zhao1.liu@intel.com \
    --cc=zhiwei_liu@linux.alibaba.com \
    /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.