Message ID | 20230113031921.64716-8-bhe@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp57847wrt; Thu, 12 Jan 2023 19:24:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXtDHZVXkHj3ZfARyyhLT9hGw250I10mTqkGgminD3n24S1sZkzRHW+Co/hbde6jXOQiYLBZ X-Received: by 2002:a17:906:26d6:b0:7c9:6e0e:1427 with SMTP id u22-20020a17090626d600b007c96e0e1427mr1740920ejc.6.1673580246273; Thu, 12 Jan 2023 19:24:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673580246; cv=none; d=google.com; s=arc-20160816; b=PSXzbz9hnUz5owcSC5FEyFA1HLsd7QaEwgyOYFVVPagUlLrSiuhjCaUVqlC5qJXlcG WfY3ejGAJoVzLDVD1du6o4oceO9rwzm/Ofm8GkU/KnZ8W7OoG2qR5k/f5aLOF1Las+nu FU/xPRcdA8OzuJX7ePmr+yoJQkeB3kJonJevm95ZW8VIqWaF3jIqW4PH2QCUy+k6U8aw 7vo0XRjL9kSnGmL03pUbePNGaOGG/urIwoT6605nVpToVv3uVZQWbEffri7UGkYq+wU+ XWHcSltH51Q6vII02O20HZQyTMIZPA4YKspYQOgkASG7+W2HqWUic1G3svywXjg/WJdn MS0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=285BkZEBCnAc+7uwK4L/HsvDVOrMR6yTW3lbxZ2Ub9M=; b=lTqqJTIzsPMKBQqrQ/EqXGx9gqqRND/49MF8NKrDFIs32gvZ2Dqq9XhEbi7uXSkk8W UTGpoYhqmLI5316rp068iMMzsiw3xdT1HJnI+hipUGwE/aosg2OgKCtrb+IPSsuzQ29d xdq0UkOi0mNNfCTfhQ1omyPvEcOhZCk+PVsURICcvNmJgujkNZh7ZrrMt53ZYfvv6WH1 Sxdb7d+pD1ZU9BAOKILnOFWjfMhg/kgoFJWtIzG4/8FvvR6RkBf/GNYsAqkO0sf+G8tT CW7SLGSmcnclzVmmOcNyE3KBHxlUXXNPDEKr/3/JpMu2M1k8q6TF/QzvV3ckAzkFoqnn 4bEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QzZAg26U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cs21-20020a170906dc9500b007c0bc7057ddsi21838269ejc.909.2023.01.12.19.23.42; Thu, 12 Jan 2023 19:24:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QzZAg26U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232439AbjAMDVO (ORCPT <rfc822;zhuangel570@gmail.com> + 99 others); Thu, 12 Jan 2023 22:21:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232125AbjAMDVB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 12 Jan 2023 22:21:01 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 063C7564CF for <linux-kernel@vger.kernel.org>; Thu, 12 Jan 2023 19:20:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673580017; 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=285BkZEBCnAc+7uwK4L/HsvDVOrMR6yTW3lbxZ2Ub9M=; b=QzZAg26UrDXJ8G5YxvNog7k20SEnKmPBJIZTKb3mTX9RjyC4II2mILmMyKEhKMte1vLyA3 1uhUAKNPo58IRtDl2VpMY3PCV7xPY2GUxHKInWuG1rhAz1zdYkS0sjOI9lpo81hwS9VAha ew1Rz/ruJFre57+oQ+YG3nG13U87WOY= 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-141-u4nw0xOlNvOayULRaj1xFA-1; Thu, 12 Jan 2023 22:20:13 -0500 X-MC-Unique: u4nw0xOlNvOayULRaj1xFA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D52B9101A521; Fri, 13 Jan 2023 03:20:12 +0000 (UTC) Received: from fedora.redhat.com (ovpn-12-229.pek2.redhat.com [10.72.12.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 724094078903; Fri, 13 Jan 2023 03:20:08 +0000 (UTC) From: Baoquan He <bhe@redhat.com> To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, urezki@gmail.com, lstoakes@gmail.com, stephen.s.brennan@oracle.com, willy@infradead.org, akpm@linux-foundation.org, hch@infradead.org, Baoquan He <bhe@redhat.com> Subject: [PATCH v3 7/7] sh: mm: set VM_IOREMAP flag to the vmalloc area Date: Fri, 13 Jan 2023 11:19:21 +0800 Message-Id: <20230113031921.64716-8-bhe@redhat.com> In-Reply-To: <20230113031921.64716-1-bhe@redhat.com> References: <20230113031921.64716-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.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754876080326015031?= X-GMAIL-MSGID: =?utf-8?q?1754876080326015031?= |
Series |
mm/vmalloc.c: allow vread() to read out vm_map_ram areas
|
|
Commit Message
Baoquan He
Jan. 13, 2023, 3:19 a.m. UTC
Currently, for vmalloc areas with flag VM_IOREMAP set, except of the
specific alignment clamping in __get_vm_area_node(), they will be
1) Shown as ioremap in /proc/vmallocinfo;
2) Ignored by /proc/kcore reading via vread()
So for the ioremap in __sq_remap() of sh, we should set VM_IOREMAP
in flag to make it handled correctly as above.
Signed-off-by: Baoquan He <bhe@redhat.com>
---
arch/sh/kernel/cpu/sh4/sq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Fri, Jan 13, 2023 at 11:19:21AM +0800, Baoquan He wrote: > Currently, for vmalloc areas with flag VM_IOREMAP set, except of the > specific alignment clamping in __get_vm_area_node(), they will be > 1) Shown as ioremap in /proc/vmallocinfo; > 2) Ignored by /proc/kcore reading via vread() > > So for the ioremap in __sq_remap() of sh, we should set VM_IOREMAP > in flag to make it handled correctly as above. > > Signed-off-by: Baoquan He <bhe@redhat.com> > --- > arch/sh/kernel/cpu/sh4/sq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c > index a76b94e41e91..27f2e3da5aa2 100644 > --- a/arch/sh/kernel/cpu/sh4/sq.c > +++ b/arch/sh/kernel/cpu/sh4/sq.c > @@ -103,7 +103,7 @@ static int __sq_remap(struct sq_mapping *map, pgprot_t prot) > #if defined(CONFIG_MMU) > struct vm_struct *vma; > > - vma = __get_vm_area_caller(map->size, VM_ALLOC, map->sq_addr, > + vma = __get_vm_area_caller(map->size, VM_IOREMAP, map->sq_addr, > SQ_ADDRMAX, __builtin_return_address(0)); > if (!vma) > return -ENOMEM; > -- > 2.34.1 > Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com> -- Uladzislau Rezki
On Fri, Jan 13, 2023 at 11:19:21AM +0800, Baoquan He wrote: > Currently, for vmalloc areas with flag VM_IOREMAP set, except of the > specific alignment clamping in __get_vm_area_node(), they will be > 1) Shown as ioremap in /proc/vmallocinfo; > 2) Ignored by /proc/kcore reading via vread() > > So for the ioremap in __sq_remap() of sh, we should set VM_IOREMAP > in flag to make it handled correctly as above. > > Signed-off-by: Baoquan He <bhe@redhat.com> > --- > arch/sh/kernel/cpu/sh4/sq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c > index a76b94e41e91..27f2e3da5aa2 100644 > --- a/arch/sh/kernel/cpu/sh4/sq.c > +++ b/arch/sh/kernel/cpu/sh4/sq.c > @@ -103,7 +103,7 @@ static int __sq_remap(struct sq_mapping *map, pgprot_t prot) > #if defined(CONFIG_MMU) > struct vm_struct *vma; > > - vma = __get_vm_area_caller(map->size, VM_ALLOC, map->sq_addr, > + vma = __get_vm_area_caller(map->size, VM_IOREMAP, map->sq_addr, > SQ_ADDRMAX, __builtin_return_address(0)); > if (!vma) > return -ENOMEM; > -- > 2.34.1 > Reviewed-by: Lorenzo Stoakes <lstoakes@gmail.com>
diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c index a76b94e41e91..27f2e3da5aa2 100644 --- a/arch/sh/kernel/cpu/sh4/sq.c +++ b/arch/sh/kernel/cpu/sh4/sq.c @@ -103,7 +103,7 @@ static int __sq_remap(struct sq_mapping *map, pgprot_t prot) #if defined(CONFIG_MMU) struct vm_struct *vma; - vma = __get_vm_area_caller(map->size, VM_ALLOC, map->sq_addr, + vma = __get_vm_area_caller(map->size, VM_IOREMAP, map->sq_addr, SQ_ADDRMAX, __builtin_return_address(0)); if (!vma) return -ENOMEM;