Bug 164225 - Boot fails on IBM 7028-6E1 (heap memory claim failed)
Summary: Boot fails on IBM 7028-6E1 (heap memory claim failed)
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: powerpc (show other bugs)
Version: 9.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Mark Linimon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-16 22:50 UTC by Lyubomir Grigorov
Modified: 2018-05-31 16:01 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lyubomir Grigorov 2012-01-16 22:50:06 UTC
When booting 9.0-RELEASE (32bit ppc) on IBM pSeries 610 (7028-6E1), going to SMS, choosing install device CD-ROM, choosing FreeBSD 9.0, it fails with:
Heap memory claim failed!

I traced the source to the following 3 files:

sys/boot/ofw/common/main.c
..
..
48 #define HEAP_SIZE       0x80000
..
52 void
53 init_heap(void)
54 {
55         void    *base;
56         ihandle_t stdout;
57 
58         if ((base = ofw_alloc_heap(HEAP_SIZE)) == (void *)0xffffffff) {
59                 OF_getprop(chosen, "stdout", &stdout, sizeof(stdout));
60                 OF_puts(stdout, "Heap memory claim failed!\n");
61                 OF_enter();
62         }
63 
64         setheap(base, (void *)((int)base + HEAP_SIZE));
65 }
..
..

sys/boot/ofw/libofw/ofw_memory.c
..
..
119 ofw_alloc_heap(unsigned int size)
120 {
121         phandle_t       memoryp, root;
122         cell_t          available[4];
123         cell_t          acells;
124 
125         root = OF_finddevice("/");
126         acells = 1;
127         OF_getprop(root, "#address-cells", &acells, sizeof(acells));
128 
129         memoryp = OF_instance_to_package(memory);
130         OF_getprop(memoryp, "available", available, sizeof(available));
131 
132         heap_base = OF_claim((void *)available[acells-1], size,
133             sizeof(register_t));
134 
135         if (heap_base != (void *)-1) {
136                 heap_size = size;
137         }
138 
139         return (heap_base);
140 }
..
..


sys/boot/ofw/libofw/openfirm.c
..
..
617 /* Claim an area of memory. */
618 void *
619 OF_claim(void *virt, u_int size, u_int align)
620 {
621         static struct {
622                 cell_t name;
623                 cell_t nargs;
624                 cell_t nreturns;
625                 cell_t virt;
626                 cell_t size;
627                 cell_t align;
628                 cell_t baseaddr;
629         } args = {
630                 (cell_t)"claim",
631                 3,
632                 1,
633         };
634 
635         args.virt = (cell_t)virt;
636         args.size = size;
637         args.align = align;
638         if (openfirmware(&args) == -1)
639                 return ((void *)-1);
640         return ((void *)args.baseaddr);
641 }
..
..

I noticed that the NetBSD version only does:
sys/arch/macppc/stand/ofwboot/Locore.c
..
442 return args.baseaddr;
..

How-To-Repeat: Boot from FreeBSD 9.0 CD on an IBM 7028-6E1 or 7028-6C1.
Comment 1 Nathan Whitehorn freebsd_committer freebsd_triage 2012-01-17 00:39:24 UTC
On 01/16/12 16:46, Lyubomir Grigorov wrote:
>> Number:         164225
>> Category:       powerpc
>> Synopsis:       Boot fails on IBM 7028-6E1 (heap memory claim failed)
>> Confidential:   no
>> Severity:       non-critical
>> Priority:       low
>> Responsible:    freebsd-ppc
>> State:          open
>> Quarter:
>> Keywords:
>> Date-Required:
>> Class:          sw-bug
>> Submitter-Id:   current-users
>> Arrival-Date:   Mon Jan 16 22:50:06 UTC 2012
>> Closed-Date:
>> Last-Modified:
>> Originator:     Lyubomir Grigorov
>> Release:        9.0-RELEASE
>> Organization:
>> Environment:
> n/a
>> Description:
> When booting 9.0-RELEASE (32bit ppc) on IBM pSeries 610 (7028-6E1), going to SMS, choosing install device CD-ROM, choosing FreeBSD 9.0, it fails with:
> Heap memory claim failed!

Thanks for debugging it this far! Could you also send a copy of the Open 
Firmware device tree and the contents of the properties under the 
/memory nodes?
-Nathan
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:33 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2018-05-31 16:01:16 UTC
We later determined that we have insufficient support for the 7028.  7029s run but very slowly.  I am currently running a 9133, however.