From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFE01C4332F for ; Thu, 13 Oct 2022 09:51:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3033F6B0071; Thu, 13 Oct 2022 05:51:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2B2BA6B0073; Thu, 13 Oct 2022 05:51:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 154506B0074; Thu, 13 Oct 2022 05:51:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 029716B0071 for ; Thu, 13 Oct 2022 05:51:43 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id AD67E1611D4 for ; Thu, 13 Oct 2022 09:51:43 +0000 (UTC) X-FDA: 80015459286.18.DEE82C8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf20.hostedemail.com (Postfix) with ESMTP id 4A5B11C0035 for ; Thu, 13 Oct 2022 09:51:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665654702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PnamMLehA6c/ZrC5mAWlH7KtTngXqnj6RvbTVflM5BA=; b=O5gBN/hnMmQqj/Ynjz+0TFBtCTEKfUzjyUFtrhUWEqp18Htt1F4Z150R1kZg+GWualaDUw TmWv0927R1Cn43gYcKs5vdc4R3tPrDyLxFbmyZbvpgAGxUZgHrdyTvsOABD+B4Qf56fCmn OFlGtH+Bda57/h7P9Q7Q3TTmucUmzxA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-120-wzSYpi1QPaKmyhZ3WPMPtQ-1; Thu, 13 Oct 2022 05:51:39 -0400 X-MC-Unique: wzSYpi1QPaKmyhZ3WPMPtQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AD804185A794; Thu, 13 Oct 2022 09:51:38 +0000 (UTC) Received: from localhost (ovpn-12-120.pek2.redhat.com [10.72.12.120]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 136CB1121314; Thu, 13 Oct 2022 09:51:36 +0000 (UTC) Date: Thu, 13 Oct 2022 17:51:33 +0800 From: Baoquan He To: Christophe Leroy Cc: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "akpm@linux-foundation.org" , "hch@infradead.org" , "agordeev@linux.ibm.com" , "wangkefeng.wang@huawei.com" , "schnelle@linux.ibm.com" , "David.Laight@ACULAB.COM" , "shorne@gmail.com" , Vineet Gupta , "linux-snps-arc@lists.infradead.org" Subject: Re: [PATCH v3 05/11] arc: mm: Convert to GENERIC_IOREMAP Message-ID: References: <20221009103114.149036-1-bhe@redhat.com> <20221009103114.149036-6-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="O5gBN/hn"; spf=pass (imf20.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665654703; a=rsa-sha256; cv=none; b=7zQS8fKPsSISOwIKxWiphf6Adw95vjuf0VmuKOD1bRBR278bvYu0VnnApEOU7qfrh+9gQO XT3gjQGb/5Pod9DMTWUb1Bu+z87iU+x8ob4+VEza7PjWqHBqCIKtsg2FkKW60Nz/TpM/yn Wvn1hYSVGb147VNnN/Xf5yhWZd4Uzos= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665654703; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=PnamMLehA6c/ZrC5mAWlH7KtTngXqnj6RvbTVflM5BA=; b=KuodhyX5MyQZ4RABtFmgkdpsa8kcIJySTR+qnJKtMFzZY/F9ck5XGOJ626o65Z8VcMQ09m jWfkiCVX/uYP6DB3ny+ql/5SRQyV7mGJIFQSTT9/7bW/liQo1mNKDTEB+/aWkaccb+nk13 o5JcVEP4wjd3yWWUWZtixpG9TQAC3is= X-Rspam-User: X-Stat-Signature: wjde1689zk8sqn6i7ccsw97tqhtssxtb X-Rspamd-Queue-Id: 4A5B11C0035 Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="O5gBN/hn"; spf=pass (imf20.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam07 X-HE-Tag: 1665654703-38376 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.