From owner-svn-src-all@freebsd.org Tue Jan 16 03:52:48 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 078AFE70370; Tue, 16 Jan 2018 03:52:48 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mx0a-0010f301.pphosted.com (mx0a-0010f301.pphosted.com [148.163.149.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D174C8317D; Tue, 16 Jan 2018 03:52:47 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (m0102857.ppops.net [127.0.0.1]) by mx0b-0010f301.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0G3q3O1030706; Tue, 16 Jan 2018 03:52:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rice.edu; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=ricemail; bh=nm9g+58qzcTF3BQrMH9UI7QIkFfWa3ta67ISMoYQqY8=; b=aP3Ajdcyv6UG34PqF42o28+xkJlh+FTbHpwe71yc1DI0zLFYKuuRNr0Kx7niTv5bGQAH ehpOWsNCTpZKJ0h7G2xsM9XF3F+wkan18AZ0ik4Ub63++vDcU28lTOotAUxTdFXVQgJ7 mlEY2Otfqt1IbN5T34tk+7ZnpegjpoHESOocWspMPF/0rrrl14ipxRHGZMkpMySuAfU+ 2umFQi/xracNGVTJfe/PGdJCqYlj2T73nBQRoLV42baf+kiqhwB2w+FwE9Hxv2+GhheR IQNPSsTfL4BFPQ0MCycIb2SMaYqvvmUSqmdB9Xz52e2l9a1bbcoWK37NY0fJv0GMWZEU 8g== Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx0b-0010f301.pphosted.com with ESMTP id 2ff9jqjtu1-1; Tue, 16 Jan 2018 03:52:45 +0000 Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 7ABE1460E47; Mon, 15 Jan 2018 21:52:45 -0600 (CST) Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 798AA460D82; Mon, 15 Jan 2018 21:52:45 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received-X: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id MF0MMn2qe2zz; Mon, 15 Jan 2018 21:52:45 -0600 (CST) Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (112/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id E89A5460D6A; Mon, 15 Jan 2018 21:52:44 -0600 (CST) Subject: Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3 To: Nathan Whitehorn , Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org 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> <20180115234218.GN1684@kib.kiev.ua> From: Alan Cox Message-ID: <7ec31517-8488-dd93-fa30-3400f6a4d562@rice.edu> Date: Mon, 15 Jan 2018 21:52:44 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-16_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=896 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801160053 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: Tue, 16 Jan 2018 03:52:48 -0000 On 01/15/2018 20:40, Nathan Whitehorn wrote: > > > On 01/15/18 15:42, Konstantin Belousov wrote: >> 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 ? > > Yes, sorry for typo. > >> >>> #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 ? > > The existing code is a bit of an awkward superposition of the "return > NULL" idea and having the flag. Since you think there will never be > intermediate cases -- which seems reasonable -- I will rip the > conditional logic out and add a KASSERT matching the ones on arm64 and > amd64 to the powerpc version. > >> >>> 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. > > That is a good idea. > >> Also, just curious, why did you spelled DMAP as DIRECT_MAP ? >> > > DMAP without the PHYS_TO_ seemed lacking in context and I was worried > there might be a collision on DMAP. PMAP_HAS_DMAP would also work; I > don't have a preference. > I would suggest "ARCH_HAS_DMAP".