MIPS: Retrieve ASID masks using function accepting struct cpuinfo_mips
In preparation for supporting variable ASID masks, retrieve ASID masks using functions in asm/cpu-info.h which accept struct cpuinfo_mips. This will allow those functions to determine the ASID mask based upon the CPU in a later patch. This also allows for the r3k & r8k cases to be handled in Kconfig, which is arguably cleaner than the previous #ifdefs. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Radim Krčmář <rkrcmar@redhat.com> Cc: linux-mips@linux-mips.org Cc: kvm@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/13210/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:

committed by
Ralf Baechle

parent
f1b711c638
commit
4edf00a46b
@@ -29,9 +29,10 @@ static void dump_tlb(int first, int last)
|
||||
{
|
||||
int i;
|
||||
unsigned int asid;
|
||||
unsigned long entryhi, entrylo0;
|
||||
unsigned long entryhi, entrylo0, asid_mask;
|
||||
|
||||
asid = read_c0_entryhi() & ASID_MASK;
|
||||
asid_mask = cpu_asid_mask(¤t_cpu_data);
|
||||
asid = read_c0_entryhi() & asid_mask;
|
||||
|
||||
for (i = first; i <= last; i++) {
|
||||
write_c0_index(i<<8);
|
||||
@@ -46,7 +47,7 @@ static void dump_tlb(int first, int last)
|
||||
/* Unused entries have a virtual address of KSEG0. */
|
||||
if ((entryhi & PAGE_MASK) != KSEG0 &&
|
||||
(entrylo0 & R3K_ENTRYLO_G ||
|
||||
(entryhi & ASID_MASK) == asid)) {
|
||||
(entryhi & asid_mask) == asid)) {
|
||||
/*
|
||||
* Only print entries in use
|
||||
*/
|
||||
@@ -55,7 +56,7 @@ static void dump_tlb(int first, int last)
|
||||
printk("va=%08lx asid=%08lx"
|
||||
" [pa=%06lx n=%d d=%d v=%d g=%d]",
|
||||
entryhi & PAGE_MASK,
|
||||
entryhi & ASID_MASK,
|
||||
entryhi & asid_mask,
|
||||
entrylo0 & PAGE_MASK,
|
||||
(entrylo0 & R3K_ENTRYLO_N) ? 1 : 0,
|
||||
(entrylo0 & R3K_ENTRYLO_D) ? 1 : 0,
|
||||
|
Reference in New Issue
Block a user