Skip to contentSkip to conversation

temp. mem mappings

DISCUSSION cohutta 2 participants 2 messages Jun 6, 2001 – Jun 7, 2001 Memory management

lore
Share & tools
lore

cohutta

author
#0 lore raw
Quoted 19 lines

===== Original Message From "Stephen C. Tweedie" <[email protected]> ===== Hi,

Quoted 9 lines · cohutta

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.).

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.

Quoted 5 lines

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.

I think this is part of the problem: on my 1 GB system, the ACPI tables are at physical 0x3fffxxxx == virtual 0xffffxxxx, which could conflict with the APIC and IOAPIC mappings (from fixmap.h).
I removed 256 MB, but i still have a few problems.

Quoted 7 lines
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.

Well, i'm talking about physical memory, but it's marked as ACPI data.

Another part of the problem is that I need to do this early in arch/i386/kernel/setup.c::setup_arch(), like between calls to paging_init() and init_apic_mappings(). I can't use ioremap() here can i? ioremap() calls get_vm_area() which calls kmalloc(), and i don't think i can use kmalloc() just yet.

methinks that i'm back to a modification of Timur's suggestion-- a bunch of manual page dir/table changes.

Any other suggestions or corrections to my comments?

thanks.

--
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

Hi,

Quoted 4 lines · cohutta

I think this is part of the problem: on my 1 GB system, the ACPI tables are at physical 0x3fffxxxx == virtual 0xffffxxxx, which could conflict with the APIC and IOAPIC mappings (from fixmap.h).

Shouldn't be --- the fixmaps should be part of the kernel's dynamic virtual area, which is not identity mapped. You can still map those physical addresses via kmap() on a highmem system (and a 1GB machine should be running a highmem kernel).

Quoted 2 lines

Well, i'm talking about physical memory, but it's marked as ACPI data.

If it is marked PG_Reserved, then ioremap() will work on it despite it being inside the normal physical memory area. If not, kmap() will still work.

Quoted 5 lines

Another part of the problem is that I need to do this early in arch/i386/kernel/setup.c::setup_arch(), like between calls to paging_init() and init_apic_mappings(). I can't use ioremap() here can i? ioremap() calls get_vm_area() which calls kmalloc(), and i don't think i can use kmalloc() just yet.

Right --- you can use alloc_pages but we haven't done the initialisation of the kmalloc slabsl by this point.

_Why_ do you need access to the ACPI tables so early, though?

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/