From owner-svn-src-head@freebsd.org Thu Apr 25 18:43:10 2019 Return-Path: Delivered-To: svn-src-head@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 35C84159F56C; Thu, 25 Apr 2019 18:43:10 +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 4063A94874; Thu, 25 Apr 2019 18:43:09 +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 x3PIh0Hf034811 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 25 Apr 2019 21:43:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x3PIh0Hf034811 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x3PIh0nB034810; Thu, 25 Apr 2019 21:43:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 25 Apr 2019 21:43:00 +0300 From: Konstantin Belousov To: Tycho Nightingale Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346687 - head/sys/compat/linuxkpi/common/src Message-ID: <20190425184300.GM12936@kib.kiev.ua> References: <201904251813.x3PIDut8078016@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201904251813.x3PIDut8078016@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 18:43:10 -0000 On Thu, Apr 25, 2019 at 06:13:56PM +0000, Tycho Nightingale wrote: > Author: tychon > Date: Thu Apr 25 18:13:55 2019 > New Revision: 346687 > URL: https://svnweb.freebsd.org/changeset/base/346687 > > Log: > LinuxKPI buildfix for ppc64 after r346645. > > Proposed by: hselasky > Sponsored by: Dell EMC Isilon > > Modified: > head/sys/compat/linuxkpi/common/src/linux_pci.c > > Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c > ============================================================================== > --- head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Apr 25 17:28:36 2019 (r346686) > +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Apr 25 18:13:55 2019 (r346687) > @@ -137,9 +137,9 @@ linux_dma_tag_init(struct device *dev, u64 dma_mask) > dma_mask, /* lowaddr */ > BUS_SPACE_MAXADDR, /* highaddr */ > NULL, NULL, /* filtfunc, filtfuncarg */ > - BUS_SPACE_MAXADDR, /* maxsize */ > + BUS_SPACE_MAXSIZE, /* maxsize */ > 1, /* nsegments */ > - BUS_SPACE_MAXADDR, /* maxsegsz */ > + BUS_SPACE_MAXSIZE, /* maxsegsz */ > 0, /* flags */ > NULL, NULL, /* lockfunc, lockfuncarg */ > &priv->dmat); It seems that amd64 BUS_SPACE_MAXSIZE is 4G, I do not know why. Either we should fix that, or the following fix is more appropriate. i386 and ppc both have PAE-like configs where maxaddr is 64bit but maxsize is 32bit. diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 4e93827e2e9..ed0d5575b05 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -137,9 +137,17 @@ linux_dma_tag_init(struct device *dev, u64 dma_mask) dma_mask, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filtfunc, filtfuncarg */ +#if defined(__i386__) || defined(__powerpc__) + BUS_SPACE_MAXSIZE, +#else BUS_SPACE_MAXADDR, /* maxsize */ +#endif 1, /* nsegments */ +#if defined(__i386__) || defined(__powerpc__) + BUS_SPACE_MAXSIZE, +#else BUS_SPACE_MAXADDR, /* maxsegsz */ +#endif 0, /* flags */ NULL, NULL, /* lockfunc, lockfuncarg */ &priv->dmat);