[PATCH 07/18] target/s390x: Pass vaddr/hwaddr types to mmu_translate_asce()

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 07/18] target/s390x: Pass vaddr/hwaddr types to mmu_translate_asce()
Posted by Philippe Mathieu-Daudé 1 month ago
mmu_translate_asce() translates virtual address to physical one.

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

diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c
index 9ee1d778876..ccb53e99ebd 100644
--- a/target/s390x/mmu_helper.c
+++ b/target/s390x/mmu_helper.c
@@ -122,8 +122,8 @@ static inline bool read_table_entry(CPUS390XState *env, hwaddr gaddr,
     return ret == MEMTX_OK;
 }
 
-static int mmu_translate_asce(CPUS390XState *env, target_ulong vaddr,
-                              uint64_t asc, uint64_t asce, target_ulong *raddr,
+static int mmu_translate_asce(CPUS390XState *env, vaddr vaddr,
+                              uint64_t asc, uint64_t asce, hwaddr *raddr,
                               int *flags)
 {
     const bool edat1 = (env->cregs[0] & CR0_EDAT) &&
-- 
2.52.0


Re: [PATCH 07/18] target/s390x: Pass vaddr/hwaddr types to mmu_translate_asce()
Posted by Thomas Huth 1 month ago
On 07/01/2026 14.07, Philippe Mathieu-Daudé wrote:
> mmu_translate_asce() translates virtual address to physical one.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/s390x/mmu_helper.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c
> index 9ee1d778876..ccb53e99ebd 100644
> --- a/target/s390x/mmu_helper.c
> +++ b/target/s390x/mmu_helper.c
> @@ -122,8 +122,8 @@ static inline bool read_table_entry(CPUS390XState *env, hwaddr gaddr,
>       return ret == MEMTX_OK;
>   }
>   
> -static int mmu_translate_asce(CPUS390XState *env, target_ulong vaddr,
> -                              uint64_t asc, uint64_t asce, target_ulong *raddr,
> +static int mmu_translate_asce(CPUS390XState *env, vaddr vaddr,
> +                              uint64_t asc, uint64_t asce, hwaddr *raddr,
>                                 int *flags)

I'm ok with the change to vaddr, but with regards to raddr, I think you 
should rather change all of these in mmu_helper.c in one go. Otherwise this 
is a mix of hwaddr pointers and target_ulong pointers while the change is 
going on, and that is rather bad.

  Thomas