linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "David Mentr\\'e" <David.Mentre@irisa.fr>
To: Petko Manolov <petkan@varel.bg>
Cc: linux-mm@kvack.org
Subject: Re: 4M kernel pages
Date: 16 Nov 1998 19:18:12 +0100	[thread overview]
Message-ID: <wd8u2zzwlgb.fsf@parate.irisa.fr> (raw)
In-Reply-To: Petko Manolov's message of "Mon, 16 Nov 1998 18:50:16 +0200"



Petko Manolov <petkan@varel.bg> writes:

> David Mentr\'e wrote:
> > 
> > Look at arch/i386/kernel/head.S:
> 
> This is only for SMP machines.

You are right. Shame on me (the #define is so BIG :).

> ;-) I got sure by other way.

To much brute force. :)

> In kernel mode i red the whole page directory. All kernel page dir
> entries ended with LSB == 0xe3.  7th bit on means 4M pages. 1 and 0
> bits means respectively r/w and present.

So, know we are sure this bit is set. But when (in the source) ?


[ in your first mail ]
> I took a look at linux/arch/i386/mm/init.c - paging_init().  Yes we
> rise PSE bit in cr4 but don't rise the PS bit in the pade directory
> entry for the kernel - which means the kernel is in 4K pages.

BTW, I think I've found when the PS bit is set. In fact, I you may have
overlooked arch/i386/mm/init.c. Around line 325, you have :

		/*
		 * If we're running on a Pentium CPU, we can use the 4MB
		 * page tables. 
		 *
		 * The page tables we create span up to the next 4MB
		 * virtual memory boundary, but that's OK as we won't
		 * use that memory anyway.
		 */
		if (boot_cpu_data.x86_capability & X86_FEATURE_PSE) {
			unsigned long __pe;

			set_in_cr4(X86_CR4_PSE);
			boot_cpu_data.wp_works_ok = 1;
			__pe = _KERNPG_TABLE + _PAGE_4M + __pa(address); <----
			/* Make it "global" too if supported */
			if (boot_cpu_data.x86_capability & X86_FEATURE_PGE) {
				set_in_cr4(X86_CR4_PGE);
				__pe += _PAGE_GLOBAL;
			}
			pgd_val(*pg_dir) = __pe;
			pg_dir++;
			address += 4*1024*1024;
			continue;
		}

At the line marked '<---', the macro _PAGE_4M set the PS bit (macro
defined in include/asm-i386/pgtable.h).  The code then setup the page
directory with __pe ('pgd_val(*pg_dir) = __pe;').

Is it right ? Or you where looking at another page directory ? (I'm far
from an expert in both kernel and i386 asm)

> The point is that 6th bit is also 1 when it supposed to be 0
> acording to Intel docs.

Yes. But, as it is reserved, it may be a hiden feature of intel procs. ;)

> Excuse me all for this boring mails!

No. It's interesting to know how things are done. And while trying to
explain this, I'm learning the Linux kernel. :)

Best regards,
d.
-- 
 David.Mentre@irisa.fr -- http://www.irisa.fr/prive/dmentre/
 Opinions expressed here are only mine.
--
This is a majordomo managed list.  To unsubscribe, send a message with
the body 'unsubscribe linux-mm me@address' to: majordomo@kvack.org

  reply	other threads:[~1998-11-16 18:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-13 12:04 May be stupid question ;-) Petko Manolov
1998-11-13 14:12 ` Rik van Riel
1998-11-16  7:44   ` Petko Manolov
1998-11-16  8:30   ` 4M kernel pages Petko Manolov
     [not found]     ` <wd8emr3yfeu.fsf@parate.irisa.fr>
1998-11-16 15:06       ` Petko Manolov
1998-11-16 15:27         ` David Mentr\'e
1998-11-16 16:50           ` Petko Manolov
1998-11-16 18:18             ` David Mentr\'e [this message]
1998-11-17  9:30               ` Petko Manolov
1998-11-16 18:43     ` Rik van Riel
1998-11-17  9:34       ` Petko Manolov

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=wd8u2zzwlgb.fsf@parate.irisa.fr \
    --to=david.mentre@irisa.fr \
    --cc=linux-mm@kvack.org \
    --cc=petkan@varel.bg \
    /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