From owner-freebsd-bugs@freebsd.org Sat May 27 07:37:49 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BD12D84F9B for ; Sat, 27 May 2017 07:37:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20E841FC6 for ; Sat, 27 May 2017 07:37:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v4R7bnQ5066883 for ; Sat, 27 May 2017 07:37:49 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 219589] head -r317820 (e.g.); stable/11: TARGET_ARCH=powerpc needs a (somewhat dynamic) variant of powerpc64's 205458 fix if PowerMac G5's are to be supported Date: Sat, 27 May 2017 07:37:49 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: markmi@dsl-only.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 May 2017 07:37:49 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D219589 Bug ID: 219589 Summary: head -r317820 (e.g.); stable/11: TARGET_ARCH=3Dpowerpc needs a (somewhat dynamic) variant of powerpc64's 205458 fix if PowerMac G5's are to be supported Product: Base System Version: CURRENT Hardware: powerpc OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: markmi@dsl-only.net TARGET_ARCH=3Dpowerpc64 got a fix to bugzilla 205458. It turns out that TARGET_ARCH=3Dpowerpc needs to detect when it is running on powerpc64 and do the same thing. The issue is that for powerpc64 it is inappropriate to restore the sprg0 value to its openfirmware value. This is because the FreeBSD real-mode handling is involved instead of the openfirmware's original virtual mode. Quoting Nathan W. from Comment #4 of 205458: Where this explodes is if OF uses an unmapped SLB entry. The SLB fault hand= ler runs in real mode and refers to the PCPU pointer in SPRG0, which blows up t= he kernel. Having a value of SPRG0 that works for the kernel is less fatal than preserving OF's value in this case. I know that part of the code does detect the powerpc64 context vs. not and does things differently to emulate being powerpc like on powerpc64 (such as limiting RAM use as a consequence). The powerpc64 vs. not status needs to be recorded and used to control a sprg0 restoration choice: avoid restoring openfirmware's value on powerpc64; otherwise restore it. https://lists.freebsd.org/pipermail/freebsd-ppc/2017-May/008891.html has details of the periodic/random panics that can occur as things are. (I've other reports on the lists as well but the above has the best details, such as backtraces and other information.) --=20 You are receiving this mail because: You are the assignee for the bug.=