MIPS R4000: Why is there a global bit in every EntryLo register?

Page 81 of the following R4000 documentation: http://www.scribd.com/doc/53181649/70/EntryLo0-2-and-EntryLo1-3-Registers

Shows one global bit in each TLB entry (which makes sense). If the global bit is set in the TLB entry, then the ASID is ignored during the search.

However, on the next page, the EntryHi register has a reserved (0) field instead of the global TLB input bit (as indicated in the header on page 82). In its place there are two global bits: one in each register EntryLo {0,1}.

Several sources (including "See" Starting MIPS ") show that when writing a TLB using the TLBW command, if the EntryLo0 (G) and EntryLo1 (G) bits are not identical," bad things "will happen. Other sources, such as a forum post on linux-mips.org, (http://www.linux-mips.org/archives/linux-mips/2003-04/msg00226.html) suggest that "in other words, writing a TLB record with only one of the G bits in the set of EntryLo registration pairs {0,1} will cause the TLB record with the G bit to be cleared. " (Which in itself is unclear what exactly will happen - “something bad”, or a TLB record with its clear discharge G).

What is the cause of two global bits? Is this suitable for support, or am I missing something?

+4
source share
1 answer

The answer to this can be found in MIPS® Architecture for Programmers Volume III: The privileged MIPS32® and microMIPS32 ™ resource architecture, available at mips.com (registration required). According to table 9.5 in this document, bit G means:

Global bit. In the TLB record, the logical AND of the G bits from both EntryLo0 and EntryLo1 become the G bit in the TLB record. If the TLB of input G is one, the ASID comparison is ignored during TLB matches. When reading from a TLB record, G bits of both EntryLo0 and EntryLo1 reflect the state of TLB G.

In other words, if you want to set the G bit, you must set it in both the EntryHi and EntryLo registers. Bit G will not be set if EntryHi and EntryLo disagree.

Why was this done? This is as good a method as any, and a little easier in the memory of a system programmer than alternatives.

+3
source

Source: https://habr.com/ru/post/1433511/


All Articles