From owner-svn-src-all@freebsd.org Mon Jan 15 23:42:31 2018 Return-Path: Delivered-To: svn-src-all@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 D9E55E7F5AC; Mon, 15 Jan 2018 23:42:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 804DE763FA; Mon, 15 Jan 2018 23:42:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w0FNgJgb058058 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 16 Jan 2018 01:42:22 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w0FNgJgb058058 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w0FNgICL058057; Tue, 16 Jan 2018 01:42:18 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 16 Jan 2018 01:42:18 +0200 From: Konstantin Belousov To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 Message-ID: <20180115234218.GN1684@kib.kiev.ua> References: <20180114175211.GD1684@kib.kiev.ua> <20180115111812.GF1684@kib.kiev.ua> <20180115170603.GJ1684@kib.kiev.ua> <9e5554d7-6a0c-5910-8cb6-74f98259536f@freebsd.org> <20180115175335.GK1684@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 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: Mon, 15 Jan 2018 23:42:31 -0000 On Mon, Jan 15, 2018 at 03:20:49PM -0800, Nathan Whitehorn wrote: > Fair enough. Here's a patch with a new flag (DIRECT_MAP_AVAILABLE). I've > also retooled the sfbuf code to use this rather than its own flags that > mean the same things. The sparc64 part of the patch is untested. > -Nathan > Index: amd64/include/vmparam.h > =================================================================== > --- amd64/include/vmparam.h (revision 328006) > +++ amd64/include/vmparam.h (working copy) > @@ -190,6 +190,7 @@ > * because the result is not actually accessed until later, but the early > * vt fb startup needs to be reworked. > */ > +#define DIRECT_MAP_AVAILABLE 1 > #define PHYS_TO_DMAP(x) ({ \ > KASSERT(dmaplimit == 0 || (x) < dmaplimit, \ > ("physical address %#jx not covered by the DMAP", \ > Index: arm64/include/vmparam.h > =================================================================== > --- arm64/include/vmparam.h (revision 328006) > +++ arm64/include/vmparam.h (working copy) > @@ -176,6 +176,7 @@ > #define VIRT_IN_DMAP(va) ((va) >= DMAP_MIN_ADDRESS && \ > (va) < (dmap_max_addr)) > > +#define DIRECT_MAP_AVAILABLE Just define, or define it to 1 ? > #define PHYS_TO_DMAP(pa) \ > ({ \ > KASSERT(PHYS_IN_DMAP(pa), \ > Index: dev/efidev/efirt.c > =================================================================== > --- dev/efidev/efirt.c (revision 328006) > +++ dev/efidev/efirt.c (working copy) > @@ -115,6 +115,11 @@ > return (0); > } > efi_systbl = (struct efi_systbl *)PHYS_TO_DMAP(efi_systbl_phys); > + if (efi_systbl == NULL) { > + if (bootverbose) > + printf("EFI systbl not mapped in kernel VA\n"); > + return (0); > + } Is this chunk still needed ? > if (efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) { > efi_systbl = NULL; > if (bootverbose) > Index: kern/subr_sfbuf.c > =================================================================== > --- kern/subr_sfbuf.c (revision 328006) > +++ kern/subr_sfbuf.c (working copy) > @@ -88,8 +88,8 @@ > vm_offset_t sf_base; > int i; > > -#ifdef SFBUF_OPTIONAL_DIRECT_MAP > - if (SFBUF_OPTIONAL_DIRECT_MAP) > +#ifdef DIRECT_MAP_AVAILABLE > + if (DIRECT_MAP_AVAILABLE) > return; Would it make sense to define the symbol on all other arches as 0 then, and remove #ifdef ? Returning to your initial proposal of relying on the compiler optimiing if (0) block; out. Also, just curious, why did you spelled DMAP as DIRECT_MAP ?