Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Jul 2018 16:29:26 +0300
From:      "Jukka A. Ukkonen" <jau789@gmail.com>
To:        Nathan Whitehorn <nwhitehorn@freebsd.org>
Cc:        freebsd-ppc@freebsd.org
Subject:   Re: 11.2-RC3 powerpc CD image does not boot on PowerMac G4
Message-ID:  <525edae8-db71-f904-1dbd-5f30f19eca08@gmail.com>
In-Reply-To: <c5d687cd-cc09-fa15-9e46-216a8f264146@freebsd.org>
References:  <dc927eb2-66e3-98f3-f994-590d0fd3896f@gmail.com> <b8522d23-2ae0-e80c-170e-61e1300f5137@freebsd.org> <509952F5-1E4A-4FA0-8C78-567EC9089827@gmail.com> <c5d687cd-cc09-fa15-9e46-216a8f264146@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------9384B2A63BC9203354AD1D3B
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit


I tried browsing through everything that has been changed in
the ppc SMP code since 10.4. I cannot claim much success, though.
Anyhow I found one odd feature which does not quite make sense
on a 32-bit platform. Obviously I also patched it and tested
the resulting kernel. Even if this was not the reason for boot
failures on SMP ppc systems, it might be worth to patch in the
official source code. Casting 32-bit pointers to 64-bit unsigned
values for comparison only slows things down on 32-bit systems.
Obviously the compiler will optimize the patched code such that
the unused if-branch will completely removed in the resulting
binary.

11.2 still fails to boot on SMP ppc, but I have no idea what to
test next.

--jau

--------------9384B2A63BC9203354AD1D3B
Content-Type: text/x-patch;
 name="PPC-platform.c.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="PPC-platform.c.diff"

Index: sys/powerpc/powerpc/platform.c
===================================================================
--- sys/powerpc/powerpc/platform.c	(revision 335668)
+++ sys/powerpc/powerpc/platform.c	(working copy)
@@ -87,8 +87,14 @@
 memr_merge(struct mem_region *from, struct mem_region *to)
 {
 	vm_offset_t end;
-	end = uqmax(to->mr_start + to->mr_size, from->mr_start + from->mr_size);
-	to->mr_start = uqmin(from->mr_start, to->mr_start);
+	if (sizeof(end) == 8) {
+		end = uqmax(to->mr_start + to->mr_size, from->mr_start + from->mr_size);
+		to->mr_start = uqmin(from->mr_start, to->mr_start);
+	}
+	else /* (sizeof(end) == 4) */ {
+		end = ulmax(to->mr_start + to->mr_size, from->mr_start + from->mr_size);
+		to->mr_start = ulmin(from->mr_start, to->mr_start);
+	}
 	to->mr_size = end - to->mr_start;
 }
 

--------------9384B2A63BC9203354AD1D3B--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?525edae8-db71-f904-1dbd-5f30f19eca08>