[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y0ffpSdpAcvbXDGK@MiWiFi-R3L-srv>
Date: Thu, 13 Oct 2022 17:51:33 +0800
From: Baoquan He <bhe@...hat.com>
To: Christophe Leroy <christophe.leroy@...roup.eu>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"hch@...radead.org" <hch@...radead.org>,
"agordeev@...ux.ibm.com" <agordeev@...ux.ibm.com>,
"wangkefeng.wang@...wei.com" <wangkefeng.wang@...wei.com>,
"schnelle@...ux.ibm.com" <schnelle@...ux.ibm.com>,
"David.Laight@...LAB.COM" <David.Laight@...lab.com>,
"shorne@...il.com" <shorne@...il.com>,
Vineet Gupta <vgupta@...nel.org>,
"linux-snps-arc@...ts.infradead.org"
<linux-snps-arc@...ts.infradead.org>
Subject: Re: [PATCH v3 05/11] arc: mm: Convert to GENERIC_IOREMAP
On 10/12/22 at 10:17am, Christophe Leroy wrote:
......
> > -/*
> > - * ioremap with access flags
> > - * Cache semantics wise it is same as ioremap - "forced" uncached.
> > - * However unlike vanilla ioremap which bypasses ARC MMU for addresses in
> > - * ARC hardware uncached region, this one still goes thru the MMU as caller
> > - * might need finer access control (R/W/X)
> > - */
> > -void __iomem *ioremap_prot(phys_addr_t paddr, unsigned long size,
> > - unsigned long flags)
> > +void __iomem *
> > +arch_ioremap(phys_addr_t *paddr, size_t size, unsigned long *prot_val)
> > {
> > - unsigned int off;
> > - unsigned long vaddr;
> > - struct vm_struct *area;
> > - phys_addr_t end;
> > - pgprot_t prot = __pgprot(flags);
> > -
> > - /* Don't allow wraparound, zero size */
> > - end = paddr + size - 1;
> > - if ((!size) || (end < paddr))
> > - return NULL;
> > -
> > /* An early platform driver might end up here */
> > if (!slab_is_available())
> > - return NULL;
> > + return IOMEM_ERR_PTR(-EINVAL);
>
> I think the slab_is_available() check should be done in the generic
> functions. On all architectures SLAB must be available before you can
> use get_vm_area_caller() and vunmap()
Tend to agree.
W/o slab initialized, the get_vm_area_caller() calling definitely will
fail. The arch's early ioremap code could call into this.
Powered by blists - more mailing lists