From owner-freebsd-ppc@freebsd.org Tue Apr 23 23:12:41 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 528BF15857EB for ; Tue, 23 Apr 2019 23:12:41 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic315-14.consmr.mail.bf2.yahoo.com (sonic315-14.consmr.mail.bf2.yahoo.com [74.6.134.124]) (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 7069D8F7B8 for ; Tue, 23 Apr 2019 23:12:40 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: BlO..gkVM1ly_b3SsUHVRdVtEgL9g4ws6wtguLbo45473Gihmwhv3R5qrAULqDB SkVYHQ4DP1MND4AEz33I1c_ptQOnU3mGsFx4Gu3jpBMrmbnYFzzduHJShLbhHmAy0aQok0CxdUi7 Ybu1ZaE1WwDEhdygFxfyao1dSlXveTdcJ5QT_ItbUZ_1KXg7hWYJEAVEO0kSZH_JfXXXQkQ713ie OC3iZzozGNWqIqXRJOyuEyr50QTInZSp4pXHtdKxvXPQH55z.9BwsvgUsdVJDa2_wN9nPohaLSKU jEnyCxpYxlb7sXbZL3Ip_AzakSIGIRykl..5joe8hVPD6hlDT1xFUmODS4AN7C5oGr8QzskerCVi Ue2XCD54pASgKTr3AeBb0QG7rklO6UuWhtFcoPUzirJ2w3NWkpTufN3Brn_YPiboKr8_8cdqx1f5 Kztvvr.Gvo7dz5w4xUrD5N6rPjCXYWBQRErOm6r4xfhgDqY.hwSj5wS4WCAs3jQIcakM0j5b6bxe DNjPP8sNo8WZrUQPEGpjXUAuOhIL6THG1C2LqVT.AmUZlm_2uUzbs..3ZfoADTQGYzNfXv2WDtvK MVhKRpK3Ol7IIMM8xq62dR0mfcJ_QkFVKHJ6V.M0RWti0Hk4DI68BM4WNCNWLr_WudSXf1AhPgeQ A9Ra8feB6BpLXOmJ23.mD_vtNcW3BEFBBZtiMZs8OjEy.rXReIrChh5nc9uFu5GPbBgo7VYoPpf7 _J.hEm4xCfPUlApvm.QQxJOa4Gj2W8UGBdhoOXHP65gFrERN9SSIxPow44js.hK5izIAbpPlXwJG yetQlsYflEare4R_YYhYMiwikzhhCzH3kfuZfwxhuER9cRpJgsKgMFzw5XHgwY_bUKnQb5jkYi7L uHo3DxpJ8kUBsUUW9Sp0eLZ0ddxs8NmDKA4EPuvoc3Z609j6icj.XsxBSsH.M76Qd15lzjS4jc1n IcrncBr8xFe1dsD5Yl1lyRCPc2YqARjVoh9UViW3JksdUXzFG7CJCy4GXkkJorNOoVFBihGhjFiu 99DnaMh9yj61jt7Y6EgTGn2XyJHqDPzuNRi16cr89HcLeIKp2YNp4j5rcdscfAQdg4p1rvXUgZYZ alFN5CUIl2FjS620jmS2y79niJnM- Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.bf2.yahoo.com with HTTP; Tue, 23 Apr 2019 23:12:38 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.103]) ([76.115.7.162]) by smtp429.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 6ae4dd3fe6d19abb1d20a40f5c767174; Tue, 23 Apr 2019 23:02:34 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: 32-bit powerpc and powerpc64 context, struct mtx NAME declarations vs. the reservation area for the likes of lwarx: should mtx_padalign be used instead? Message-Id: <675FD8EE-384D-4D31-9B27-036ECEE717B0@yahoo.com> Date: Tue, 23 Apr 2019 16:02:32 -0700 To: FreeBSD PowerPC ML , Justin Hibbits X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: 7069D8F7B8 X-Spamd-Bar: +++ X-Spamd-Result: default: False [3.46 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; SUBJECT_ENDS_QUESTION(1.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:26101, ipnet:74.6.128.0/21, country:US]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; NEURAL_SPAM_SHORT(0.32)[0.321,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.37)[ip: (4.05), ipnet: 74.6.128.0/21(1.58), asn: 26101(1.26), country: US(-0.06)]; NEURAL_SPAM_MEDIUM(0.29)[0.291,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.99)[0.990,0]; RCVD_IN_DNSWL_NONE(0.00)[124.134.6.74.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[124.134.6.74.rep.mailspike.net : 127.0.0.17] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 23:12:41 -0000 [This is just something I noted while trying to figure out what might be leading to Data Storage Interrupt problems for an iMac G3 (MPC750). Not that it is known to contribute to anything that I've been looking at.] Instructions like lwarx reserve a cache-line range of RAM, for example: A) MPC750: 32-bytes (Address&0x20 aligned) B) 970MP: 128-bytes (Address&0x80 aligned) For instances of: struct mtx { struct lock_object lock_object; /* Common lock properties. */ volatile uintptr_t mtx_lock; /* Owner and flags. */ }; such as: . . . struct mtx moea_table_mutex; struct mtx moea_vsid_mutex; static struct mtx tlbie_mtx; . . . the instances need not have distinct reservation areas for mtx_lock use. (Some lock_object material will also likely be in the reservation area.) The ". . ."s might also overlap into the reservation area(s). (I've ignored that the declaration order need not be the in-memory order. But the general point stands.) The: . . . struct mtx moea64_slb_mutex; . . . and . . . . . . struct mtx pcicfg_mtx; . . . are similar. There could well be more. I did not try to find them all. There does appear to be: struct mtx_padalign { struct lock_object lock_object; /* Common lock properties. */ volatile uintptr_t mtx_lock; /* Owner and flags. */ } __aligned(CACHE_LINE_SIZE); to help with avoiding such overlaps, but still leaving (part of) lock_object as likely in the reservation area with the mtx_lock field. (CACHE_LINE_SIZE seems to be 128 for 32-bit powerpc and powerpc64, if I remember right.) === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)