From patchwork Fri Jul 9 05:03:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 58325 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 1AFECB7092 for ; Fri, 9 Jul 2010 15:10:12 +1000 (EST) Received: by ozlabs.org (Postfix, from userid 1010) id 44997B6F18; Fri, 9 Jul 2010 15:10:10 +1000 (EST) Message-Id: <20100709050341.537772607@samba.org> User-Agent: quilt/0.48-1 Date: Fri, 09 Jul 2010 15:03:32 +1000 From: Anton Blanchard To: yaboot-devel@lists.ozlabs.org Subject: [patch 02/14] Remove birecs code References: <20100709050330.507659708@samba.org> Content-Disposition: inline; filename=remove_birecs X-BeenThere: yaboot-devel@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Technical and development discussion regarding yaboot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: yaboot-devel-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Errors-To: yaboot-devel-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org The birecs code is deprecated and writes garbage into kernel images. I had a painful time rediscovering this bug in mainline :) Remove it. Signed-off-by: Anton Blanchard Index: yaboot/second/yaboot.c =================================================================== --- yaboot.orig/second/yaboot.c 2010-07-08 14:04:39.000000000 +1000 +++ yaboot/second/yaboot.c 2010-07-08 14:05:55.000000000 +1000 @@ -1021,7 +1021,6 @@ yaboot_text_ui(void) void *initrd_base; unsigned long initrd_size; kernel_entry_t kernel_entry; - struct bi_record* birec; char* loc=NULL; loadinfo_t loadinfo; void *initrd_more,*initrd_want; @@ -1162,43 +1161,6 @@ yaboot_text_ui(void) flush_icache_range ((long)loadinfo.base, (long)loadinfo.base+loadinfo.memsize); DEBUG_F(" done\n"); - if (flat_vmlinux) { - /* - * Fill new boot infos (only if booting a vmlinux). - * - * The birec is low on memory, probably inside the malloc pool, - * so we don't write it earlier. At this point, we should not - * use anything coming from the malloc pool. - */ - birec = (struct bi_record *)_ALIGN(loadinfo.filesize+(1<<20)-1,(1<<20)); - - /* We make sure it's mapped. We map only 64k for now, it's - * plenty enough we don't claim since this precise memory - * range may already be claimed by the malloc pool. - */ - prom_map (birec, birec, 0x10000); - DEBUG_F("birec at %p\n", birec); - DEBUG_SLEEP; - - birec->tag = BI_FIRST; - birec->size = sizeof(struct bi_record); - birec = (struct bi_record *)((ulong)birec + birec->size); - - birec->tag = BI_BOOTLOADER_ID; - sprintf( (char *)birec->data, "yaboot"); - birec->size = sizeof(struct bi_record) + strlen("yaboot") + 1; - birec = (struct bi_record *)((ulong)birec + birec->size); - - birec->tag = BI_MACHTYPE; - birec->data[0] = _machine; - birec->size = sizeof(struct bi_record) + sizeof(ulong); - birec = (struct bi_record *)((ulong)birec + birec->size); - - birec->tag = BI_LAST; - birec->size = sizeof(struct bi_record); - birec = (struct bi_record *)((ulong)birec + birec->size); - } - /* compute the kernel's entry point. */ kernel_entry = loadinfo.base + loadinfo.entry - loadinfo.load_loc;