From owner-freebsd-ppc@freebsd.org Tue Apr 20 19:07:12 2021 Return-Path: Delivered-To: freebsd-ppc@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3EDF15E3F7A for ; Tue, 20 Apr 2021 19:07:12 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic303-25.consmr.mail.gq1.yahoo.com (sonic303-25.consmr.mail.gq1.yahoo.com [98.137.64.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FPtTq17TCz3MZT for ; Tue, 20 Apr 2021 19:07:10 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1618945628; bh=1Pcga9sB7e02EHiXkG44IlRLWIBnhINLdx76lMfQIag=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=YqieIxo+MgQE1Eqcl8k5TXVTsDTMKS7Jn6UE4F5hGGK6WQXobMTNI5DsBbJ4AaLPqTw5pLup6eNC5opMtVVjcvSRA+zaVYpmPGuIEE9LW2NQk7vG+B2w4Z6tci9Uiwo+lrWqEt3AswL6DukjNyFnxOukEgzX3Uv13qX8ZMDeRrrmyahA0rwjOkjzantlO/1Hym4xq/Qk2dKmnmRXKjwstp9XzY1vF86gn9Vi7s8Fv9PpKSsArIajT8J0C/WbVgJNdYONxD+8oMFiIWLLjYBIp8HTe54AuV2kIxyw++Eqh7T+fEiQ+b3Dnp2x27/UWjtZ9Xn6F3uNZWd9jl6DFpavOQ== X-YMail-OSG: tQLR99IVM1kpkSvGyObMFa7nV32t6peyiRUhbu3J5jHSC87fDWoRLGVLXF6E8q9 ZwWmLpb6oV2_9_NMSa4GLfFedw9b7.Q04PApNum6woMKr2WfxSnkqqbNBkaA36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6R52ZB 9PZALAnRycRZrf58OtqCgBTi5sHTvwDtjuXxRVRwTQDK43iDO_8nxsZ835HzVBEovwpZNPOtpo19 60R1xcE.3WyVaMx3xhTkIuBWHf2EdjIf0d2anVWg9CWfLP23l8JWwomtiqr.r90sVE_KoTyF24S. TjyXQbLndRb8zegd7pmd3jACYaAqjd1rSGWvquDcl2EBdD0UzZIQY2wheGbasPiB3ZmuNtlhiLqZ JQ6hWsJ9YJTY6ygyIW00oereGK2Va6iunr4lYzU9ID53QIi6oI6AtCtBOg7HH.PnMG5NkrkQ_kHP ETFu_v.VVuAzp3deRp4d6QHaJscAOzmigXtugA0y1G1yc5oECTUfW0dOlMG1LsX_nsvaRthjxYMu hrtof2_u0.IGAp5I- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.gq1.yahoo.com with HTTP; Tue, 20 Apr 2021 19:07:08 +0000 Received: by kubenode550.mail-prod1.omega.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 019a84cbc68adce4adc528e90f851f91; Tue, 20 Apr 2021 19:07:03 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: mttb in sys/powerpc/include/cpufunc.h still does not handle/protect-against interrupts Message-Id: <3498B555-6C88-4DF4-8291-14E8B9120D4B@yahoo.com> Date: Tue, 20 Apr 2021 12:07:01 -0700 Cc: FreeBSD PowerPC ML To: Brandon Bergren X-Mailer: Apple Mail (2.3654.60.0.2.21) References: <3498B555-6C88-4DF4-8291-14E8B9120D4B.ref@yahoo.com> X-Rspamd-Queue-Id: 4FPtTq17TCz3MZT X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RBL_DBL_DONT_QUERY_IPS(0.00)[98.137.64.206:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[98.137.64.206:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.64.206:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.64.206:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-ppc] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 19:07:12 -0000 Looking at sys/powerpc/include/cpufunc.h in main (and so older too): static __inline void mttb(u_quad_t time) { mtspr(TBR_TBWL, 0); mtspr(TBR_TBWU, (uint32_t)(time >> 32)); mtspr(TBR_TBWL, (uint32_t)(time & 0xffffffff)); } This code still does not protect against interrupts (only suggestive): mtspr(TBR_TBWL, 0); HERE? mtspr(TBR_TBWU, (uint32_t)(time >> 32)); HERE? mtspr(TBR_TBWL, (uint32_t)(time & 0xffffffff)); My code disabled interrupts around the update: static __inline void mttb(u_quad_t time) { const uint32_t high= time>>32; const uint32_t low= time&0xffffffffu; const register_t predisable_msr= intr_disable(); mtspr(TBR_TBWL, 0); mtspr(TBR_TBWU, high); mtspr(TBR_TBWL, low); intr_restore(predisable_msr); } As I remember, I found powerpc documentation that indicated such was important to reliable settings. === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)