Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2575551pxb; Mon, 19 Apr 2021 08:45:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHB2vF+vPjGHEMGzI0MGl9Gm7VzB6R6Bi7TIA30H59S+2zPcCPOUrBdUq/1+ltO4I9fXNa X-Received: by 2002:a17:90b:3118:: with SMTP id gc24mr25800050pjb.212.1618847155742; Mon, 19 Apr 2021 08:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618847155; cv=none; d=google.com; s=arc-20160816; b=TN66CdbdckL739Fdiiq9mAIPS2hBiQCvKNi1tJ+cPV2VRJVonMyA2ItcIVQUqQ8W+h B++2pOQRpHisswlCigyUAJPWEkz4ngr9ivvM5eE0lgvVZS5LM6hi/TMOQq5G2pJ3C9/H wPbLIHi4CJTG89IZh3i494GAjxlEJ+lzS43tJYY/DlWc61ewQM9yZXMVMJWqxonCyJq9 hfC9iSPKXmAcVmjNWJiN72vGxvo9ocf/SykAZklufSRbSHZ66txrGnCD/fU9GSYQu5tM gF9K0m3l71PZFETRoKE8i5gPYzhIyFe8ryMS207BDKHtqw0TLTGzLeRliw1mlviGz7rk u9aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8NfpGQSRi+G4OWyeAnBhawkhvZcneESDhJ9X7+sDPuc=; b=RxjJnuuO9pWcRkMc4L3qPVE7lUmCbjyPKSKjSljWvjPFm/fKFHZ3yVUTtkuXqKhacb brJ3UZpbjzV8GRmAeigOkjSCX7UMaZUlpTyDxHN+u/8l0jBm4Br6trkLnap4WCTBmkcs S+ekzf+bCH9lOZS2Tf825rkBWtkkX1LgImibtWNxFEDrJY71G2hw80NegA2kYkROwfj7 TtpaDemqdtURVP4zUJNKf3biFbFq+5y7RGyiVP/HDnss6GqXKufiELn9RK/BmyN0huoh lpLu+KqeHucAROJ1lEyD062qWyE0xCg0VBzseXkjfKRdiigwFWx4GZ9BAIOCOQ+wP49T D/kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cgFzbHsq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h123si17759571pfb.149.2021.04.19.08.45.40; Mon, 19 Apr 2021 08:45:55 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cgFzbHsq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242097AbhDSN2K (ORCPT + 99 others); Mon, 19 Apr 2021 09:28:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:54232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241371AbhDSNU2 (ORCPT ); Mon, 19 Apr 2021 09:20:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1B614613EE; Mon, 19 Apr 2021 13:16:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838184; bh=0QGXaRb1zXx6ynmsvEGIhmYfaVo4h7+3dGqMuIFkIIY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cgFzbHsqt8PRQoOV0oK3/CtYF06ncUWV5Uzyx6Q8YSJ/Ohrqr87AsMlGnCnawCRnd GZ/O2a0pFg/R9CkJJ79VcqUOcOvW6+o0U8a4W3/1oeFlquhTDsoLtDQjj8F+Wxjz5w 7Kq/5mAw+G2tteCdYphPje/Lvvshus8/UDfBnSsE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy , Steven Price , Andrew Morton , Linus Torvalds Subject: [PATCH 5.10 072/103] mm: ptdump: fix build failure Date: Mon, 19 Apr 2021 15:06:23 +0200 Message-Id: <20210419130530.292725833@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130527.791982064@linuxfoundation.org> References: <20210419130527.791982064@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe Leroy commit 458376913d86bed2fb781b4952eb6861675ef3be upstream. READ_ONCE() cannot be used for reading PTEs. Use ptep_get() instead, to avoid the following errors: 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 See commit 481e980a7c19 ("mm: Allow arches to provide ptep_get()") and commit c0e1c8c22beb ("powerpc/8xx: Provide ptep_get() with 16k pages") for details. Link: https://lkml.kernel.org/r/912b349e2bcaa88939904815ca0af945740c6bd4.1618478922.git.christophe.leroy@csgroup.eu Fixes: 30d621f6723b ("mm: add generic ptdump") Signed-off-by: Christophe Leroy Cc: Steven Price Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/ptdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/ptdump.c +++ b/mm/ptdump.c @@ -108,7 +108,7 @@ static int ptdump_pte_entry(pte_t *pte, 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));