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: <CAK8P3a1qEk3hLUOijtzXRhT4-nZO8KUe1a_3mvUVSSzaGt2itg@mail.gmail.com>
Date:   Tue, 24 May 2022 14:35:27 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Kefeng Wang <wangkefeng.wang@...wei.com>
Cc:     kernel test robot <lkp@...el.com>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        kbuild-all@...ts.01.org, Linux-MM <linux-mm@...ck.org>,
        Christoph Hellwig <hch@...radead.org>,
        Arnd Bergmann <arnd@...db.de>,
        Anshuman Khandual <anshuman.khandual@....com>
Subject: Re: [PATCH v3 4/6] mm: ioremap: Add arch_ioremap/iounmap()

On Tue, May 24, 2022 at 11:48 AM Kefeng Wang <wangkefeng.wang@...wei.com> wrote:
> >>> mm/ioremap.c:59:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const *addr @@     got void [noderef] __iomem *vaddr @@
> >     mm/ioremap.c:59:16: sparse:     expected void const *addr
> >     mm/ioremap.c:59:16: sparse:     got void [noderef] __iomem *vaddr
> >
> > vim +59 mm/ioremap.c
> >
> >      51
> >      52       void iounmap(volatile void __iomem *addr)
> >      53       {
> >      54               void __iomem *vaddr = (void __iomem *)((unsigned long)addr & PAGE_MASK);
> >      55
> >      56               if (arch_iounmap(vaddr))
> >      57                       return;
> >      58
> >    > 59               vunmap(vaddr);
>
> 1) Will add generic "arch_ioremap/arch_iounmap define"
>
> 2) and change this to vunmap((void *)vaddr);

I think this need an extra __force to actually suppress the sparse
warning, as in

        vunmap((void __force *)vaddr);

Using __force is usually wrong, this is one of the exceptions, so
maybe add a comment
as well.

         Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ