From owner-freebsd-ppc@freebsd.org Tue Feb 19 02:58:56 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 0D96414D5F09 for ; Tue, 19 Feb 2019 02:58:56 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic308-12.consmr.mail.ne1.yahoo.com (sonic308-12.consmr.mail.ne1.yahoo.com [66.163.187.35]) (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 B2F9C962A2 for ; Tue, 19 Feb 2019 02:58:53 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: oA4i4NAVM1leUWWN4O.HZIOhKXPAod7.V3sXKMgcXUsiZtF2OPPK2ovmYcWWk9D Y59sD00yx3r.rzb_BiRVCtJeXt88AXND14hAme8T028k6pCDgcyJHo6WQ_heKkkoqhQ9LPleGKWv figjfUiyIZz4vVw52kt3feyjBCJauD3Fn81.j07j1iRNE7mh.w1WC1xxYu0F5kE22wN10v4sJbKS rxLx8ZLpYDZG.cLptLIO1Ls8LYmpQRztjYfg5t9iVr8gWyFyk.3gnvRIn5RciM6DytCsVt8qeRW7 .m9c3mqobWHE06mdkGAaYIZQNzBJD8o46roEhI4ZmHYdOpVHSvz1SlX.unuvLMU0syxbrqdTPZrK yPe8.yFOqJqVgDAxBm9RHaDd3ZCx_S.lwm.cDz5zY.zRoYAkWuM9l_IRVq8.U7KhMs8wgC6cVR9. qV0WF3KZ5li4S9Kh9.kdfj_BtPhX6MIa46vOrwfBg4o1L8lk_uIXB8CtlqKv1vlSDeoY4lmXx5S7 CF0agvSmNKWvfzxMr3WjH.znql03qcL4asiWrGxPR3DPz0o7ZaxB9IzF80daNwWokZP86VszlaUE fawkeDRy63nQozJawDm1RWD4y_Waiz5O1tB4udEcQIp.Ottmsr6p8cgVqFq2tKPuplzJz2T0KnwP I7bvpGkJsqYMdjQ6a0PJ3__3flRZ.jA5m2qrxsiEF.gTpI8Ualqfvz4Hg8fcboQGMevOKGfSTjQv enTvFeDs01qO0yXjFAz72Dw3lHavZaRq1tjbOg9dNJC2edtaewUPKMb.KVYszJeDehZEM8cWt.7d 1YIkVkkRRU4ChpJwcuPZGWTw1jnLiLvOKmfuhdcFAsGM9d6Vgiy1KbGoYJyqwLsEDgiQeuXZOOd_ _eVFGIyLZOymWx2aRxrJbvys9UrzdsXiOGmCa28LUb2_Gn4MPw5odcvkWwJLzy9mlcjHMTGxnv.S UaFJFoLggVZrrDsS1iJBMfeewlzjdr.MdXIjGoeLKVrCWWJgqbub2S3tbcLPbEGj9Y0s9l7p3SHD Sv3mdR32cC6lXFMS1X9k7VDTRdAuNHCeB9Am.9unutOLL7YtltIeukRax9el76Fgc Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ne1.yahoo.com with HTTP; Tue, 19 Feb 2019 02:58:46 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.113]) ([67.170.167.181]) by smtp428.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 071f5e2723ba0e299e9b13300a5a998f; Tue, 19 Feb 2019 02:58:45 +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.2 \(3445.102.3\)) Subject: Question on "Map the entire KVA range into the SLB. We must not fault there" vs. the modern VM_MAX_KERNEL_ADDRESS Message-Id: Date: Mon, 18 Feb 2019 18:58:43 -0800 Cc: FreeBSD PowerPC ML To: Justin Hibbits X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: B2F9C962A2 X-Spamd-Bar: + X-Spamd-Result: default: False [1.55 / 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]; FREEMAIL_TO(0.00)[gmail.com]; 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:36646, ipnet:66.163.184.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.73)[0.734,0]; NEURAL_HAM_LONG(-0.19)[-0.188,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.09)[ip: (3.58), ipnet: 66.163.184.0/21(1.09), asn: 36646(0.87), country: US(-0.07)]; NEURAL_SPAM_MEDIUM(0.42)[0.421,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[35.187.163.66.list.dnswl.org : 127.0.5.0] 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, 19 Feb 2019 02:58:56 -0000 It takes me a bit to provide context for the question . . . I'll first note: #define VM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS moea64_mid_bootstrap has: virtual_avail = VM_MIN_KERNEL_ADDRESS; virtual_end = VM_MAX_SAFE_KERNEL_ADDRESS; /* * Map the entire KVA range into the SLB. We must not fault there. */ #ifdef __powerpc64__ for (va = virtual_avail; va < virtual_end; va += SEGMENT_LENGTH) moea64_bootstrap_slb_prefault(va, 0); #endif but the prefaulting is based on: #define PCPU_MD_AIM64_FIELDS \ struct slb slb[64]; \ where the slb is based on the upper 36 bits of the passed-in va values (effective address value in powerpc terms). The address range now being covered is: #define VM_MIN_KERNEL_ADDRESS 0xe000000000000000 #define VM_MAX_KERNEL_ADDRESS 0xe0000007ffffffff So for the upper 36 bits: 0xe000_0000_0 0xe000_0007_f and the range 0x00 through 0x7f has 128 possibilities. So more than the slb can track. (Also: slb[USER_SLB_SLOT] is avoided so really 63 of the 64 are available.) Later (larger) va values are the replacing earlier (smaller) va values via slb_insert_kernel usage that in turn involves random replacements via (n_slbs being 64 in the G5 context): i = mftb() % n_slbs; if (i == USER_SLB_SLOT) i = (i+1) % n_slbs; So apparently only the last 63 from: for (va = virtual_avail; va < virtual_end; va += SEGMENT_LENGTH) moea64_bootstrap_slb_prefault(va, 0); are known to still be present in the slb. So the question . . . How can: "Map the entire KVA range into the SLB. We must not fault there" be true? Is it really a requirement? If it is, then something seems to be wrong as far as handling the modern VM_MAX_KERNEL_ADDRESS value goes. The old VM_MAX_KERNEL_ADDRESS value would have 0x00 through 0x1c and so would fit this particular constraint. The old value 0xe0000001c7ffffff looks like something was being avoided (why not 0xe0000001ffffffff ?). But I've not found what or why. === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)