Message ID | 20230609075528.9390-7-bhe@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 1E378C7EE25 for <linux-mm@archiver.kernel.org>; Fri, 9 Jun 2023 07:56:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B21028E0002; Fri, 9 Jun 2023 03:56:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AD3758E0001; Fri, 9 Jun 2023 03:56:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 999C08E0002; Fri, 9 Jun 2023 03:56:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 8D5818E0001 for <linux-mm@kvack.org>; Fri, 9 Jun 2023 03:56:28 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 5DA871A016E for <linux-mm@kvack.org>; Fri, 9 Jun 2023 07:56:28 +0000 (UTC) X-FDA: 80882452056.09.468A2E5 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 82F508000C for <linux-mm@kvack.org>; Fri, 9 Jun 2023 07:56:26 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=BHboCAXc; spf=pass (imf02.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=1686297386; a=rsa-sha256; cv=none; b=T+MPNljR5bIMip5vJkGWPRI1Zv2fIb2snUsIUKEXRjsdhwUbkPssNkqh0EYlzvaut5KLLt ngDxlPAq+E24dhzPnYn0/vW1+4TqBfunIKZ2vczghVzUxyLFD+Uq3mc2/AGJryL0JaUlUv 39KrA9leF4JwTrQ8kEoL8Ft3EKUqDQM= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=BHboCAXc; spf=pass (imf02.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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686297386; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=0wYOGjo01By5N6ypk4T/kszJYngB2yHKY4BDovVrGlY=; b=Xq/759Mh3vK94UOTit8todGQ6GvABT8cUyMTqfFFDwtucpHoFliVIDJ73eAQ0d3xh7Vhki 3pF1okduXs+NVacSqaCJhJTuB3DURFEFiFLEn0qq0ERi32RoR5Mjr0TfeWn2UZMJTiBVFi tMx+eZmghro9IySayUiWvAElY5PQkYE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686297385; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0wYOGjo01By5N6ypk4T/kszJYngB2yHKY4BDovVrGlY=; b=BHboCAXcp/foVP+3euYOC7QTrV+HfcPLlpWZjAUBQqwxtODcF/4Fsub1z1IwjVWnvfgd2n BqJO1pk8BzbmDryZlTemEU6Lq2TkEJvbrjxTnxfDdkJo122VkUUM/fOYHbnXmLYvmDlZVR FT+XTaWWWtTg+4CuSDPj+AJlH2Dgdro= 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-468-G5FEyEG6MS-Y-nyIC9k_aA-1; Fri, 09 Jun 2023 03:56:20 -0400 X-MC-Unique: G5FEyEG6MS-Y-nyIC9k_aA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D69A4811E7C; Fri, 9 Jun 2023 07:56:19 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-92.pek2.redhat.com [10.72.12.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id 47A0A20268C6; Fri, 9 Jun 2023 07:56:13 +0000 (UTC) From: Baoquan He <bhe@redhat.com> To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, arnd@arndb.de, christophe.leroy@csgroup.eu, hch@lst.de, rppt@kernel.org, willy@infradead.org, agordeev@linux.ibm.com, wangkefeng.wang@huawei.com, schnelle@linux.ibm.com, David.Laight@ACULAB.COM, shorne@gmail.com, deller@gmx.de, Baoquan He <bhe@redhat.com> Subject: [PATCH v6 06/19] mm/ioremap: add slab availability checking in ioremap_prot Date: Fri, 9 Jun 2023 15:55:15 +0800 Message-Id: <20230609075528.9390-7-bhe@redhat.com> In-Reply-To: <20230609075528.9390-1-bhe@redhat.com> References: <20230609075528.9390-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: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D8DfcAQt7XbztoeC9yQOyUiYUd9EHEcMi+cP34yLPHXUYCEAB6Q574nlpCPgdWx4ZyTuYUyYFiFSuKFEiO29+x9Oddhks6OUNvKxVVSyqAun1ANl3lUg5FycCpnm3bo8MGzxEo8s/Gxjqpon9MptdV6lcsOGB86H7wADpw2CGXlAoV4WuVRK1QT6mILtHE7cgv2PHMmGj6i6UWsU1wyJSSf6tKfc7BbMeBECfdcI8V7c+VdojMvnNQ02qtgigaJd4I6fd1xNDrfpAiO5kQj/FEpYcaDaPnSw8AkFGI615SGmRqY5n0TWXh89YnjKlwYSAJDfOWa+aozmPbWD/FkQHdCJr6SFp6ySN/S7TZ7u5Av8QsCY= 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: <linux-mm.kvack.org> |
Series |
mm: ioremap: Convert architectures to take GENERIC_IOREMAP way
|
expand
|
diff --git a/mm/ioremap.c b/mm/ioremap.c index 9f34a8f90b58..86b82ec27d2b 100644 --- a/mm/ioremap.c +++ b/mm/ioremap.c @@ -18,6 +18,10 @@ void __iomem *generic_ioremap_prot(phys_addr_t phys_addr, size_t size, phys_addr_t last_addr; struct vm_struct *area; + /* An early platform driver might end up here */ + if (WARN_ON_ONCE(!slab_is_available())) + return NULL; + /* Disallow wrap-around or zero size */ last_addr = phys_addr + size - 1; if (!size || last_addr < phys_addr)