Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp957989pxb; Thu, 15 Apr 2021 10:19:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKn72JekmhsBifDjeTMo4fhcLULq/37m+H9mlJaticG2+B2W+ElnbxbOqrrGJYzP0ce8Sy X-Received: by 2002:a05:6402:151a:: with SMTP id f26mr5533610edw.43.1618507180078; Thu, 15 Apr 2021 10:19:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618507180; cv=none; d=google.com; s=arc-20160816; b=vPLvnHiXnbPegjGQcIEPzJFPHtkP+U+8e1YISfIHtMbmDpf0RXL+NcYepBy8Mu1qQV wAAsdMZli853RVkFQprVKcYmLDC6dC84n2t+0UZJgfirej4tEo1ZpGFTW4/Pd3YU2XYK PD5Tj4WV4oqlYrZTDpe2Nm0jpfIZDMoavFMaPCXbjl1/PvjiSSwc9WdWuhddhTGetSWa b7iwhxHnhS826hmd8LdHquM88c8nH23A2Lc5PEYox6OaLxLTlq6ICdto2EMwXgFaT4pa ntKAsGIizGGzcRBVo6fCbb9jZHdUEtAKPQbdIi9qqqhAn58+4vYIuD+sjrxNxNS+bdlv G/HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:references:in-reply-to :message-id; bh=QMd+cu3dHCLUxai7ooI8glvIxSXVWhjgGRBdVC0942w=; b=e2E/GnU73LqQVKSpCGy9qgSnsxkj4t9A0VXRFpA7mopuQ1HyO/aBvvEJZ2vPMpXAyy u+P4v0+lO6KrCBieYMJhmgqrISRWG30Ua0X9XDl5iqp6xkDZE0cbpcO2tunYMwz9pdeR 4ozXZZJRc6NeG+UdDglN+JdpY1L+gwbK6j7YNeCPtvUwp7h6zBpeRRt92x8VShJ2kdAS mdgsdmIUy3A3jeHUH8aQFREhtq5gw7wrkXxLve85kcUb/y1A0SciVW6Vdmd/E77lMHmu hEucviphvLeTAF0gZ+1s1+zEo47o8/ZSe3ZD7e3A/KnE1CpLlprUG15J9PL69Z31LUTu iwoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bt5si2679871ejb.50.2021.04.15.10.19.16; Thu, 15 Apr 2021 10:19:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234400AbhDORSo (ORCPT + 99 others); Thu, 15 Apr 2021 13:18:44 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:47430 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231726AbhDORSl (ORCPT ); Thu, 15 Apr 2021 13:18:41 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FLmJS2hFmz9twny; Thu, 15 Apr 2021 19:18:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 9TQhOmPalXDv; Thu, 15 Apr 2021 19:18:16 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4FLmJS0s99z9tyvC; Thu, 15 Apr 2021 19:18:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id EE0AA8B804; Thu, 15 Apr 2021 19:18:15 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id HGdgYeJV7C-l; Thu, 15 Apr 2021 19:18:15 +0200 (CEST) Received: from po16121vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A7C3D8B7F6; Thu, 15 Apr 2021 19:18:15 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 85190679F6; Thu, 15 Apr 2021 17:18:15 +0000 (UTC) Message-Id: <9bd00b3ca42dbec81a0139626e780a8f8c871988.1618506910.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v1 2/5] mm: ptdump: Fix build failure To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Steven Price , akpm@linux-foundation.org Cc: linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, x86@kernel.org, linux-mm@kvack.org Date: Thu, 15 Apr 2021 17:18:15 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Fixes: 30d621f6723b ("mm: add generic ptdump") Cc: Steven Price Signed-off-by: Christophe Leroy --- 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)); -- 2.25.0