From: ebiederm@xmission.com (Eric W. Biederman)
To: Sanket Rathi <sanket.rathi@cdac.ernet.in>
Cc: linux-mm@kvack.org
Subject: Re: How CPU(x86) resolve kernel address
Date: 07 Apr 2002 15:00:45 -0600 [thread overview]
Message-ID: <m1u1qnmdfm.fsf@frodo.biederman.org> (raw)
In-Reply-To: <Pine.GSO.4.10.10204051648440.18364-100000@mailhub.cdac.ernet.in>
Sanket Rathi <sanket.rathi@cdac.ernet.in> writes:
> 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, actually there is no
> need because this is one to one mapping to physical memory but who resolve
> kernel address to actual physical address how CPU(X86) perform this task
> because when we do DMA we have to give actual physical address by
> virt_to_phys() so what is the mechanism by which CPU translate kernel
> address into physical address ( Somewhere i heard that CPU ignore some of
> the upper bits of address if so then how much bits and why).
Ouch virt_to_phys ouch! ouch! ouch! Don't do that.
At the very least use virt_to_bus. And almost certainly use
pci_alloc_consistent. On x86 the devices and the cpu happen to see
the same addresses for memory. On other architecture this just
doesn't work.
read:
Documentation/DMA-mapping.txt
Documentation/IO-mapping.txt
As for the page tables yes the kernel uses them. But because it has
a simple mapping from virtual to physical address it can do a lot of
optimizations that don't normally work. Like using 4MB pages.
Note that in the vmalloc region we use normal sized pages, and that
vmalloc actually has a smaller address space than normal kernel
memory, and there is a minor performance hit for using it, as the
normal optimization do not apply.
Eric
--
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/
prev parent reply other threads:[~2002-04-07 21:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-05 11:27 How CPU(x86) resolve kernel address Sanket Rathi
2002-04-05 10:07 ` Joseph A Knapka
2002-04-05 17:06 ` Ravi
2002-04-07 21:00 ` Eric W. Biederman [this message]
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=m1u1qnmdfm.fsf@frodo.biederman.org \
--to=ebiederm@xmission.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.