lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <hw7djtdwttjwqhnpwidl2g3k7zxoepy7g54ehwatbchjjxahhc@al2t2da3pylo>
Date:   Wed, 29 Mar 2023 08:38:51 -0700
From:   Jerry Snitselaar <jsnitsel@...hat.com>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     Geert Uytterhoeven <geert+renesas@...der.be>,
        Desnes Nunes <desnesn@...hat.com>,
        Christoph Hellwig <hch@....de>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Robin Murphy <robin.murphy@....com>, iommu@...ts.linux.dev,
        linux-kernel@...r.kernel.org, kernel test robot <lkp@...el.com>,
        noreply@...erman.id.au
Subject: Re: [PATCH -next] dma-debug: Use %pa to format phys_addr_t

On Wed, Mar 29, 2023 at 05:34:23PM +0200, Geert Uytterhoeven wrote:
> Hi Jerry,
> 
> On Wed, Mar 29, 2023 at 5:03 PM Jerry Snitselaar <jsnitsel@...hat.com> wrote:
> > On Wed, Mar 29, 2023 at 09:14:05AM +0200, Geert Uytterhoeven wrote:
> > > On 32-bit without LPAE:
> > >
> > >     kernel/dma/debug.c: In function ‘debug_dma_dump_mappings’:
> > >     kernel/dma/debug.c:537:7: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 9 has type ‘phys_addr_t’ {aka ‘unsigned int’} [-Wformat=]
> > >     kernel/dma/debug.c: In function ‘dump_show’:
> > >     kernel/dma/debug.c:568:59: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 11 has type ‘phys_addr_t’ {aka ‘unsigned int’} [-Wformat=]
> > >
> > > Fixes: bd89d69a529fbef3 ("dma-debug: add cacheline to user/kernel space dump messages")
> > > Reported-by: kernel test robot <lkp@...el.com>
> > > Link: https://lore.kernel.org/r/202303160548.ReyuTsGD-lkp@intel.com
> > > Reported-by: noreply@...erman.id.au
> > > Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
> =
> > > --- a/kernel/dma/debug.c
> > > +++ b/kernel/dma/debug.c
> > > @@ -534,11 +534,11 @@ void debug_dma_dump_mappings(struct device *dev)
> > >                       if (!dev || dev == entry->dev) {
> > >                               cln = to_cacheline_number(entry);
> > >                               dev_info(entry->dev,
> > > -                                      "%s idx %d P=%llx N=%lx D=%llx L=%llx cln=%llx %s %s\n",
> > > +                                      "%s idx %d P=%llx N=%lx D=%llx L=%llx cln=%pa %s %s\n",
> > >                                        type2name[entry->type], idx,
> > >                                        phys_addr(entry), entry->pfn,
> > >                                        entry->dev_addr, entry->size,
> > > -                                      cln, dir2name[entry->direction],
> > > +                                      &cln, dir2name[entry->direction],
> >
> > Won't this just print out the address of cln declared at the beginning of debug_dma_dump_mappings() each time, instead of the value
> > returned from to_cacheline_entry() ?
> 
> The physical address is passed by reference, cfr.
> https://elixir.bootlin.com/linux/latest/source/Documentation/core-api/printk-formats.rst#L231
> 
> Gr{oetje,eeting}s,
> 
>                         Geert

Got it. Thanks Geert

snits

> 
> -- 
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ