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=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 6913AC433ED for ; Fri, 16 Apr 2021 08:42:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D728661166 for ; Fri, 16 Apr 2021 08:42:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D728661166 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3FA346B0036; Fri, 16 Apr 2021 04:42:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 383F76B006C; Fri, 16 Apr 2021 04:42:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1FDFC6B0070; Fri, 16 Apr 2021 04:42:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0180.hostedemail.com [216.40.44.180]) by kanga.kvack.org (Postfix) with ESMTP id 004916B0036 for ; Fri, 16 Apr 2021 04:42:21 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A7F531820827E for ; Fri, 16 Apr 2021 08:42:21 +0000 (UTC) X-FDA: 78037588482.04.B311366 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf05.hostedemail.com (Postfix) with ESMTP id 548F9E000105 for ; Fri, 16 Apr 2021 08:42:20 +0000 (UTC) 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 11A64106F; Fri, 16 Apr 2021 01:42:20 -0700 (PDT) Received: from [192.168.1.179] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 43FFA3FA45; Fri, 16 Apr 2021 01:42:19 -0700 (PDT) Subject: Re: [PATCH] mm: ptdump: Fix build failure To: Christophe Leroy , Andrew Morton Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org References: <912b349e2bcaa88939904815ca0af945740c6bd4.1618478922.git.christophe.leroy@csgroup.eu> From: Steven Price Message-ID: Date: Fri, 16 Apr 2021 09:42:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <912b349e2bcaa88939904815ca0af945740c6bd4.1618478922.git.christophe.leroy@csgroup.eu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Stat-Signature: fhng739kqh8qftt17qud5ngyzex7cchk X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 548F9E000105 Received-SPF: none (arm.com>: No applicable sender policy available) receiver=imf05; identity=mailfrom; envelope-from=""; helo=foss.arm.com; client-ip=217.140.110.172 X-HE-DKIM-Result: none/none X-HE-Tag: 1618562540-323202 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: On 15/04/2021 10:31, Christophe Leroy wrote: > CC mm/ptdump.o > In file included from : > mm/ptdump.c: In function 'ptdump_pte_entry': > ././include/linux/compiler_types.h:320:38: error: call to '__compiletime_assert_207' declared with attribute error: Unsupported access size for {READ,WRITE}_ONCE(). > 320 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > | ^ > ././include/linux/compiler_types.h:301:4: note: in definition of macro '__compiletime_assert' > 301 | prefix ## suffix(); \ > | ^~~~~~ > ././include/linux/compiler_types.h:320:2: note: in expansion of macro '_compiletime_assert' > 320 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > | ^~~~~~~~~~~~~~~~~~~ > ./include/asm-generic/rwonce.h:36:2: note: in expansion of macro 'compiletime_assert' > 36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ > | ^~~~~~~~~~~~~~~~~~ > ./include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type' > 49 | compiletime_assert_rwonce_type(x); \ > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > mm/ptdump.c:114:14: note: in expansion of macro 'READ_ONCE' > 114 | pte_t val = READ_ONCE(*pte); > | ^~~~~~~~~ > make[2]: *** [mm/ptdump.o] Error 1 > > READ_ONCE() cannot be used for reading PTEs. Use ptep_get() > instead. See commit 481e980a7c19 ("mm: Allow arches to provide ptep_get()") > and commit c0e1c8c22beb ("powerpc/8xx: Provide ptep_get() with 16k pages") > for details. It was cargo-culted from the arm64/x86 implementations (where this happens to be safe). > Fixes: 30d621f6723b ("mm: add generic ptdump") > Cc: Steven Price > Signed-off-by: Christophe Leroy Reviewed-by: Steven Price Thanks, Steve > --- > mm/ptdump.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/ptdump.c b/mm/ptdump.c > index 4354c1422d57..da751448d0e4 100644 > --- a/mm/ptdump.c > +++ b/mm/ptdump.c > @@ -111,7 +111,7 @@ static int ptdump_pte_entry(pte_t *pte, unsigned long addr, > unsigned long next, struct mm_walk *walk) > { > struct ptdump_state *st = walk->private; > - pte_t val = READ_ONCE(*pte); > + pte_t val = ptep_get(pte); > > if (st->effective_prot) > st->effective_prot(st, 4, pte_val(val)); >