Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2114716iof; Tue, 7 Jun 2022 20:13:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5QMltqhvBtE/mNXwzDJi86GSlK7oapUjxYfk6Jl+KXu6oivrw6QM3Y8OqIXXdEEeI/Mm8 X-Received: by 2002:a63:5f53:0:b0:3fc:c510:c4a0 with SMTP id t80-20020a635f53000000b003fcc510c4a0mr28414406pgb.80.1654658021898; Tue, 07 Jun 2022 20:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654658021; cv=none; d=google.com; s=arc-20160816; b=DbOhoEAO1FMasMUMc/0nGLzrIK2k9J6BdKCt2KOfk+tNgPGoaI2rQzuBZC1JnuPA6V 7p3Cs4EcIUhQfFSbjrrhZ6qIyWO0A1sDnR5cN7vALP12+Zlx6lfQ6CZITFzpteN5p5Pi fLzWR0sdhaen5hJYF9OFgKbg60pePMyH7Q8OFzDK3JTlvSD4CqGpyCeDx/TOEiiCbTRy k5BcUbkt4Y7vpSFvjWJVcI+D2rq2KIf7zKqqlfRBrwqAr6KwP3/IbumuLwc/l75h+UGQ tOoiXld5VEYRXmRNyOMzC8AiCrLhBbn6N5WW79B08aF3H7rVfihO3JH6f3pz8OwspV67 Ie8w== 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 :message-id:date:subject:cc:to:from; bh=lV03BXyJkwKkxJBIQS4jh+14Ws7HzT+wG2ix+NuZRv0=; b=cmwKADisvSfRvK1MPPndhZp9q3eIg6qKMQN4tQjdABZlkUN7WAqeQdHi269O1j378e 3eHSpgM2ccupAMc1mC/3lNOYhG3nfla7xhEnkVQsiFYw2RNAMRU6BR75BTtO2qptER3N nB4m6R6BQnoEQhkd+E9hiobHf4FwTM6cCbH6QPWx0gdw4QfXwXibBhF0/5cWI5HYeUjs RwL4B3yJZLjwnIlPE+aVQMhcLM7lH1euRp3d95MK7hFLZKiEnWl+WH/df+e6PlCHc6bX lbnYMLiGGwNVi5zAV5CmKbESgc5EiCN+2K+lJiRc7Aj+0+Q+L5z5RBreS6BjgHccWo2U gc+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e11-20020a170903240b00b001588973b195si4373270plo.436.2022.06.07.20.13.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 20:13:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 989C634B196; Tue, 7 Jun 2022 19:16:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243922AbiFGMkz (ORCPT + 99 others); Tue, 7 Jun 2022 08:40:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243905AbiFGMkx (ORCPT ); Tue, 7 Jun 2022 08:40:53 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 059CE336 for ; Tue, 7 Jun 2022 05:40:50 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4LHVKK30Lbz1KF0t; Tue, 7 Jun 2022 20:39:01 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 7 Jun 2022 20:40:48 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 7 Jun 2022 20:40:48 +0800 From: Kefeng Wang To: , , , , CC: , , , , Kefeng Wang Subject: [PATCH v5 0/6] arm64: Cleanup ioremap() and support ioremap_prot() Date: Tue, 7 Jun 2022 20:50:21 +0800 Message-ID: <20220607125027.44946-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org 1. Enhance generic ioremap to make it more useful. 2. Let's arm64 use GENERIC_IOREMAP to cleanup code. 3. Support HAVE_IOREMAP_PROT on arm64, which enable generic_access_phys(), it is useful when debug(eg, gdb) via access_process_vm device memory infrastructure. v5: - break long lines(> 80 cols), per Christoph Hellwig - move is_vmalloc_addr() check from arm64 into generic ioremap, per Christoph Hellwig - make arm64's ioremap_cache as an inline function, per Christoph - keep changes simple, make ioremap/iounmap_allowed return bool, per Baoquan He - simplify use 'void *' instead of 'void __iomem *' in iounmap, then drop __force annotation v4: - update based on v5.19-rc1 - add generic arch_ioremap/arch_iounmap define, per Andrew Monrton - simply return an int for arch_ioremap and rename arch_ioremap/arch_iounmap to a better name, ioremap_allowed/iounmap_allowed, per Arnd Bergmann - add __force annotation to slince sparse warning in vunmap() Note, 1) after the renaming, the arm's change(patch1) is not the necessary dependence for the following changes, but as a cleanup, still post it here, hope it go in via the arm64 tree with reset of the series directly if no object. 2) the changes in this version only influence on patch4/5, so retain the ack/review. v3: - add cleanup patch to kill ARM's unused arch_iounmap(the naming will be used in GENERIC_IOREMAP) and add comments for arch_ioremap/arch_iounmap hooks, per Anshuman Khandual - collect ack/review v2: - s/addr/phys_addr in ioremap_prot, suggested by Andrew Morton - rename arch_ioremap/iounmap_check to arch_ioremap/iounmap and change return value, per Christoph Hellwig and Andrew Morton - and use 'ifndef arch_ioremap' instead of weak function, per Arnd Bergmann - collect ack/review Kefeng Wang (6): ARM: mm: kill unused runtime hook arch_iounmap() mm: ioremap: Use more sensibly name in ioremap_prot() mm: ioremap: Setup phys_addr of struct vm_struct mm: ioremap: Add ioremap/iounmap_allowed() arm64: mm: Convert to GENERIC_IOREMAP arm64: Add HAVE_IOREMAP_PROT support .../features/vm/ioremap_prot/arch-support.txt | 2 +- arch/arm/include/asm/io.h | 4 +- arch/arm/mm/ioremap.c | 9 +- arch/arm/mm/nommu.c | 9 +- arch/arm64/Kconfig | 2 + arch/arm64/include/asm/io.h | 24 +++-- arch/arm64/include/asm/pgtable.h | 10 +++ arch/arm64/kernel/acpi.c | 2 +- arch/arm64/mm/hugetlbpage.c | 10 --- arch/arm64/mm/ioremap.c | 90 ++----------------- include/asm-generic/io.h | 29 +++++- mm/ioremap.c | 26 ++++-- 12 files changed, 90 insertions(+), 127 deletions(-) -- 2.35.3