From patchwork Tue May 26 18:54:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 225331 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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 B5816C433E2 for ; Tue, 26 May 2020 19:15:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D12F208B3 for ; Tue, 26 May 2020 19:15:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590520559; bh=8EHIuE6iYwokYmh63YQ56iTYoT3GD4uGo80Ycpl/vbs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=LfULY/v2zChDgboMm/gxqNg/zWQMW+3FqZJeowO+C+/Qy9t1gm7iSCSaKjiHnfAcc OHS31V7AmCbENKzSwvbTQWjfpq6QY9QIxUM1gR7RwasALy9RKd/OeBUV0vqraQEqzE QVbJ5+W2uF2qQtHEg1A/yq2omnZOoB4NGONBQ+lQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404315AbgEZTP5 (ORCPT ); Tue, 26 May 2020 15:15:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:47992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404596AbgEZTP5 (ORCPT ); Tue, 26 May 2020 15:15:57 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0DFF0208B3; Tue, 26 May 2020 19:15:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590520556; bh=8EHIuE6iYwokYmh63YQ56iTYoT3GD4uGo80Ycpl/vbs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KNWetRJgnzAwhULPOOHFxPXjsB36ZkuOBOIQ/4B2TQUATDZ3Pniftk6ibgvDMBYNU VnyZHD6JPiI5hvLddsjgsCIcwkOvEvFxVkg2o5iqiMAYwqUMELSJutMeD9UHS7uoPu iHSx8aPgyGEq9jpUiadCSr3LIsgBA7H4A8DS8V9s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Rapoport , "David S. Miller" , Anatoly Pugachev , Linus Torvalds Subject: [PATCH 5.6 112/126] sparc32: fix page table traversal in srmmu_nocache_init() Date: Tue, 26 May 2020 20:54:09 +0200 Message-Id: <20200526183946.948924707@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526183937.471379031@linuxfoundation.org> References: <20200526183937.471379031@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mike Rapoport commit 0cfc8a8d70dcd51db783e8e87917e02149c71458 upstream. The srmmu_nocache_init() uses __nocache_fix() macro to add an offset to page table entry to access srmmu_nocache_pool. But since sparc32 has only three actual page table levels, pgd, p4d and pud are essentially the same thing and pgd_offset() and p4d_offset() are no-ops, the __nocache_fix() should be done only at PUD level. Remove __nocache_fix() for p4d_offset() and pud_offset() and keep it only for PUD and lower levels. Fixes: c2bc26f7ca1f ("sparc32: use PUD rather than PGD to get PMD in srmmu_nocache_init()") Signed-off-by: Mike Rapoport Cc: David S. Miller Cc: Anatoly Pugachev Cc: Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- arch/sparc/mm/srmmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c @@ -331,8 +331,8 @@ static void __init srmmu_nocache_init(vo while (vaddr < srmmu_nocache_end) { pgd = pgd_offset_k(vaddr); - p4d = p4d_offset(__nocache_fix(pgd), vaddr); - pud = pud_offset(__nocache_fix(p4d), vaddr); + p4d = p4d_offset(pgd, vaddr); + pud = pud_offset(p4d, vaddr); pmd = pmd_offset(__nocache_fix(pud), vaddr); pte = pte_offset_kernel(__nocache_fix(pmd), vaddr);