cpu_get_phys_page_debug() takes a vaddr type since commit
00b941e581b ("cpu: Turn cpu_get_phys_page_debug() into a CPUClass
hook").
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
---
monitor/hmp-cmds-target.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/monitor/hmp-cmds-target.c b/monitor/hmp-cmds-target.c
index e9820611466..2976f986d35 100644
--- a/monitor/hmp-cmds-target.c
+++ b/monitor/hmp-cmds-target.c
@@ -301,7 +301,7 @@ void hmp_gpa2hva(Monitor *mon, const QDict *qdict)
void hmp_gva2gpa(Monitor *mon, const QDict *qdict)
{
- target_ulong addr = qdict_get_int(qdict, "addr");
+ vaddr addr = qdict_get_int(qdict, "addr");
CPUState *cs = mon_get_cpu(mon);
hwaddr gpa;
--
2.52.0
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> cpu_get_phys_page_debug() takes a vaddr type since commit
> 00b941e581b ("cpu: Turn cpu_get_phys_page_debug() into a CPUClass
> hook").
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
> ---
> monitor/hmp-cmds-target.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/monitor/hmp-cmds-target.c b/monitor/hmp-cmds-target.c
> index e9820611466..2976f986d35 100644
> --- a/monitor/hmp-cmds-target.c
> +++ b/monitor/hmp-cmds-target.c
> @@ -301,7 +301,7 @@ void hmp_gpa2hva(Monitor *mon, const QDict *qdict)
>
> void hmp_gva2gpa(Monitor *mon, const QDict *qdict)
> {
> - target_ulong addr = qdict_get_int(qdict, "addr");
> + vaddr addr = qdict_get_int(qdict, "addr");
> CPUState *cs = mon_get_cpu(mon);
> hwaddr gpa;
if (!cs) {
monitor_printf(mon, "No cpu\n");
return;
}
gpa = cpu_get_phys_page_debug(cs, addr & TARGET_PAGE_MASK);
if (gpa == -1) {
monitor_printf(mon, "Unmapped\n");
} else {
monitor_printf(mon, "gpa: 0x%" HWADDR_PRIx "\n",
gpa + (addr & ~TARGET_PAGE_MASK));
Pardon my ignorant question: is HWADDR_PRIx appropriate for vaddr?
}
}
On 1/8/26 18:30, Markus Armbruster wrote:
> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>
>> cpu_get_phys_page_debug() takes a vaddr type since commit
>> 00b941e581b ("cpu: Turn cpu_get_phys_page_debug() into a CPUClass
>> hook").
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
>> Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
>> ---
>> monitor/hmp-cmds-target.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/monitor/hmp-cmds-target.c b/monitor/hmp-cmds-target.c
>> index e9820611466..2976f986d35 100644
>> --- a/monitor/hmp-cmds-target.c
>> +++ b/monitor/hmp-cmds-target.c
>> @@ -301,7 +301,7 @@ void hmp_gpa2hva(Monitor *mon, const QDict *qdict)
>>
>> void hmp_gva2gpa(Monitor *mon, const QDict *qdict)
>> {
>> - target_ulong addr = qdict_get_int(qdict, "addr");
>> + vaddr addr = qdict_get_int(qdict, "addr");
>> CPUState *cs = mon_get_cpu(mon);
>> hwaddr gpa;
>
> if (!cs) {
> monitor_printf(mon, "No cpu\n");
> return;
> }
>
> gpa = cpu_get_phys_page_debug(cs, addr & TARGET_PAGE_MASK);
> if (gpa == -1) {
> monitor_printf(mon, "Unmapped\n");
> } else {
> monitor_printf(mon, "gpa: 0x%" HWADDR_PRIx "\n",
> gpa + (addr & ~TARGET_PAGE_MASK));
>
> Pardon my ignorant question: is HWADDR_PRIx appropriate for vaddr?
The print argument is gpa + offset, and hpa is hwaddr.
r~
Richard Henderson <richard.henderson@linaro.org> writes:
> On 1/8/26 18:30, Markus Armbruster wrote:
>> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>>
>>> cpu_get_phys_page_debug() takes a vaddr type since commit
>>> 00b941e581b ("cpu: Turn cpu_get_phys_page_debug() into a CPUClass
>>> hook").
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
>>> Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
>>> ---
>>> monitor/hmp-cmds-target.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/monitor/hmp-cmds-target.c b/monitor/hmp-cmds-target.c
>>> index e9820611466..2976f986d35 100644
>>> --- a/monitor/hmp-cmds-target.c
>>> +++ b/monitor/hmp-cmds-target.c
>>> @@ -301,7 +301,7 @@ void hmp_gpa2hva(Monitor *mon, const QDict *qdict)
>>>
>>> void hmp_gva2gpa(Monitor *mon, const QDict *qdict)
>>> {
>>> - target_ulong addr = qdict_get_int(qdict, "addr");
>>> + vaddr addr = qdict_get_int(qdict, "addr");
>>> CPUState *cs = mon_get_cpu(mon);
>>> hwaddr gpa;
>>
>> if (!cs) {
>> monitor_printf(mon, "No cpu\n");
>> return;
>> }
>>
>> gpa = cpu_get_phys_page_debug(cs, addr & TARGET_PAGE_MASK);
>> if (gpa == -1) {
>> monitor_printf(mon, "Unmapped\n");
>> } else {
>> monitor_printf(mon, "gpa: 0x%" HWADDR_PRIx "\n",
>> gpa + (addr & ~TARGET_PAGE_MASK));
>>
>> Pardon my ignorant question: is HWADDR_PRIx appropriate for vaddr?
>
> The print argument is gpa + offset, and hpa is hwaddr.
So, hwaddr must be at least as wide as vaddr?
On 1/12/26 17:33, Markus Armbruster wrote: >>> Pardon my ignorant question: is HWADDR_PRIx appropriate for vaddr? >> >> The print argument is gpa + offset, and hpa is hwaddr. > > So, hwaddr must be at least as wide as vaddr? > They're both uint64_t, always, just with different names. r~
© 2016 - 2026 Red Hat, Inc.