From patchwork Tue Jan 12 17:01:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 12014143 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53750C433E0 for ; Tue, 12 Jan 2021 17:06:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F173A2312E for ; Tue, 12 Jan 2021 17:06:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F173A2312E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7317B8D00FF; Tue, 12 Jan 2021 12:06:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6E0C48D00F6; Tue, 12 Jan 2021 12:06:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5D12B8D00FF; Tue, 12 Jan 2021 12:06:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0040.hostedemail.com [216.40.44.40]) by kanga.kvack.org (Postfix) with ESMTP id 474438D00F6 for ; Tue, 12 Jan 2021 12:06:04 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0CA831DF9 for ; Tue, 12 Jan 2021 17:06:04 +0000 (UTC) X-FDA: 77697750648.28.match32_520659027517 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 01FB95DF5 for ; Tue, 12 Jan 2021 17:04:51 +0000 (UTC) X-HE-Tag: match32_520659027517 X-Filterd-Recvd-Size: 3333 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Tue, 12 Jan 2021 17:04:51 +0000 (UTC) Message-Id: <20210112170411.056306194@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1610471090; 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: references:references; bh=ILrs8j28FO3zCfEleUzqqCm1xJVBHSVkYVI9ahwbtj0=; b=tb0Nw+JZctFWFFRaYBghqD30vzGGQq0xZ63WD+mafLo/BbBc9IVaP8WGFGYad7u0ml8URq MM2KCJ99mn7EnO4DDfE2431luacWhtmKhXlaq0vtVViKN9hEh6EqQ6EEGU1SK7iKJAUtxF 6cJfw7YGjQG3uDHarORNdNFeFkG42Auy8GxlmR5r9OuJYWsGvaOydpAsjyjFZ59dpikzAv adffa4Gr/O9qBds6RcF/6iPj7bXa8GgnMSOwrc+bWGTmrrgvpFlNTXznqRZ9EOcVSkGNWZ Xz+9vdXq1tYzgleIhIkKw6cAVNztEHnyNgmtfDgIc3HK5dEei5vepwA9ri3nAA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1610471090; 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: references:references; bh=ILrs8j28FO3zCfEleUzqqCm1xJVBHSVkYVI9ahwbtj0=; b=0NjtFpZUXugW2G2xT1Np0nXncnyBC7n1Akw+1YIn8I0EsqwCJze0+mqAfufkzOFyuLZc+S +KihGneOryXKSwBA== Date: Tue, 12 Jan 2021 18:01:38 +0100 From: Thomas Gleixner To: LKML Cc: Andrew Morton , linux-mm@kvack.org, Peter Zijlstra , Andreas Larsson , "David S. Miller" , sparclinux@vger.kernel.org, Paul Cercueil , Thomas Bogendoerfer , Michael Ellerman , linuxppc-dev@lists.ozlabs.org Subject: [patch 2/4] mm/highmem: Prepare for overriding set_pte_at() References: <20210112170136.078559026@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit 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: The generic kmap_local() map function uses set_pte_at(), but MIPS requires set_pte() and PowerPC wants __set_pte_at(). Provide arch_kmap_local_set_pte() and default it to set_pte_at(). Signed-off-by: Thomas Gleixner --- mm/highmem.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/mm/highmem.c +++ b/mm/highmem.c @@ -473,6 +473,11 @@ static inline void *arch_kmap_local_high } #endif +#ifndef arch_kmap_local_set_pte +#define arch_kmap_local_set_pte(mm, vaddr, ptep, ptev) \ + set_pte_at(mm, vaddr, ptep, ptev) +#endif + /* Unmap a local mapping which was obtained by kmap_high_get() */ static inline bool kmap_high_unmap_local(unsigned long vaddr) { @@ -515,7 +520,7 @@ void *__kmap_local_pfn_prot(unsigned lon vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); BUG_ON(!pte_none(*(kmap_pte - idx))); pteval = pfn_pte(pfn, prot); - set_pte_at(&init_mm, vaddr, kmap_pte - idx, pteval); + arch_kmap_local_set_pte(&init_mm, vaddr, kmap_pte - idx, pteval); arch_kmap_local_post_map(vaddr, pteval); current->kmap_ctrl.pteval[kmap_local_idx()] = pteval; preempt_enable();