Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Joshua Kinard <kumba@gentoo.org>
To: James Hogan <james.hogan@imgtec.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	linux-mips@linux-mips.org
Subject: Re: [PATCH RFC v2 01/10] MIPS: Add SysRq operation to dump TLBs on all CPUs
Date: Sun, 24 May 2015 17:21:34 -0400	[thread overview]
Message-ID: <556240DE.1050003@gentoo.org> (raw)
In-Reply-To: <1432025438-26431-2-git-send-email-james.hogan@imgtec.com>

On 05/19/2015 04:50, James Hogan wrote:
> Add a MIPS specific SysRq operation to dump the TLB entries on all CPUs,
> using the 'x' trigger key.

Thought: Would it make sense to split apart the data such that one SysRq key
dumps the CP0 registers of all CPUs, and another dumps the TLB info?


> +/*
> + * Dump TLB entries on all CPUs.
> + */
> +
> +static DEFINE_SPINLOCK(show_lock);
> +
> +static void sysrq_tlbdump_single(void *dummy)
> +{
> +	const int field = 2 * sizeof(unsigned long);
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(&show_lock, flags);
> +
> +	pr_info("CPU%d:\n", smp_processor_id());
> +	pr_info("Index	: %0x\n", read_c0_index());
> +	pr_info("Pagemask: %0x\n", read_c0_pagemask());
> +	pr_info("EntryHi : %0*lx\n", field, read_c0_entryhi());
> +	pr_info("EntryLo0: %0*lx\n", field, read_c0_entrylo0());
> +	pr_info("EntryLo1: %0*lx\n", field, read_c0_entrylo1());
> +	pr_info("Wired   : %0x\n", read_c0_wired());
> +	pr_info("Pagegrain: %0x\n", read_c0_pagegrain());
> +	if (cpu_has_htw) {
> +		pr_info("PWField : %0*lx\n", field, read_c0_pwfield());
> +		pr_info("PWSize  : %0*lx\n", field, read_c0_pwsize());
> +		pr_info("PWCtl   : %0x\n", read_c0_pwctl());
> +	}
> +	pr_info("\n");
> +	dump_tlb_all();
> +	pr_info("\n");
> +
> +	spin_unlock_irqrestore(&show_lock, flags);
> +}

The older CPUs, like the R10000 don't have a PageGrain register I believe (at
least R10K doesn't),  Does that need to be stuffed behind a conditional?  Also,
R10K (and newer?) CPUs have a FrameMask CP0 register ($21).  Linux currently
scribbles a 0 to the writable bits, though, so I'm not sure if it matters.

--J

  parent reply	other threads:[~2015-05-24 21:21 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-19  8:50 [PATCH v2 00/10] MIPS: dump_tlb improvements James Hogan
2015-05-19  8:50 ` James Hogan
2015-05-19  8:50 ` [PATCH RFC v2 01/10] MIPS: Add SysRq operation to dump TLBs on all CPUs James Hogan
2015-05-19  8:50   ` James Hogan
2015-05-24 21:21   ` Joshua Kinard [this message]
2015-05-26 11:58     ` Maciej W. Rozycki
2015-05-27 13:09       ` Maciej W. Rozycki
2015-07-14  9:27       ` James Hogan
2015-07-14  9:27         ` James Hogan
2015-05-19  8:50 ` [PATCH v2 02/10] MIPS: hazards: Add hazard macros for tlb read James Hogan
2015-05-19  8:50   ` James Hogan
2015-05-26 12:36   ` Maciej W. Rozycki
2015-05-26 12:53     ` Ralf Baechle
2015-05-26 13:25       ` Maciej W. Rozycki
2015-05-26 13:32         ` Ralf Baechle
2015-05-19  8:50 ` [PATCH v2 03/10] MIPS: mipsregs.h: Add EntryLo bit definitions James Hogan
2015-05-19  8:50   ` James Hogan
2015-05-28 23:47   ` Maciej W. Rozycki
2015-05-19  8:50 ` [PATCH v2 04/10] MIPS: dump_tlb: Use tlbr hazard macros James Hogan
2015-05-19  8:50   ` James Hogan
2015-05-19  8:50 ` [PATCH v2 05/10] MIPS: dump_tlb: Refactor TLB matching James Hogan
2015-05-19  8:50   ` James Hogan
2015-05-19  8:50 ` [PATCH v2 06/10] MIPS: dump_tlb: Make use of EntryLo bit definitions James Hogan
2015-05-19  8:50   ` James Hogan
2015-05-19  8:50 ` [PATCH v2 07/10] MIPS: dump_tlb: Take global bit into account James Hogan
2015-05-19  8:50   ` James Hogan
2015-05-19  8:50 ` [PATCH v2 08/10] MIPS: dump_tlb: Take EHINV " James Hogan
2015-05-19  8:50   ` James Hogan
2015-05-19  8:50 ` [PATCH v2 09/10] MIPS: dump_tlb: Take RI/XI bits " James Hogan
2015-05-19  8:50   ` James Hogan
2015-05-19  8:50 ` [PATCH v2 10/10] MIPS: dump_tlb: Take XPA " James Hogan
2015-05-19  8:50   ` James Hogan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=556240DE.1050003@gentoo.org \
    --to=kumba@gentoo.org \
    --cc=james.hogan@imgtec.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox