From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT 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 4E072C04AB6 for ; Mon, 3 Jun 2019 07:45:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C17B27CF3 for ; Mon, 3 Jun 2019 07:45:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726693AbfFCHpW (ORCPT ); Mon, 3 Jun 2019 03:45:22 -0400 Received: from verein.lst.de ([213.95.11.211]:55235 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725975AbfFCHpW (ORCPT ); Mon, 3 Jun 2019 03:45:22 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 2E3F867358; Mon, 3 Jun 2019 09:44:56 +0200 (CEST) Date: Mon, 3 Jun 2019 09:44:55 +0200 From: Christoph Hellwig To: Hillf Danton Cc: Christoph Hellwig , Linus Torvalds , Paul Burton , James Hogan , Yoshinori Sato , Rich Felker , "David S. Miller" , Nicholas Piggin , Khalid Aziz , Andrey Konovalov , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linux-mips@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 10/16] sparc64: use the generic get_user_pages_fast code Message-ID: <20190603074455.GC22920@lst.de> References: <20190601074959.14036-1-hch@lst.de> <20190601074959.14036-11-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190601074959.14036-11-hch@lst.de> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On Sun, Jun 02, 2019 at 03:39:48PM +0800, Hillf Danton wrote: > > Hi Christoph > > On Sat, 1 Jun 2019 09:49:53 +0200 Christoph Hellwig wrote: > > > > diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h > > index a93eca29e85a..2301ab5250e4 100644 > > --- a/arch/sparc/include/asm/pgtable_64.h > > +++ b/arch/sparc/include/asm/pgtable_64.h > > @@ -1098,6 +1098,24 @@ static inline unsigned long untagged_addr(unsigned long start) > > } > > #define untagged_addr untagged_addr > > > > +static inline bool pte_access_permitted(pte_t pte, bool write) > > +{ > > + u64 prot; > > + > > + if (tlb_type == hypervisor) { > > + prot = _PAGE_PRESENT_4V | _PAGE_P_4V; > > + if (prot) > > Feel free to correct me if I misread or miss anything. > It looks like a typo: s/prot/write/, as checking _PAGE_PRESENT_4V and > _PAGE_P_4V makes prot always have _PAGE_WRITE_4V set, regardless of write. True, the if prot should be if write.