From owner-svn-src-all@freebsd.org Tue Nov 20 16:06:44 2018 Return-Path: Delivered-To: svn-src-all@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 7199C11342A6; Tue, 20 Nov 2018 16:06:44 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF51E739B2; Tue, 20 Nov 2018 16:06:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAKG6gnL067433; Tue, 20 Nov 2018 08:06:42 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAKG6gu5067432; Tue, 20 Nov 2018 08:06:42 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811201606.wAKG6gu5067432@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340678 - head/sys/arm64/arm64 In-Reply-To: <201811201512.wAKFCbv4042989@repo.freebsd.org> To: Mark Johnston Date: Tue, 20 Nov 2018 08:06:42 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: CF51E739B2 X-Spamd-Result: default: False [1.23 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.57)[0.570,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.55)[0.553,0]; NEURAL_HAM_SHORT(-0.76)[-0.760,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 16:06:44 -0000 > Author: markj > Date: Tue Nov 20 15:12:37 2018 > New Revision: 340678 > URL: https://svnweb.freebsd.org/changeset/base/340678 > > Log: > Handle kernel superpage mappings in pmap_remove_l2(). > > PR: 233088 > Reviewed by: alc, andrew, kib > Tested by: sbruno > MFC after: 3 days > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D17981 Mark, If this is the fix for the aarch64/arm64 build cluster failure could you *please* make sure it gets MFC and MFS to releng/12 before this thursdays builds of RC2? Ie, about the next 24 hours? Consider this an RE approval for immediate MFC to stable/12 so that you can send an MFS RFA to merge it to releng/12 which well take another re to approve. Thanks, Rod Modified: > head/sys/arm64/arm64/pmap.c > > Modified: head/sys/arm64/arm64/pmap.c > ============================================================================== > --- head/sys/arm64/arm64/pmap.c Tue Nov 20 14:59:27 2018 (r340677) > +++ head/sys/arm64/arm64/pmap.c Tue Nov 20 15:12:37 2018 (r340678) > @@ -2382,8 +2382,40 @@ pmap_pv_insert_l2(pmap_t pmap, vm_offset_t va, pd_entr > return (true); > } > > +static void > +pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) > +{ > + pt_entry_t newl2, oldl2; > + vm_page_t ml3; > + vm_paddr_t ml3pa; > + > + KASSERT(!VIRT_IN_DMAP(va), ("removing direct mapping of %#lx", va)); > + KASSERT(pmap == kernel_pmap, ("pmap %p is not kernel_pmap", pmap)); > + PMAP_LOCK_ASSERT(pmap, MA_OWNED); > + > + ml3 = pmap_remove_pt_page(pmap, va); > + if (ml3 == NULL) > + panic("pmap_remove_kernel_l2: Missing pt page"); > + > + ml3pa = VM_PAGE_TO_PHYS(ml3); > + newl2 = ml3pa | L2_TABLE; > + > + /* > + * Initialize the page table page. > + */ > + pagezero((void *)PHYS_TO_DMAP(ml3pa)); > + > + /* > + * Demote the mapping. The caller must have already invalidated the > + * mapping (i.e., the "break" in break-before-make). > + */ > + oldl2 = pmap_load_store(l2, newl2); > + KASSERT(oldl2 == 0, ("%s: found existing mapping at %p: %#lx", > + __func__, l2, oldl2)); > +} > + > /* > - * pmap_remove_l2: do the things to unmap a level 2 superpage in a process > + * pmap_remove_l2: Do the things to unmap a level 2 superpage. > */ > static int > pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, > @@ -2419,16 +2451,18 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ > vm_page_aflag_clear(m, PGA_WRITEABLE); > } > } > - KASSERT(pmap != kernel_pmap, > - ("Attempting to remove an l2 kernel page")); > - ml3 = pmap_remove_pt_page(pmap, sva); > - if (ml3 != NULL) { > - pmap_resident_count_dec(pmap, 1); > - KASSERT(ml3->wire_count == NL3PG, > - ("pmap_remove_l2: l3 page wire count error")); > - ml3->wire_count = 1; > - vm_page_unwire_noq(ml3); > - pmap_add_delayed_free_list(ml3, free, FALSE); > + if (pmap == kernel_pmap) { > + pmap_remove_kernel_l2(pmap, l2, sva); > + } else { > + ml3 = pmap_remove_pt_page(pmap, sva); > + if (ml3 != NULL) { > + pmap_resident_count_dec(pmap, 1); > + KASSERT(ml3->wire_count == NL3PG, > + ("pmap_remove_l2: l3 page wire count error")); > + ml3->wire_count = 1; > + vm_page_unwire_noq(ml3); > + pmap_add_delayed_free_list(ml3, free, FALSE); > + } > } > return (pmap_unuse_pt(pmap, sva, l1e, free)); > } > > -- Rod Grimes rgrimes@freebsd.org