Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3409808rwa; Tue, 23 Aug 2022 04:25:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR7YbL5LNcTs7N4wtQz5NCpEIp8yC4bi640mNXbR8gqBPXw97anfuu47xJ6jORAkTSYYmPuR X-Received: by 2002:a17:90a:cc01:b0:1fa:cfad:dfe0 with SMTP id b1-20020a17090acc0100b001facfaddfe0mr2930741pju.244.1661253941401; Tue, 23 Aug 2022 04:25:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253941; cv=none; d=google.com; s=arc-20160816; b=YGCOHKOfTGuTEmAarEEL11+YN/FTcEqkE0Q9+kPIGUhu81ZkEPY5WAVk8rPh+oOZFt K4/mSfi2XOQJWvg+sj6SvhxWw1KtnshhGORADzA1hbvDtYeAhdkmPwPm/atg2K0JTRm+ W4kPt4c4PrkEx904qy/6NarzJgugDMCtlwnASrC2canS+OfsFEh55wVEGb7EC/t3zMhI qkGaFRW/kt7hVtkfTmAR63IJr+rsUl0bh/ibqDN5+IcFbihwfVCgfEHO5vAc+NAM4Ya4 CZ4oNQp4BZ6az640ybhcC7VeLEULiKjo9UoFco30YbBaPrw1EganZA7YWhc4JqFR4bHp MTPA== 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=EPqC1g9P5utYVNRaSttA0gc0ksGD7MSULhsQ+iaXLy4=; b=s110QirZSnoUtjuzM6UoSDQLBCg0C+a8Z1oxJp9+TD9XyJSfnMpKQntnw2MKiF9MfE Nyh57nzB4+mUjol8/5odxEoghNxlkUeFpbgFX86VVTMAN0yA91MsZbqOEe4W1M8ljEBJ Mv5kVMagFPwlVfrWiEG8OaUNsq8LX8A05hQL3zqRAYHov/IRcmuLbUmswpnKt0+UGloE xbCTSpBnES8FBAXWiIb8dYDxx61qABNCwodNlIVneLwoG3tldpTLVQIJXRTyLLJSRFlp HKfCl/3drrDEM/S0EuN+wqh5838cFb5yBDPz4OSxu1WZludY+y1dSHwe5Nw+j/Qx3hTv 73MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=R+5wkFIx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k2-20020a170902d58200b00172d0e07c02si10504278plh.392.2022.08.23.04.25.30; Tue, 23 Aug 2022 04:25:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=R+5wkFIx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1353396AbiHWKLZ (ORCPT + 99 others); Tue, 23 Aug 2022 06:11:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352123AbiHWKEe (ORCPT ); Tue, 23 Aug 2022 06:04:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E9437CAB3; Tue, 23 Aug 2022 01:51:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 82C53611DD; Tue, 23 Aug 2022 08:51:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6908BC433D6; Tue, 23 Aug 2022 08:51:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244684; bh=940HAywEM73UL70jDkF4U0wYf98SJc6UM4UQiogCvyg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R+5wkFIx6o0gmkcPMR9WGjcVB5WW9NPVr/E76sSq8D8J5ykdIBTZWxtcghhdgUtrN 79JZVvfne0L+c24sdiYJCcR4VSAS0G2h49KYNxGtnQHSn6AR4ihc8U3lUMqUZdc9ti ZTm7VQYjaiVe6O196/kci8Zdr2sSzOAeKaZvHK5I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy , Michael Ellerman Subject: [PATCH 4.14 175/229] powerpc/ptdump: Fix display of RW pages on FSL_BOOK3E Date: Tue, 23 Aug 2022 10:25:36 +0200 Message-Id: <20220823080059.865938476@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe Leroy commit dd8de84b57b02ba9c1fe530a6d916c0853f136bd upstream. On FSL_BOOK3E, _PAGE_RW is defined with two bits, one for user and one for supervisor. As soon as one of the two bits is set, the page has to be display as RW. But the way it is implemented today requires both bits to be set in order to display it as RW. Instead of display RW when _PAGE_RW bits are set and R otherwise, reverse the logic and display R when _PAGE_RW bits are all 0 and RW otherwise. This change has no impact on other platforms as _PAGE_RW is a single bit on all of them. Fixes: 8eb07b187000 ("powerpc/mm: Dump linux pagetables") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/0c33b96317811edf691e81698aaee8fa45ec3449.1656427391.git.christophe.leroy@csgroup.eu Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/mm/dump_linuxpagetables.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) --- a/arch/powerpc/mm/dump_linuxpagetables.c +++ b/arch/powerpc/mm/dump_linuxpagetables.c @@ -123,15 +123,10 @@ static const struct flag_info flag_array .set = "user", .clear = " ", }, { -#if _PAGE_RO == 0 - .mask = _PAGE_RW, - .val = _PAGE_RW, -#else - .mask = _PAGE_RO, - .val = 0, -#endif - .set = "rw", - .clear = "ro", + .mask = _PAGE_RW | _PAGE_RO, + .val = _PAGE_RO, + .set = "ro", + .clear = "rw", }, { .mask = _PAGE_EXEC, .val = _PAGE_EXEC,