[PATCH 10/18] target/s390x: Replace target_ulong -> vaddr in get_phys_addr_debug()

Philippe Mathieu-Daudé posted 18 patches 1 month ago
Maintainers: Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Farhan Ali <alifm@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Richard Henderson <richard.henderson@linaro.org>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>
There is a newer version of this series
[PATCH 10/18] target/s390x: Replace target_ulong -> vaddr in get_phys_addr_debug()
Posted by Philippe Mathieu-Daudé 1 month ago
cpu_get_phys_page_debug() takes a vaddr argument.
Rename the @vaddr argument to avoid confusing the compiler.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/s390x/helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/s390x/helper.c b/target/s390x/helper.c
index 59e1fd0c4fe..f124b16d1b3 100644
--- a/target/s390x/helper.c
+++ b/target/s390x/helper.c
@@ -68,14 +68,14 @@ hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr)
     return raddr;
 }
 
-hwaddr s390_cpu_get_phys_addr_debug(CPUState *cs, vaddr vaddr)
+hwaddr s390_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr)
 {
     hwaddr phys_addr;
-    target_ulong page;
+    vaddr page;
 
-    page = vaddr & TARGET_PAGE_MASK;
+    page = addr & TARGET_PAGE_MASK;
     phys_addr = cpu_get_phys_page_debug(cs, page);
-    phys_addr += (vaddr & ~TARGET_PAGE_MASK);
+    phys_addr += (addr & ~TARGET_PAGE_MASK);
 
     return phys_addr;
 }
-- 
2.52.0


Re: [PATCH 10/18] target/s390x: Replace target_ulong -> vaddr in get_phys_addr_debug()
Posted by Thomas Huth 1 month ago
On 07/01/2026 14.07, Philippe Mathieu-Daudé wrote:
> cpu_get_phys_page_debug() takes a vaddr argument.
> Rename the @vaddr argument to avoid confusing the compiler.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/s390x/helper.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/target/s390x/helper.c b/target/s390x/helper.c
> index 59e1fd0c4fe..f124b16d1b3 100644
> --- a/target/s390x/helper.c
> +++ b/target/s390x/helper.c
> @@ -68,14 +68,14 @@ hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr)
>       return raddr;
>   }
>   
> -hwaddr s390_cpu_get_phys_addr_debug(CPUState *cs, vaddr vaddr)
> +hwaddr s390_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr)

I'd maybe rather go with "v_addr" or "virt_addr" to avoid confusion with 
physical addresses here.

  Thomas