Received: by 2002:a17:90a:9307:0:0:0:0 with SMTP id p7csp2835487pjo; Mon, 16 Mar 2020 05:36:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vshm0RPmHSiN6xOpphkbZYbawE2Mdv8id2MGEsCYSwD1sCd139he2+2F+ipkppZnVvN6OhP X-Received: by 2002:a9d:6443:: with SMTP id m3mr21752819otl.20.1584362209357; Mon, 16 Mar 2020 05:36:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584362209; cv=none; d=google.com; s=arc-20160816; b=LH5TLwaTl/+Eyi/doSSA1LRCDOzq9mfW2QkTJPCrlQY75mQMRR7CyX2GvJUk+919+F fuojn0EKTrgfsCLoxZqQ1LmI4+o8uzAH48sG51iGxKbAxnzfryUbKxJEpJOr1HhrsOxC D6/MZHm1hR9wCraJcGXDb1ndQE4vPT+GhoqoEBDiDiJxX6r/T7s6rxnWQE3PWSQIbcZv FLrPfzNB3zJyZwCo3cv8XlNZa4VDliEQZNRDq9qxB5UQRJ83w8BamLM1QLMsxp7WT9Q/ pygaXV7yjnLbY3JPyT46oy9Oyo/l1W4WQOTEb+Z230mhJqRPTnEPbF1vuJm/kwOCIPHW SlbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=7T2j7aCGb8NtMk1LhfHLJamKiLLolKEjkaTJMMTZcqE=; b=pyIkulWaMs5LFqPNyVhZLFm0YErkFJ8BLwMguM0bHpXsheU034UhcvhnxofPxLxqQz 7i8m0FJX6y4mPwSN/QYfYcXwPAjMIxI8rqetAnTeyFh3foRmIsjvN+e6bWRvBodx6dfm tCXqldb6H8rYRwCzLytM1ySi5C954mI6eyl/cQvmq/Wox7Ene9Pq0Jyza9vPd8GreGD/ iD7QKC8NUgViy8Y9K1RFNy8w22rJoLor30jFYWwXtNna5cgK0EfUxtSc2sidJSqRlTdl y7HsQf6hNZsL6dhUWjM3oZt35Uvn7WLEPW9E5xoy7Ma2+LuDnab/Tik7qJdDK4WfbcW7 D2mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=hLw8Nux6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11si9788350otb.252.2020.03.16.05.36.36; Mon, 16 Mar 2020 05:36:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=hLw8Nux6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731130AbgCPMgF (ORCPT + 99 others); Mon, 16 Mar 2020 08:36:05 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:37771 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731047AbgCPMf7 (ORCPT ); Mon, 16 Mar 2020 08:35:59 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48gwkw4bsVz9v02f; Mon, 16 Mar 2020 13:35:52 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=hLw8Nux6; dkim-adsp=pass; dkim-atps=neutral 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 xVySYLiVKTXs; Mon, 16 Mar 2020 13:35:52 +0100 (CET) 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 48gwkw3c5tz9tyg5; Mon, 16 Mar 2020 13:35:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1584362152; bh=7T2j7aCGb8NtMk1LhfHLJamKiLLolKEjkaTJMMTZcqE=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=hLw8Nux6C7NgL4F6SDj0cxq17ate88zw0jjhI7/tnkXeE+hwCm3WMbY6/t8kJ+U6D lICvcifOwO8mgSKTROYGkPcAUc9SpnXqxAk5gK4nrjwM4sdw/6/x60hujFw/JltvQ+ MpSNxpBpEMaVwhWiuDdGgwk9H14pdtevxv41mbzE= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 7B38B8B7D2; Mon, 16 Mar 2020 13:35:57 +0100 (CET) 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 ocbX3nmRNadO; Mon, 16 Mar 2020 13:35:57 +0100 (CET) Received: from pc16570vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.230.100]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5948B8B7D0; Mon, 16 Mar 2020 13:35:57 +0100 (CET) Received: by pc16570vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 5138465595; Mon, 16 Mar 2020 12:35:57 +0000 (UTC) Message-Id: <435eef455d86828626ac4d064c0d8b8aca0c706b.1584360344.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v1 12/46] powerpc/ptdump: Standardise display of BAT flags To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Mon, 16 Mar 2020 12:35:57 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Display BAT flags the same way as page flags: rwx and wimg Signed-off-by: Christophe Leroy --- arch/powerpc/mm/ptdump/bats.c | 37 ++++++++++++++--------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/mm/ptdump/bats.c b/arch/powerpc/mm/ptdump/bats.c index d6c660f63d71..cebb58c7e289 100644 --- a/arch/powerpc/mm/ptdump/bats.c +++ b/arch/powerpc/mm/ptdump/bats.c @@ -15,12 +15,12 @@ static char *pp_601(int k, int pp) { if (pp == 0) - return k ? "NA" : "RWX"; + return k ? " " : "rwx"; if (pp == 1) - return k ? "ROX" : "RWX"; + return k ? "r x" : "rwx"; if (pp == 2) - return k ? "RWX" : "RWX"; - return k ? "ROX" : "ROX"; + return "rwx"; + return "r x"; } static void bat_show_601(struct seq_file *m, int idx, u32 lower, u32 upper) @@ -48,12 +48,9 @@ static void bat_show_601(struct seq_file *m, int idx, u32 lower, u32 upper) seq_printf(m, "Kernel %s User %s", pp_601(k & 2, pp), pp_601(k & 1, pp)); - if (lower & _PAGE_WRITETHRU) - seq_puts(m, "write through "); - if (lower & _PAGE_NO_CACHE) - seq_puts(m, "no cache "); - if (lower & _PAGE_COHERENT) - seq_puts(m, "coherent "); + seq_puts(m, lower & _PAGE_WRITETHRU ? "w " : " "); + seq_puts(m, lower & _PAGE_NO_CACHE ? "i " : " "); + seq_puts(m, lower & _PAGE_COHERENT ? "m " : " "); seq_puts(m, "\n"); } @@ -101,20 +98,16 @@ static void bat_show_603(struct seq_file *m, int idx, u32 lower, u32 upper, bool seq_puts(m, "Kernel/User "); if (lower & BPP_RX) - seq_puts(m, is_d ? "RO " : "EXEC "); + seq_puts(m, is_d ? "r " : " x "); else if (lower & BPP_RW) - seq_puts(m, is_d ? "RW " : "EXEC "); + seq_puts(m, is_d ? "rw " : " x "); else - seq_puts(m, is_d ? "NA " : "NX "); - - if (lower & _PAGE_WRITETHRU) - seq_puts(m, "write through "); - if (lower & _PAGE_NO_CACHE) - seq_puts(m, "no cache "); - if (lower & _PAGE_COHERENT) - seq_puts(m, "coherent "); - if (lower & _PAGE_GUARDED) - seq_puts(m, "guarded "); + seq_puts(m, is_d ? " " : " "); + + seq_puts(m, lower & _PAGE_WRITETHRU ? "w " : " "); + seq_puts(m, lower & _PAGE_NO_CACHE ? "i " : " "); + seq_puts(m, lower & _PAGE_COHERENT ? "m " : " "); + seq_puts(m, lower & _PAGE_GUARDED ? "g " : " "); seq_puts(m, "\n"); } -- 2.25.0