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: <CAAhV-H5jE6RdiLm2PZ=3K+dKXcLay+4B1qZx1jQMBJcQM0hHAQ@mail.gmail.com>
Date:   Fri, 17 Sep 2021 14:36:18 +0800
From:   Huacai Chen <chenhuacai@...il.com>
To:     Christoph Hellwig <hch@...radead.org>
Cc:     Huacai Chen <chenhuacai@...ngson.cn>,
        Arnd Bergmann <arnd@...db.de>,
        Andy Lutomirski <luto@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        David Airlie <airlied@...ux.ie>,
        Jonathan Corbet <corbet@....net>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        linux-arch <linux-arch@...r.kernel.org>,
        linux-doc@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
        Xuefeng Li <lixuefeng@...ngson.cn>,
        Yanteng Si <siyanteng@...ngson.cn>,
        Jiaxun Yang <jiaxun.yang@...goat.com>
Subject: Re: [PATCH V3 16/22] LoongArch: Add misc common routines

Hi, Christoph,

On Fri, Sep 17, 2021 at 2:12 PM Christoph Hellwig <hch@...radead.org> wrote:
>
> > +
> > +/*
> > + * Change "struct page" to physical address.
> > + */
> > +#define page_to_phys(page)   ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
>
> Why is this using a dma_addr_t?  phys_addr_t would be the right type
> here.
Sorry, this is a mistake, I will change to phys_addr_t.

>
> > +
> > +extern void __init __iomem *early_ioremap(u64 phys_addr, unsigned long size);
> > +extern void __init early_iounmap(void __iomem *addr, unsigned long size);
> > +
> > +#define early_memremap early_ioremap
> > +#define early_memunmap early_iounmap
> > +
> > +static inline void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size,
> > +                                      unsigned long prot_val)
> > +{
> > +     if (prot_val == _CACHE_CC)
> > +             return (void __iomem *)(unsigned long)(CAC_BASE + offset);
> > +     else
> > +             return (void __iomem *)(unsigned long)(UNCAC_BASE + offset);
> > +}
>
> There is no real need for this ioremap_prot multiplexer
>
> > +/*
> > + * ioremap_cache -  map bus memory into CPU space
> > + * @offset:      bus address of the memory
> > + * @size:        size of the resource to map
> > + *
> > + * ioremap_cache performs a platform specific sequence of operations to
> > + * make bus memory CPU accessible via the readb/readw/readl/writeb/
> > + * writew/writel functions and the other mmio helpers. The returned
> > + * address is not guaranteed to be usable directly as a virtual
> > + * address.
> > + *
> > + * This version of ioremap ensures that the memory is marked cachable by
> > + * the CPU.  Also enables full write-combining.       Useful for some
> > + * memory-like regions on I/O busses.
> > + */
> > +#define ioremap_cache(offset, size)                          \
> > +     ioremap_prot((offset), (size), _CACHE_CC)
>
> Please don't add ioremap_cache to new ports.
I found there are several call sites in drivers, and I think they
really need a cacheable map.

Huacai

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ