From owner-freebsd-ppc@freebsd.org Wed Sep 21 17:28:05 2016 Return-Path: Delivered-To: freebsd-ppc@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 2A810BE2237; Wed, 21 Sep 2016 17:28:05 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 018A610B; Wed, 21 Sep 2016 17:28:04 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-io0-x244.google.com with SMTP id q92so3602840ioi.2; Wed, 21 Sep 2016 10:28:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=cc:message-id:from:to:in-reply-to:content-transfer-encoding :mime-version:subject:date:references; bh=SPQ8oillM8jNE9TzxZKy6+qxxHagX+/brQpbexBqnZA=; b=GJV+LQTHydxh4+g2/nC6UXVzoq5nFaG2rrexGY7yR56LWRx6NFJRNBaCiesIqcyHaB BWzhXNemUrnvU4+0otzZV9E/ZGitxtZItb22aPKA+OsssneClvvTvNwb/9sVthumZf4m WElzwPtDioyNpLxrFxQ41WbO04z/OO4J+v57udidUTs0fl61gSvJviaAq5ZBTOGoUbgL kFKmKA59xr9c3mtXMtg1bv6XYfT7+VOVt2rApGBRH0xTnKtaZGT1YPc7+lvoqU05NHUz PHECI7D/UHPKrIV7XgyXovzXX4Sna1mtKPlxYPuMNWJ1DbDRo/bl3Lnui1hcM29Kev6V Hjww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:cc:message-id:from:to:in-reply-to :content-transfer-encoding:mime-version:subject:date:references; bh=SPQ8oillM8jNE9TzxZKy6+qxxHagX+/brQpbexBqnZA=; b=GMof7l2elhR9Ne1qqGpH1MojQ0mM4TKLb9BIIn4TYOjAlZgogM62irROSH++ooRTDV VKR6fX6HW/hj8immbMCXlSjLMNVfe5HRsNPSA8clpMrTQsw8jjmVO1Az9xQG9YUkRo9f 8efNbN7As5hxOdmEkrnCjYhfK67ZUFm+Bf7GoANhuzk1qSjHOgaHhVinNxyEur8UZSLO u0lOqfW3PmkBFdfUTt7czoH6YOZbmM/2eIQT5pmqkMRUXkPcmoVeCzJQT3Fql73X88Hy vfHma8je1uCau/SRE8o8wreiFD3Ckf4Yb2ZCTBfrdWLzwuE0rh2ddpPf75BqXo/4569b dyUg== X-Gm-Message-State: AE9vXwPJY4vwcG/6R8y12ipfURblar2wLtovhq9k9TXAJvDfGA2mQ1nWCXnWCaRrOD5n1w== X-Received: by 10.107.16.29 with SMTP id y29mr48519472ioi.143.1474478884158; Wed, 21 Sep 2016 10:28:04 -0700 (PDT) Received: from blackstar.knownspace (50-80-150-234.client.mchsi.com. [50.80.150.234]) by smtp.gmail.com with ESMTPSA id 1sm13235713ioz.34.2016.09.21.10.28.03 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 21 Sep 2016 10:28:03 -0700 (PDT) Cc: Nathan Whitehorn , FreeBSD PowerPC ML , svn-src-head@freebsd.org Message-Id: <917EFF5A-D054-4424-9D7D-4E4BEF6072EF@gmail.com> From: Justin Hibbits To: Mark Millard In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: svn commit: r306065 - in head/sys vs. PowerMacs: Nathan's trail patch included but inappropriate? Date: Wed, 21 Sep 2016 12:28:02 -0500 References: X-Mailer: Apple Mail (2.936) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 17:28:05 -0000 On Sep 21, 2016, at 1:46 AM, Mark Millard wrote: > The following from > > https://lists.freebsd.org/pipermail/svn-src-head/2016-September/091934.html > > seems in include a patch that Nathan made for testing on PowerMac/ > iMac/Xserve G5's that failed the PowerMac7,3 test that was tried by > Jukka A. Ukkonen. > >> Modified: head/sys/powerpc/ofw/ofw_machdep.c >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- head/sys/powerpc/ofw/ofw_machdep.c Wed Sep 21 02:27:23 2016 >> (r306064) >> +++ head/sys/powerpc/ofw/ofw_machdep.c Wed Sep 21 02:28:39 2016 >> (r306065) >> @@ -99,6 +99,7 @@ ofw_restore_trap_vec(char *restore_trap_ >> /* >> * Saved SPRG0-3 from OpenFirmware. Will be restored prior to the >> callback. >> */ >> +#ifndef __powerpc64__ >> register_t ofw_sprg0_save; >> >> static __inline void >> @@ -140,6 +141,8 @@ ofw_sprg_restore(void) >> } >> #endif >> >> +#endif >> + >> static int >> parse_ofw_memory(phandle_t node, const char *prop, struct >> mem_region *output) >> { >> @@ -344,11 +347,12 @@ OF_initial_setup(void *fdt_ptr, void *ju >> ofmsr[0] = mfmsr(); >> #ifdef __powerpc64__ >> ofmsr[0] &= ~PSL_SF; >> - #endif >> + #else >> __asm __volatile("mfsprg0 %0" : "=&r"(ofmsr[1])); >> __asm __volatile("mfsprg1 %0" : "=&r"(ofmsr[2])); >> __asm __volatile("mfsprg2 %0" : "=&r"(ofmsr[3])); >> __asm __volatile("mfsprg3 %0" : "=&r"(ofmsr[4])); >> + #endif >> openfirmware_entry = openfirm; >> >> if (ofmsr[0] & PSL_DR) >> @@ -440,7 +444,9 @@ openfirmware_core(void *args) >> */ >> oldmsr = intr_disable(); >> >> +#ifndef __powerpc64__ >> ofw_sprg_prepare(); >> +#endif >> >> /* Save trap vectors */ >> ofw_save_trap_vec(save_trap_of); >> @@ -463,7 +469,9 @@ openfirmware_core(void *args) >> /* Restore trap vecotrs */ >> ofw_restore_trap_vec(save_trap_of); >> >> +#ifndef __powerpc64__ >> ofw_sprg_restore(); >> +#endif >> >> intr_restore(oldmsr); > > Part of the ofw_sprg_prepare() and ofw_sprg_restore() activity is > required for PowerMac G5's to boot: the save of the FreeBSD sprg0 > value and its later restore back to sprg0. (Established by other > testing after Nathan's patch was tried.) > > My guess is that this code was accidentally included in -r306065, > not intentionally included. > > > [There is the separate issue that avoiding restoring the Open > Firmware sprg0 value before calling into Open Firmware (leaving the > FreeBSD value in place) helps PowerMac G5's boot more reliably by > allowing correct handling some SLB faults that sometimes occur.] > > === > Mark Millard > markmi at dsl-only.net > Crap, I got extra stuff in my diff. Going to revert this part tonight, until everything is known good. - Justin