j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: mcayland Date: Tue Apr 9 21:17:02 2013 New Revision: 1115 URL: http://tracker.coreboot.org/trac/openbios/changeset/1115
Log: Remove /chosen "mmu" property from the default device tree.
Not all architectures have an "mmu" property in /chosen, and having a NULL value causes the internal property formatting nodes to invoke a NULL ihandle reference. The architectures that require it already add it into the device tree as required during initialisation, so there should be no change in behaviour. As reported by Artyom Tarasenko.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Modified: trunk/openbios-devel/arch/ppc/qemu/ofmem.c trunk/openbios-devel/arch/sparc32/lib.c trunk/openbios-devel/arch/sparc64/ofmem_sparc64.c trunk/openbios-devel/forth/device/tree.fs
Modified: trunk/openbios-devel/arch/ppc/qemu/ofmem.c ============================================================================== --- trunk/openbios-devel/arch/ppc/qemu/ofmem.c Tue Apr 9 20:32:53 2013 (r1114) +++ trunk/openbios-devel/arch/ppc/qemu/ofmem.c Tue Apr 9 21:17:02 2013 (r1115) @@ -549,9 +549,10 @@ { ofmem_t *ofmem = ofmem_arch_get_private();
- ofmem_claim_phys(0, get_ram_bottom(), 0); - ofmem_claim_virt(0, get_ram_bottom(), 0); - ofmem_map(0, 0, get_ram_bottom(), 0); + /* Map the memory (don't map page 0 to allow catching of NULL dereferences) */ + ofmem_claim_phys(PAGE_SIZE, get_ram_bottom() - PAGE_SIZE, 0); + ofmem_claim_virt(PAGE_SIZE, get_ram_bottom() - PAGE_SIZE, 0); + ofmem_map(PAGE_SIZE, PAGE_SIZE, get_ram_bottom() - PAGE_SIZE, 0);
/* Map everything at the top of physical RAM 1:1, minus the OpenBIOS ROM in RAM copy */ ofmem_claim_phys(get_ram_top(), get_hash_base() + HASH_SIZE - get_ram_top(), 0);
Modified: trunk/openbios-devel/arch/sparc32/lib.c ============================================================================== --- trunk/openbios-devel/arch/sparc32/lib.c Tue Apr 9 20:32:53 2013 (r1114) +++ trunk/openbios-devel/arch/sparc32/lib.c Tue Apr 9 21:17:02 2013 (r1115) @@ -403,9 +403,9 @@ ofmem_arch_map_pages(pa, va, size, ofmem_arch_default_translation_mode(pa)); ofmem_map_page_range(pa, va, size, ofmem_arch_default_translation_mode(pa));
- // 1:1 mapping for RAM - ofmem_arch_map_pages(0, 0, LOWMEMSZ, ofmem_arch_default_translation_mode(0)); - ofmem_map_page_range(0, 0, LOWMEMSZ, ofmem_arch_default_translation_mode(0)); + // 1:1 mapping for RAM (don't map page 0 to allow catching of NULL dereferences) + ofmem_arch_map_pages(PAGE_SIZE, PAGE_SIZE, LOWMEMSZ - PAGE_SIZE, ofmem_arch_default_translation_mode(0)); + ofmem_map_page_range(PAGE_SIZE, PAGE_SIZE, LOWMEMSZ - PAGE_SIZE, ofmem_arch_default_translation_mode(0));
/* * Flush cache
Modified: trunk/openbios-devel/arch/sparc64/ofmem_sparc64.c ============================================================================== --- trunk/openbios-devel/arch/sparc64/ofmem_sparc64.c Tue Apr 9 20:32:53 2013 (r1114) +++ trunk/openbios-devel/arch/sparc64/ofmem_sparc64.c Tue Apr 9 21:17:02 2013 (r1115) @@ -365,8 +365,8 @@ /* inherit translations set up by entry.S */ ofmem_walk_boot_map(remap_page_range);
- /* Map the memory */ - ofmem_map_page_range(0, 0, qemu_mem_size, 0x36); + /* Map the memory (don't map page 0 to allow catching of NULL dereferences) */ + ofmem_map_page_range(PAGE_SIZE, PAGE_SIZE, qemu_mem_size - PAGE_SIZE, 0x36);
if (!(retained->magic == RETAIN_MAGIC)) { OFMEM_TRACE("ofmem_init: no retained magic found, creating\n");
Modified: trunk/openbios-devel/forth/device/tree.fs ============================================================================== --- trunk/openbios-devel/forth/device/tree.fs Tue Apr 9 20:32:53 2013 (r1114) +++ trunk/openbios-devel/forth/device/tree.fs Tue Apr 9 21:17:02 2013 (r1115) @@ -54,7 +54,6 @@ \ " hda1:/boot/vmunix" encode-string " bootpath" property \ " -as" encode-string " bootargs" property 0 encode-int " memory" property - 0 encode-int " mmu" property finish-device
\ END