Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5381305ybf; Wed, 4 Mar 2020 23:35:03 -0800 (PST) X-Google-Smtp-Source: ADFU+vvcNtZ0fEeN22IdQGhW4HDPapXtNw74TLHS7cijJbc1ivpIoR39UXJiNLODSRmtji4dEELD X-Received: by 2002:aca:dc04:: with SMTP id t4mr4513102oig.51.1583393703253; Wed, 04 Mar 2020 23:35:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583393703; cv=none; d=google.com; s=arc-20160816; b=AtrdZv7K+CM5Q/+eLbQCA43ZgRGFc1d+gs8kdVTZvisHQNuVUcwFZLyS7IeC6kCCi2 rfEX3ndnqVvfv2kgWaj3yEupGX5aBvf2w20kU4P89VtNRpIXG7BqDMjZmSZtbkeBEBM/ HqyzJyfwYERfx41I4p9XidI3GFYaRgyCr7tDVnRy63GHqYyjPxteST/0yibEWJKR7BiS d5nriQscJAuox4Vnk0EOEX2AZ0DIWDuIwDTJMb/kH6wlRNJgPSh7EbqGFckOr5fV4+2v lZs9iyIq73hmXPkcSk7PGBAwCb/xJmnGk/1VREBli3K8Ue2sabCf2VJeujvghk3Rm2kK jSpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from; bh=e5fCQI4/ZWc4VXu0K2dlpuK/AQXB00jTpnCz1pt8/bU=; b=iHjLAirNEDGYgjabl34i0smK4RuH4OuUAKt7TK8WHrbBKQxqnF/NOTsx7DCMuoZpQx C07rcZ69F5COcQcFiN5vxsmy9yrqmnLPe6NLge7NGMnhU85KtJJp7Wy0L2h+iqYAdE/0 BN/6NfpalbgFhZ249O5Z9SjZYiCmPQHpQ0Bsy+l7eV/vVQCKPJk3g2O+O/p+rv/RwFN5 hAB7/pu0bM6cO/rDwFvrHcdZBGXzfTVBts3fEegMItGWO/ik0eae7JL+husqPrfxbP1c yQoch3TPIosQE3W1v9A0zjZVFRlidkxdvDqzbJ7OMhW1dHi+GPYYpj7nKNxyRn5tcQAK nQ2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j36si2880985ota.58.2020.03.04.23.34.50; Wed, 04 Mar 2020 23:35:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725948AbgCEHeg (ORCPT + 99 others); Thu, 5 Mar 2020 02:34:36 -0500 Received: from foss.arm.com ([217.140.110.172]:44192 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725866AbgCEHef (ORCPT ); Thu, 5 Mar 2020 02:34:35 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D7F0E1FB; Wed, 4 Mar 2020 23:34:33 -0800 (PST) Received: from [10.163.1.88] (unknown [10.163.1.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B93CE3F534; Wed, 4 Mar 2020 23:38:16 -0800 (PST) From: Anshuman Khandual Subject: Re: [PATCH] mm/special: Create generic fallbacks for pte_special() and pte_mkspecial() To: linux-mm@kvack.org, Ralf Baechle , Paul Burton Cc: Richard Henderson , Ivan Kokshaysky , Matt Turner , Russell King , Guo Ren , Brian Cain , Tony Luck , Fenghua Yu , Geert Uytterhoeven , Sam Creasey , Michal Simek , Nick Hu , Greentime Hu , Vincent Chen , Ley Foon Tan , Jonas Bonn , Stefan Kristiansson , Stafford Horne , "James E.J. Bottomley" , Helge Deller , "David S. Miller" , Jeff Dike , Richard Weinberger , Anton Ivanov , Guan Xuetao , Chris Zankel , Max Filippov , Andrew Morton , linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, nios2-dev@lists.rocketboards.org, openrisc@lists.librecores.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org References: <1583114190-7678-1-git-send-email-anshuman.khandual@arm.com> Message-ID: <58aecdcf-ea16-c958-0deb-97541792e081@arm.com> Date: Thu, 5 Mar 2020 13:04:19 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1583114190-7678-1-git-send-email-anshuman.khandual@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/02/2020 07:26 AM, Anshuman Khandual wrote: > diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h > index aef5378f909c..8e4e4be1ca00 100644 > --- a/arch/mips/include/asm/pgtable.h > +++ b/arch/mips/include/asm/pgtable.h > @@ -269,6 +269,36 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, > */ > extern pgd_t swapper_pg_dir[]; > > +/* > + * Platform specific pte_special() and pte_mkspecial() definitions > + * are required only when ARCH_HAS_PTE_SPECIAL is enabled. > + */ > +#if !defined(CONFIG_32BIT) && !defined(CONFIG_CPU_HAS_RIXI) > +#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) > +static inline int pte_special(pte_t pte) > +{ > + return pte.pte_low & _PAGE_SPECIAL; > +} > + > +static inline pte_t pte_mkspecial(pte_t pte) > +{ > + pte.pte_low |= _PAGE_SPECIAL; > + return pte; > +} > +#else > +static inline int pte_special(pte_t pte) > +{ > + return pte_val(pte) & _PAGE_SPECIAL; > +} > + > +static inline pte_t pte_mkspecial(pte_t pte) > +{ > + pte_val(pte) |= _PAGE_SPECIAL; > + return pte; > +} > +#endif > +#endif > + Hello Ralf/Paul, This change now restricts mips definitions for pte_special() and pte_mkspecial() and makes them visible only for configs where ARCH_HAS_PTE_SPECIAL is enabled. Does this look okay ? In almost all other platforms we drop the stub definitions for pte_special() and pte_mkspecial(). - Anshuman