From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759474AbbIVTJg (ORCPT ); Tue, 22 Sep 2015 15:09:36 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:41266 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759262AbbIVTJe (ORCPT ); Tue, 22 Sep 2015 15:09:34 -0400 From: Paul Burton To: CC: Paul Burton , "Steven J. Hill" , David Hildenbrand , , Ingo Molnar , Ralf Baechle , "Peter Zijlstra (Intel)" Subject: [PATCH 1/2] MIPS: print MAAR configuration during boot Date: Tue, 22 Sep 2015 12:08:47 -0700 Message-ID: <1442948929-15862-2-git-send-email-paul.burton@imgtec.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: <1442948929-15862-1-git-send-email-paul.burton@imgtec.com> References: <1442948929-15862-1-git-send-email-paul.burton@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.159.189] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Verifying that the MAAR configuration is as expected is useful when debugging the performance of a system. Print out the memory regions configured via MAAR along with their attributes. Signed-off-by: Paul Burton --- arch/mips/mm/init.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 66d0f49..cbef5c2 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c @@ -373,6 +373,7 @@ unsigned __weak platform_maar_init(unsigned num_pairs) static void maar_init(void) { unsigned num_maars, used, i; + phys_addr_t lower, upper, attr; if (!cpu_has_maar) return; @@ -395,6 +396,34 @@ static void maar_init(void) write_c0_maar(0); back_to_back_c0_hazard(); } + + pr_info("MAAR configuration:\n"); + for (i = 0; i < num_maars; i += 2) { + write_c0_maari(i); + back_to_back_c0_hazard(); + upper = read_c0_maar(); + + write_c0_maari(i + 1); + back_to_back_c0_hazard(); + lower = read_c0_maar(); + + attr = lower & upper; + lower = (lower & MIPS_MAAR_ADDR) << 4; + upper = ((upper & MIPS_MAAR_ADDR) << 4) | 0xffff; + + pr_info(" [%d]: ", i / 2); + if (!(attr & MIPS_MAAR_V)) { + pr_cont("disabled\n"); + continue; + } + + pr_cont("%pa-%pa", &lower, &upper); + + if (attr & MIPS_MAAR_S) + pr_cont(" speculate"); + + pr_cont("\n"); + } } void __init mem_init(void) -- 2.5.3