On Wed, Oct 15, 2025 at 08:33:57PM +0200, Mikhail Zaslonko wrote:
> In s390x_kvtop() early return may take place despite the verbose
> flag. Thus we can miss page-table walk information in the vtop output
> for kernel virtual addresses.
> Make sure that s390x_vtop() is always called for kernel virtual addresses
> when the verbose flag is passed to s390x_kvtop() by do_vtop().
> 
> Suggested-by: Heiko Carstens <[email protected]>
> Signed-off-by: Mikhail Zaslonko <[email protected]>
> ---
>  s390x.c | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/s390x.c b/s390x.c
> index 8c0bba4..cb5a0dd 100644
> --- a/s390x.c
> +++ b/s390x.c
> @@ -947,18 +947,15 @@ s390x_kvtop(struct task_context *tc, ulong vaddr, 
> physaddr_t *paddr, int verbose
>       if (!IS_KVADDR(vaddr)){
>               *paddr = 0;
>               return FALSE;
>       }
>  
> -     if (!vt->vmalloc_start) {

Frankly, for simplicity I would extra check verbose here...

> -            *paddr = VTOP(vaddr);
> -            return TRUE;
> -     }
> -
> -     if (!IS_VMALLOC_ADDR(vaddr)) {

...and here.

> -            *paddr = VTOP(vaddr);
> -            return TRUE;
> +     if (!verbose) {
> +             if (!vt->vmalloc_start || !IS_VMALLOC_ADDR(vaddr)) {

Or at least made a single condition here ;)

> +                     *paddr = VTOP(vaddr);
> +                     return TRUE;
> +             }
>       }
>  
>       pgd_base = (unsigned long)vt->kernel_pgd[0];
>       return s390x_vtop(pgd_base, vaddr, paddr, verbose);     
>  }

Anyway,

Acked-by: Alexander Gordeev <[email protected]>

Thanks!
--
Crash-utility mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/
Contribution Guidelines: https://github.com/crash-utility/crash/wiki

Reply via email to