On Tue, Jul 10, 2018 at 06:57:31PM +0200, Mark Kettenis wrote:
> > Date: Tue, 10 Jul 2018 18:34:20 +0200
> > From: "Peter J. Philipp" <[email protected]>
> > 
> >     Node 0xff891d98
> >         name: 'memory'
> >         device_type: 'memory'
> >         reg: 
> > 00000000.00000000.40000000.00000000.40000000.40000000.00000001.00000000.40000000.00000001.40000000.40000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000
> 
> So you have four banks of memory:
> 
> 0x40000000 @ 0x00000000000000000
> 0x40000000 @ 0x00000000040000000
> 0x40000000 @ 0x00000000100000000
> 0x40000000 @ 0x00000000140000000
> 
> The last two have a starting address >= 0x0000000100000000 and
> therefore can't be used in 32-bit mode.  So these should not be
> counted.
> 
> Cheers,
> 
> Mark

Hi Mark,

Since you left me the work I was delighted I can do something here :-).

With my patch the memory is at 2GB which is fine with me as there is a 2GB
limit of some kind anyhow.  I tested my patch and this is what the dmesg
reports:

iota# dmesg|grep -2 ^real
OpenBSD 6.3-current (GENERIC.MP) #106: Tue Jul  3 18:16:21 MDT 2018
    [email protected]:/usr/src/sys/arch/macppc/compile/GENERIC.MP
real mem = 0 (0MB)
avail mem = 2020474880 (1926MB)
mpath0 at root
--
OpenBSD 6.3-current (GENERIC.MP) #11: Tue Jul 10 19:08:55 CEST 2018
    [email protected]:/usr/src/sys/arch/macppc/compile/GENERIC.MP
real mem = 2147483648 (2048MB)
avail mem = 2053386240 (1958MB)
mpath0 at root

The patch is below my signature.

Thanks!

-peter


Index: ofw_machdep.c
===================================================================
RCS file: /cvs/src/sys/arch/macppc/macppc/ofw_machdep.c,v
retrieving revision 1.56
diff -u -p -u -r1.56 ofw_machdep.c
--- ofw_machdep.c       22 Jul 2017 18:33:38 -0000      1.56
+++ ofw_machdep.c       10 Jul 2018 17:12:10 -0000
@@ -173,9 +173,9 @@ ofw_read_mem_regions(int phandle, int ad
                for (i = 0, j = 0; i < nreg; i++) {
                        if (OFmem64[i].size == 0)
                                continue;
-                       physpages += atop(OFmem64[i].size);
                        if (OFmem64[i].start >= 1ULL << 32)
                                continue;
+                       physpages += atop(OFmem64[i].size);
                        OFmem[j].start = OFmem64[i].start;
                        if (OFmem64[i].start + OFmem64[i].size >= 1ULL << 32)
                                OFmem[j].size = (1ULL << 32) - OFmem64[i].start;

Reply via email to