Skip to contentSkip to conversation

temp. mem mappings

DISCUSSION cohutta 4 participants 4 messages Jun 5, 2001 – Jun 6, 2001 Memory management

lore
Share & tools
lore

cohutta

author
#0 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line

Allocate a virtual memory area using vmalloc and then save and

modify the

Quoted 1 line
Quoted 1 line
Quoted 1 line

pmd/pgd/pte to point to the physical memory you want. To unmap,

just undo the

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

previous steps.

ioremap() is there for exactly that purpose.

True, except that you can't use ioremap on normal memory, which is

what I

Quoted 1 line

assumed he was trying to do.

Normal memory is identity-mapped very early in boot anyway (except for highmem on large Intel boxes, that is, and kmap() works for that.)
---

I don't really want to play with the page tables if i can help it. I didn't use ioremap() because it's real system memory, not IO bus memory.

How much normal memory is identity-mapped at boot on x86? Is it more than 8 MB?

I'm trying to read some ACPI tables, like the FACP. On my system, this is at physical address 0x3fffd7d7 (e.g.).

kmap() ends up calling set_pte(), which is close to what i am already doing. i'm having a problem on the unmap side when i am done with the temporary mapping.

thanks.
/cohutta/

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/

#1 lore raw

** Reply to message from cohutta <[email protected]> on Tue, 5 Jun 2001 16:42:52 -0400

Quoted 6 lines

I don't really want to play with the page tables if i can help it. I didn't use ioremap() because it's real system memory, not IO bus memory.

How much normal memory is identity-mapped at boot on x86? Is it more than 8 MB?

Much more. Somewhere between 2 and 4 GB is mapped. Large memory support in Linux has always confused me, so I can't remember exactly how much is mapped.

Keep in mind that if you want to access that memory as uncached or write-combined, you'll need to use the method I described.

Signature · 7 lines
Timur Tabi - [email protected]
Interactive Silicon - http://www.interactivesi.com

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/
#2 lore raw
Quoted 8 lines · Timur Tabi

** Reply to message from cohutta <[email protected]> on Tue, 5 Jun 2001 16:42:52 -0400

Quoted 4 lines

I don't really want to play with the page tables if i can help it. I didn't use ioremap() because it's real system memory, not IO bus memory.

Quoted 5 lines
Quoted 2 lines

How much normal memory is identity-mapped at boot on x86? Is it more than 8 MB?

Much more. Somewhere between 2 and 4 GB is mapped. Large memory support in Linux has always confused me, so I can't remember exactly how much is mapped.

On x86, it's a little less than 1GB (4G-PAGE_OFFSET-<a little bit for fixmaps,
kmap, vmalloc>); PAGE_OFFSET is 3GB by default. There is some stuff that happens
before that mapping is done, though. All you can absolutely count on when you
first enter 32-bit mode is the low 8MB. setup_arch() in arch/i386/kernel/setup.c
is the place to look if you want to be sure; paging_init() is called from there.

-- Joe

-- Joseph A. Knapka
"You know how many remote castles there are along the gorges? You
can't MOVE for remote castles!" -- Lu Tze re. Uberwald
// Linux MM documentation in progress:
// http://home.earthlink.net/~jknapka/linux-mm/vmoutline.html
* Evolution is an "unproven theory" in the same sense that gravity is. * --
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/

#3 lore raw
In reply to cohutta

Hi,

Quoted 7 lines · cohutta

Normal memory is identity-mapped very early in boot anyway (except for highmem on large Intel boxes, that is, and kmap() works for that.)

I don't really want to play with the page tables if i can help it. I didn't use ioremap() because it's real system memory, not IO bus memory.

Quoted 5 lines

How much normal memory is identity-mapped at boot on x86? Is it more than 8 MB?

I'm trying to read some ACPI tables, like the FACP. On my system, this is at physical address 0x3fffd7d7 (e.g.).

It depends at what time during boot. Some ACPI memory is reusable once the system boots: the kernel parses the table then frees up the memory which the BIOS initialised.

VERY early in boot, while the VM is still getting itself set up, there is only a minimal mapping set up by the boot loader code. However, once the VM is initialised far enough to let you play with page tables, all memory will be identity-mapped up to just below the 1GB watermark.

Quoted 3 lines

kmap() ends up calling set_pte(), which is close to what i am already doing. i'm having a problem on the unmap side when i am done with the temporary mapping.

kunmap(). :-) But kmap only works on CONFIG_HIGHMEM kernel builds. On kernels built without high memory support, kmap will not allow you to access memory beyond the normal physical memory boundary.

Cheers,
Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/