linux-mips
[Top] [All Lists]

Re: why it not write those 6bits to entrylo0/1 register?

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: why it not write those 6bits to entrylo0/1 register?
From: figo zhang <figo1802@gmail.com>
Date: Wed, 25 Nov 2009 14:52:51 +0800
Cc: linux-mips@linux-mips.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=rSZ8P5wG3rF3oT3v0mv0NlvjBuZbjy+RwIEr92FYrgo=; b=NuIlBJj4hRo78btaZItP8wuKZKfV+o8T0rhpScHUBp+ZcxfCoVPgU6VHvfQDkyj7xR X8cP6KlkrMHYvKsh2/ngrA+Ho+6BvXZrkEmUJDd0dnchRWjGc11o3WvCdk257+WvLfyg E/tfYFVbyYGypLuJ0cxDrKB0ercnu9N7hnOnk=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Oqoe3L5u4HwlUYaRHhd4tH1KHk/5dSWPMCkChPsFpWxUj3QeRpZ5G/k/XU4ni0lIto 77WUnXFMJWHR+bfX+icWrbCx2CIWB+gAAIaJcEbcSxWtrF3JlSQT3nDkeSpCHssfrfuu 3Oy9AL5rQ6l/0kqi5QXRPQCqRGcEwqrPDKrFU=
In-reply-to: <20091117084047.GA2923@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <c6ed1ac50911170012u7a52fbb9h1ae62cabf766122f@mail.gmail.com> <20091117084047.GA2923@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org


No, the low 6 bits contain other information maintained by the kernel.
Shifting right by 6 bits is used to drop these software bits.  The
hardware bits are stored in bits 6 and up in a pte so the shift operation
is going to move them into the right place.

yes, i know why shout shift this 6 bits, see this :

entrylo[01]:
  3130 29                         6 5 3 2 1 0
  -------------------------------------------
  | | PFN                         | C |D|V|G|
  -------------------------------------------

linux pte:
  31                     12 111098 7 6 5 3 2 1 0
  -------------------------------------------
  | PFN                | C |D|V|G|B|M|A|W|R|P|
  -------------------------------------------

so , the linux PTE has the least significant 6 bits is mantain by linux PTE, the hardware
PTE entrylo[0~1] have no such bits, so it need to shift .

ralf, is some description on the kernel code? if it has, it would be easy understand .

> D:
> V:
> G:
>
> and how the kernel write the this 6 bit to entrylo0/1 register?

A TLB write instruction about 5 lines further down in the code.

 Ralf

<Prev in Thread] Current Thread [Next in Thread>