linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ravi <kravi26@yahoo.com>
To: Sanket Rathi <sanket.rathi@cdac.ernet.in>, linux-mm@kvack.org
Subject: Re: How CPU(x86) resolve kernel address
Date: Fri, 5 Apr 2002 09:06:21 -0800 (PST)	[thread overview]
Message-ID: <20020405170621.49726.qmail@web12308.mail.yahoo.com> (raw)
In-Reply-To: <Pine.GSO.4.10.10204051648440.18364-100000@mailhub.cdac.ernet.in>

> I read all about the memory management in linux. all thing are clear
> to me like there is 3GB space for user procee and 1GB for kernel and 
> thats why kernel address always greater then 0xC0000000. But one 
> thing is not clear that is for kernel address there is no page table,


 Page table for kernel addresses does exist. Take a look at how
'swapper_pg_dir' is set up in pagetable_init() (arch/i386/mm/init.c).
init_mm->pgd points to swapper_pg_dir, so kernel threads and the idle
context use this page table.
 Most of the time, the kernel executes in the context of a user
process. Each process' page table contains mappings for kernel virtual
addresses also. 

> actually there is no need because this is one to one mapping to 
> physical memory 

 Once paging is turned on, there is always a need for page table. The
one-to-one mapping is a feature of Linux (and maybe any other OS), not
required by the processor. Also, there is no one-to-one mapping in case
of kernel addresses obtained by interfaces like vmalloc(), kmap() and
ioremap().

> what is the mechanism by which CPU translate kernel address into 
> physical address 

  The CPU does not treat kernel addresses differently in case of
virtual-physical translation. 

> ( Somewhere i heard that CPU ignore
> some of the upper bits of address if so then how much bits and why).
 
  12 least significant bits of the Page directory entry and page table
entry are used for flags. Since the least page size supported on i386
is 4k, the last 12 bits always correspond to the offset within a page.
So they are not needed for address translation. [The flags are defined
in include/asm-i386/pgtable.h].

Hope this helps,
Ravi.

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/

  parent reply	other threads:[~2002-04-05 17:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-05 11:27 Sanket Rathi
2002-04-05 10:07 ` Joseph A Knapka
2002-04-05 17:06 ` Ravi [this message]
2002-04-07 21:00 ` Eric W. Biederman

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=20020405170621.49726.qmail@web12308.mail.yahoo.com \
    --to=kravi26@yahoo.com \
    --cc=linux-mm@kvack.org \
    --cc=sanket.rathi@cdac.ernet.in \
    /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