From patchwork Tue May 8 14:59:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 10386291 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 84A97602D8 for ; Tue, 8 May 2018 15:00:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 738CA28E16 for ; Tue, 8 May 2018 15:00:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D57C28DBD; Tue, 8 May 2018 15:00:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7734F28DBD for ; Tue, 8 May 2018 15:00:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9E5916B0293; Tue, 8 May 2018 11:00:02 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 994CA6B0294; Tue, 8 May 2018 11:00:02 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 85B9E6B0295; Tue, 8 May 2018 11:00:02 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f198.google.com (mail-pf0-f198.google.com [209.85.192.198]) by kanga.kvack.org (Postfix) with ESMTP id 44DF66B0294 for ; Tue, 8 May 2018 11:00:02 -0400 (EDT) Received: by mail-pf0-f198.google.com with SMTP id g1so24634870pfh.19 for ; Tue, 08 May 2018 08:00:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=MpISJ4BK84c+dseMztOjsncOZniVagiPiRVh4R4ZxxQ=; b=O/xnx8UY/mKQPYboSSzCxh3W4d8RWEach6EIWO0dJjuyDkN1r1TYKQ+c8ElvV8DuyI qZAu1QD9stjV1OcOV0VVtFtPLeYVmKhRT20UhkCm+imYTORK3mXtyXCwBFOCSOT1A0LS 2F8vPyCGESyVn83O09HQrD3ijmU9toY0jvNHDHEocHosvL/zkWCrWDc9JMZLvK6V/lzf sYUaQbFF/pXUiZwHjD/MvSOhFzJY5XxXo1PYaykjxMxw8Ic8kUu/jQEwcQ6/DB+e99Pe GpwLfF6m9M5T9km9zU9tIv1K2zzSfq1aiXAY2E/E7f2E+TSalySTwtMq9XbPfBW2aFzn pNFA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of michael@ozlabs.org designates 2401:3900:2:1::2 as permitted sender) smtp.mailfrom=michael@ozlabs.org X-Gm-Message-State: ALQs6tAZWxS7lx/t1yv0mFmCuMXazsxDY/ssot8LAQ9XhfYq9Mx0+nw+ dNApC8Bhx6snqM0yXHgw+XxXRIYyK3L5e0SAyGG6V3w9grfnlpDoHSrci+Vv+Ci3rZV2CD2ebVN T5h9iMuabEE/zzVbxhU5NlU5Cw0T1FrZkouRTaKQBkuKxEs82/nvOvn5kFh55GMg= X-Received: by 10.98.0.194 with SMTP id 185mr40469735pfa.238.1525791601958; Tue, 08 May 2018 08:00:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq8PJkDwDxuR1oecBr6eXA29lSy2rQ+R1mS96cU2URE/b8AviywSWekBoLFgJFw2kXLF7PK X-Received: by 10.98.0.194 with SMTP id 185mr40469690pfa.238.1525791601147; Tue, 08 May 2018 08:00:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525791601; cv=none; d=google.com; s=arc-20160816; b=Q7kCY/Rnm9hjU4I01gG55cke8KWNFEZjzQQrNE+AQR1PFSpfzs/7Br0l9354LBd5c+ MCulTpnpw1Xr00nZylx941SDgCa/rpstThl1Zb0u5z3tMCP4BHTOCT/exNDWoy2iRmN0 0GgvPvJK0jUSVHjF+PLl2QjlThcSV4zh3W7HHl96S6Y1Osneg6T4ON+o35o6BHoT15dJ o+N8EZfM05AU54JS+frVa2oDXx0uSAvo9ZBMh6fJaVkOcj3DNHJomhsnQtbp52lzi5YY QJpOfPz/A5d1gfGPniULtD3P9LUV/0F5/0XWr/QSt0CkC4GS6gC0bDy1QZzKsucKx26T gZdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=MpISJ4BK84c+dseMztOjsncOZniVagiPiRVh4R4ZxxQ=; b=PVfI8R23yEWR87P3ZlczxRPGVlc3NGb9ETfu3GOZ6I2/EVIl135QiJbvQB4Et9g2wY pZIx0qJGXY7YbRhMgvIcCMIFBwgyBbuj6lUp7EN4WWm1zmTVtRchEaWeVMR3kg1GIT7u FLQc1zbkqjaAawwY7qPsjbXuJNo+2MkWf5jyZjs5WFCXjlytaYUbUPjOpumMRLrZIdUw GWwGYaN4X5Rzft8329klypeymOTqhTgfd6PQ/k1EpWbJ614/QhC/QW3Tn3X7WO7ennbg HMV0evdM04ZxGdUDDRzcxKFXB77EbIKHzN1DgpufGDhZ63Boa7VmdMVX53LpmsWTNa2V zjHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of michael@ozlabs.org designates 2401:3900:2:1::2 as permitted sender) smtp.mailfrom=michael@ozlabs.org Received: from ozlabs.org (ozlabs.org. [2401:3900:2:1::2]) by mx.google.com with ESMTPS id k189-v6si19544273pgc.388.2018.05.08.08.00.00 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 May 2018 08:00:01 -0700 (PDT) Received-SPF: pass (google.com: domain of michael@ozlabs.org designates 2401:3900:2:1::2 as permitted sender) client-ip=2401:3900:2:1::2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of michael@ozlabs.org designates 2401:3900:2:1::2 as permitted sender) smtp.mailfrom=michael@ozlabs.org Received: by ozlabs.org (Postfix, from userid 1034) id 40gN2660bqz9s4n; Wed, 9 May 2018 00:59:58 +1000 (AEST) From: Michael Ellerman To: linuxram@us.ibm.com Cc: mingo@redhat.com, linuxppc-dev@ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-kernel@vger.kernel.org, dave.hansen@intel.com Subject: [PATCH 4/8] mm/pkeys, powerpc, x86: Provide an empty vma_pkey() in linux/pkeys.h Date: Wed, 9 May 2018 00:59:44 +1000 Message-Id: <20180508145948.9492-5-mpe@ellerman.id.au> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180508145948.9492-1-mpe@ellerman.id.au> References: <20180508145948.9492-1-mpe@ellerman.id.au> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000017, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Consolidate the pkey handling by providing a common empty definition of vma_pkey() in pkeys.h when CONFIG_ARCH_HAS_PKEYS=n. This also removes another entanglement of pkeys.h and asm/mmu_context.h. Signed-off-by: Michael Ellerman Reviewed-by: Ram Pai Reviewed-by: Dave Hansen --- arch/powerpc/include/asm/mmu_context.h | 5 ----- arch/x86/include/asm/mmu_context.h | 5 ----- include/linux/pkeys.h | 5 +++++ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h index 1835ca1505d6..896efa559996 100644 --- a/arch/powerpc/include/asm/mmu_context.h +++ b/arch/powerpc/include/asm/mmu_context.h @@ -250,11 +250,6 @@ static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, #define thread_pkey_regs_restore(new_thread, old_thread) #define thread_pkey_regs_init(thread) -static inline int vma_pkey(struct vm_area_struct *vma) -{ - return 0; -} - static inline u64 pte_to_hpte_pkey_bits(u64 pteflags) { return 0x0UL; diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h index 57e3785d0d26..3d748bdf44a7 100644 --- a/arch/x86/include/asm/mmu_context.h +++ b/arch/x86/include/asm/mmu_context.h @@ -296,11 +296,6 @@ static inline int vma_pkey(struct vm_area_struct *vma) return (vma->vm_flags & vma_pkey_mask) >> VM_PKEY_SHIFT; } -#else -static inline int vma_pkey(struct vm_area_struct *vma) -{ - return 0; -} #endif /* diff --git a/include/linux/pkeys.h b/include/linux/pkeys.h index ed06e1a67bfa..aad54663763b 100644 --- a/include/linux/pkeys.h +++ b/include/linux/pkeys.h @@ -13,6 +13,11 @@ #define PKEY_DEDICATED_EXECUTE_ONLY 0 #define ARCH_VM_PKEY_FLAGS 0 +static inline int vma_pkey(struct vm_area_struct *vma) +{ + return 0; +} + static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) { return (pkey == 0);