Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp180024imm; Fri, 5 Oct 2018 01:50:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV62ra+lrA6pHKMgOLm8g4pYM/0o+57nD7IU1O9RRpUvErXTJ2gGFDzMzsQitsBZGuc1TE1yD X-Received: by 2002:a63:2587:: with SMTP id l129-v6mr9170007pgl.29.1538729452578; Fri, 05 Oct 2018 01:50:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538729452; cv=none; d=google.com; s=arc-20160816; b=Dcjfmj5CAqDbKyP7lmMVxHZ5M0q823jGMnWIWuBRIcA6YacIdxJukAXM5H6Vs5sZXl wY/VuzUmNx/39kcEzpviKec6EI/fsMWapNJ0bWusy1QBeYMgoj9MkLyTtmzKT9foWwG6 7VWscAvTZlT3PWKNQyg1sTCtAeO0U1nZEr1kTP1CdOJDa4yfAHYxzCn5T+s76+l7meog IB7rwISWuC+Oqbz0DdsmwlOCPnDmIAPr75MQlOD9h/5C//UFXfncR8EpHsR+Gs+CyjLM uhvw6Mqe2rQfReKk4Ep38f8EBZwIxJQtI6tu/bUaQObosGPtsHtOXq3alFWYNIVaca6E 9JMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=npue0S9qngdRfocSnc2TJI6vLsApR4OXDeytfCminkA=; b=S9xofeiX9rWdqVb+5thYYXlCuKjO9QGKM8bDoV3Qnobhx6Igs5WQrpqc6dSln5SM9u F+F1uVS4KH/iN+vboUzYpzlK2eAX1akZPgLyEtLxmjqNYClS4stxc3tQSdnSDhuXoM+g FT5WeqeJ4om8Zugk3j64oOolvJMcrgo8ydjmLCY9wCAvu2ajbD1vnTB3dB1CBHTU6Y+M bBETJ7i+h/qu301NcZvjy6EbdxG3h6cUqTbOuzvC7q/RgwWYTZYzDlEq4wE+Quz5lAcV NM75o+FdlJSeam009q5xNNrIf4NDA9RNxgpCu3L06lSa8TOm+GLnWJW1smAgpt360jq8 gnvQ== 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 29-v6si8132838pgl.104.2018.10.05.01.50.36; Fri, 05 Oct 2018 01:50:52 -0700 (PDT) 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 S1728804AbeJEPrw (ORCPT + 99 others); Fri, 5 Oct 2018 11:47:52 -0400 Received: from foss.arm.com ([217.140.101.70]:47856 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728587AbeJEPrv (ORCPT ); Fri, 5 Oct 2018 11:47:51 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7DE9815BF; Fri, 5 Oct 2018 01:50:07 -0700 (PDT) Received: from moonbear.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 48FD03F5B3; Fri, 5 Oct 2018 01:50:04 -0700 (PDT) From: Kristina Martsenko To: linux-arm-kernel@lists.infradead.org Cc: Adam Wallis , Amit Kachhap , Andrew Jones , Ard Biesheuvel , Arnd Bergmann , Catalin Marinas , Christoffer Dall , Dave P Martin , Jacob Bramley , Kees Cook , Marc Zyngier , Mark Rutland , Ramana Radhakrishnan , "Suzuki K . Poulose" , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 06/17] asm-generic: mm_hooks: allow hooks to be overridden individually Date: Fri, 5 Oct 2018 09:47:43 +0100 Message-Id: <20181005084754.20950-7-kristina.martsenko@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181005084754.20950-1-kristina.martsenko@arm.com> References: <20181005084754.20950-1-kristina.martsenko@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Rutland Currently, an architecture must either implement all of the mm hooks itself, or use all of those provided by the asm-generic implementation. When an architecture only needs to override a single hook, it must copy the stub implementations from the asm-generic version. To avoid this repetition, allow each hook to be overridden indiviually, by placing each under an #ifndef block. As architectures providing their own hooks can't include this file today, this shouldn't adversely affect any existing hooks. Signed-off-by: Mark Rutland Signed-off-by: Kristina Martsenko Acked-by: Arnd Bergmann Cc: linux-arch@vger.kernel.org --- include/asm-generic/mm_hooks.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/asm-generic/mm_hooks.h b/include/asm-generic/mm_hooks.h index 8ac4e68a12f0..2b3ee15d3702 100644 --- a/include/asm-generic/mm_hooks.h +++ b/include/asm-generic/mm_hooks.h @@ -7,31 +7,42 @@ #ifndef _ASM_GENERIC_MM_HOOKS_H #define _ASM_GENERIC_MM_HOOKS_H +#ifndef arch_dup_mmap static inline int arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm) { return 0; } +#endif +#ifndef arch_exit_mmap static inline void arch_exit_mmap(struct mm_struct *mm) { } +#endif +#ifndef arch_unmap static inline void arch_unmap(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long start, unsigned long end) { } +#endif +#ifndef arch_bprm_mm_init static inline void arch_bprm_mm_init(struct mm_struct *mm, struct vm_area_struct *vma) { } +#endif +#ifndef arch_vma_access_permitted static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, bool write, bool execute, bool foreign) { /* by default, allow everything */ return true; } +#endif + #endif /* _ASM_GENERIC_MM_HOOKS_H */ -- 2.11.0