From owner-freebsd-mips@FreeBSD.ORG Sun Sep 5 07:33:18 2010 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8275410656C8; Sun, 5 Sep 2010 07:33:18 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id 3F5718FC0C; Sun, 5 Sep 2010 07:33:17 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.3) with ESMTP id o857XH6f031705; Sun, 5 Sep 2010 03:33:17 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.3/Submit) id o857XHTR031704; Sun, 5 Sep 2010 07:33:17 GMT (envelope-from tinderbox@freebsd.org) Date: Sun, 5 Sep 2010 07:33:17 GMT Message-Id: <201009050733.o857XHTR031704@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [releng_8 tinderbox] failure on mips/mips X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2010 07:33:18 -0000 TB --- 2010-09-05 06:55:17 - tinderbox 2.6 running on freebsd-current.sentex.ca TB --- 2010-09-05 06:55:17 - starting RELENG_8 tinderbox run for mips/mips TB --- 2010-09-05 06:55:17 - cleaning the object tree TB --- 2010-09-05 06:55:33 - cvsupping the source tree TB --- 2010-09-05 06:55:33 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/RELENG_8/mips/mips/supfile TB --- 2010-09-05 07:33:17 - WARNING: /usr/bin/csup returned exit code 1 TB --- 2010-09-05 07:33:17 - ERROR: unable to cvsup the source tree TB --- 2010-09-05 07:33:17 - 0.48 user 13.61 system 2280.27 real http://tinderbox.freebsd.org/tinderbox-releng_8-RELENG_8-mips-mips.full From owner-freebsd-mips@FreeBSD.ORG Sun Sep 5 09:06:36 2010 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 692E410656BC; Sun, 5 Sep 2010 09:06:36 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id 268118FC12; Sun, 5 Sep 2010 09:06:35 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.3) with ESMTP id o8596Z7f032072; Sun, 5 Sep 2010 05:06:35 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.3/Submit) id o8596Znf032071; Sun, 5 Sep 2010 09:06:35 GMT (envelope-from tinderbox@freebsd.org) Date: Sun, 5 Sep 2010 09:06:35 GMT Message-Id: <201009050906.o8596Znf032071@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [head tinderbox] failure on mips/mips X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2010 09:06:36 -0000 TB --- 2010-09-05 08:27:57 - tinderbox 2.6 running on freebsd-current.sentex.ca TB --- 2010-09-05 08:27:57 - starting HEAD tinderbox run for mips/mips TB --- 2010-09-05 08:27:57 - cleaning the object tree TB --- 2010-09-05 08:28:07 - cvsupping the source tree TB --- 2010-09-05 08:28:07 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/HEAD/mips/mips/supfile TB --- 2010-09-05 09:06:35 - WARNING: /usr/bin/csup returned exit code 1 TB --- 2010-09-05 09:06:35 - ERROR: unable to cvsup the source tree TB --- 2010-09-05 09:06:35 - 0.38 user 4.78 system 2317.50 real http://tinderbox.freebsd.org/tinderbox-head-HEAD-mips-mips.full From owner-freebsd-mips@FreeBSD.ORG Sun Sep 5 10:56:15 2010 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBD441065672; Sun, 5 Sep 2010 10:56:15 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id 7E91C8FC19; Sun, 5 Sep 2010 10:56:15 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.3) with ESMTP id o85AuEci032515; Sun, 5 Sep 2010 06:56:14 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.3/Submit) id o85AuEAU032514; Sun, 5 Sep 2010 10:56:14 GMT (envelope-from tinderbox@freebsd.org) Date: Sun, 5 Sep 2010 10:56:14 GMT Message-Id: <201009051056.o85AuEAU032514@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [releng_8_0 tinderbox] failure on mips/mips X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2010 10:56:15 -0000 TB --- 2010-09-05 10:18:38 - tinderbox 2.6 running on freebsd-current.sentex.ca TB --- 2010-09-05 10:18:38 - starting RELENG_8_0 tinderbox run for mips/mips TB --- 2010-09-05 10:18:38 - cleaning the object tree TB --- 2010-09-05 10:18:44 - cvsupping the source tree TB --- 2010-09-05 10:18:44 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/RELENG_8_0/mips/mips/supfile TB --- 2010-09-05 10:56:14 - WARNING: /usr/bin/csup returned exit code 1 TB --- 2010-09-05 10:56:14 - ERROR: unable to cvsup the source tree TB --- 2010-09-05 10:56:14 - 0.34 user 4.54 system 2255.98 real http://tinderbox.freebsd.org/tinderbox-releng_8-RELENG_8_0-mips-mips.full From owner-freebsd-mips@FreeBSD.ORG Sun Sep 5 12:11:51 2010 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E0FE1065693; Sun, 5 Sep 2010 12:11:51 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id E553E8FC13; Sun, 5 Sep 2010 12:11:50 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.3) with ESMTP id o85CBoan032811; Sun, 5 Sep 2010 08:11:50 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.3/Submit) id o85CBofc032810; Sun, 5 Sep 2010 12:11:50 GMT (envelope-from tinderbox@freebsd.org) Date: Sun, 5 Sep 2010 12:11:50 GMT Message-Id: <201009051211.o85CBofc032810@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [releng_8_1 tinderbox] failure on mips/mips X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2010 12:11:51 -0000 TB --- 2010-09-05 11:34:05 - tinderbox 2.6 running on freebsd-current.sentex.ca TB --- 2010-09-05 11:34:05 - starting RELENG_8_1 tinderbox run for mips/mips TB --- 2010-09-05 11:34:05 - cleaning the object tree TB --- 2010-09-05 11:34:13 - cvsupping the source tree TB --- 2010-09-05 11:34:13 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/RELENG_8_1/mips/mips/supfile TB --- 2010-09-05 12:11:50 - WARNING: /usr/bin/csup returned exit code 1 TB --- 2010-09-05 12:11:50 - ERROR: unable to cvsup the source tree TB --- 2010-09-05 12:11:50 - 0.41 user 5.88 system 2264.37 real http://tinderbox.freebsd.org/tinderbox-releng_8-RELENG_8_1-mips-mips.full From owner-freebsd-mips@FreeBSD.ORG Sun Sep 5 14:57:11 2010 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB01E10656C7; Sun, 5 Sep 2010 14:57:11 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id 67A7E8FC0A; Sun, 5 Sep 2010 14:57:11 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.3) with ESMTP id o85EvARe028185; Sun, 5 Sep 2010 10:57:10 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.3/Submit) id o85EvAq9028184; Sun, 5 Sep 2010 14:57:10 GMT (envelope-from tinderbox@freebsd.org) Date: Sun, 5 Sep 2010 14:57:10 GMT Message-Id: <201009051457.o85EvAq9028184@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [releng_8 tinderbox] failure on mips/mips X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2010 14:57:11 -0000 TB --- 2010-09-05 14:14:24 - tinderbox 2.6 running on freebsd-current.sentex.ca TB --- 2010-09-05 14:14:24 - starting RELENG_8 tinderbox run for mips/mips TB --- 2010-09-05 14:14:24 - cleaning the object tree TB --- 2010-09-05 14:14:24 - cvsupping the source tree TB --- 2010-09-05 14:14:24 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/RELENG_8/mips/mips/supfile TB --- 2010-09-05 14:57:10 - WARNING: /usr/bin/csup returned exit code 1 TB --- 2010-09-05 14:57:10 - ERROR: unable to cvsup the source tree TB --- 2010-09-05 14:57:10 - 0.04 user 0.00 system 2566.10 real http://tinderbox.freebsd.org/tinderbox-releng_8-RELENG_8-mips-mips.full From owner-freebsd-mips@FreeBSD.ORG Mon Sep 6 07:34:20 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E06810656CA; Mon, 6 Sep 2010 07:34:20 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id C535D8FC17; Mon, 6 Sep 2010 07:34:19 +0000 (UTC) Received: by wyb33 with SMTP id 33so5081414wyb.13 for ; Mon, 06 Sep 2010 00:34:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=tqf3msNEBXKb37xP5q3BcXkzFeveNTP43D6i3g3WByk=; b=stKfn6lG/V162f1OrkRlAFR26oPO3bqFwEr4+QU7jCnT8paTrv+4Jo2cSmadEAAW1F 3OEm0UALUZwmp/fe41m7cNWDjWG9eHtFtYMrg0t2eeWorp0HgiA9Il9nD9wfVFxS1kYI pK1GD+szJgfQS4wdiac9RqSpg7F4jT2fBmUis= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=EC3jtq4/f2VYaNAhFTCDaTj+nQmz79r3FpyhvnawzLOIZtJSMaypBc+IVAvfHV0rPB C5QocPaXYovjwAcR+LfoU2enoKHAec/OSUWr8rDXj5FeXHfL1APLETmiP6wbRePr/bGD oG542lmIu3CJKv0fAzepesPG0d5gs+O6niT9k= MIME-Version: 1.0 Received: by 10.216.17.135 with SMTP id j7mr3427568wej.97.1283758458590; Mon, 06 Sep 2010 00:34:18 -0700 (PDT) Received: by 10.216.171.12 with HTTP; Mon, 6 Sep 2010 00:34:18 -0700 (PDT) In-Reply-To: References: Date: Mon, 6 Sep 2010 13:04:18 +0530 Message-ID: From: "Jayachandran C." To: freebsd-mips@freebsd.org Content-Type: multipart/mixed; boundary=0016e64c25c6e6d5b2048f924ed0 Cc: gonzo@freebsd.org Subject: Re: busdma_machdep.c with more than 512M memory X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2010 07:34:20 -0000 --0016e64c25c6e6d5b2048f924ed0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Sep 1, 2010 at 12:37 PM, Jayachandran C. wrote: > I was looking at a few crashes I see with PCI drivers, and I think it > is caused by an issue in busdma_machdep.c where physical address is > directly converted using MIPS_PHYS_TO_KSEG1. I have not looked at it > in detail, but it looks obviously wrong. > > Any suggestions on how to fix thiis is welcome, it probably needs an > uncached TLB entry. On 64bit we could use XKPHYS uncached. > > > --- > =A0632 =A0 =A0 =A0 =A0 if (newmap->flags & DMAMAP_UNCACHEABLE) { > =A0633 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *tmpaddr =3D (void *)*vaddr; > =A0634 > =A0635 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (tmpaddr) { > =A0636 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 tmpaddr =3D (void > *)MIPS_PHYS_TO_KSEG1(vtophys(tmpaddr)); > =A0637 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 newmap->origbuffer= =3D *vaddr; > =A0638 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 newmap->allocbuffe= r =3D tmpaddr; > =A0639 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mips_dcache_wbinv_= range((vm_offset_t)*vaddr, > =A0640 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dmat->maxs= ize); > =A0641 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 *vaddr =3D tmpaddr= ; > =A0642 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > --- > 1361 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 bpage->busaddr =3D pmap_kextract(bpa= ge->vaddr); > 1362 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 bpage->vaddr_nocache =3D > 1363 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (vm_offset_t)MIPS_PHYS_TO_KS= EG1(bpage->busaddr); > 1364 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mtx_lock(&bounce_lock); Based on Juli's suggestion, I have a patch (attached) to switch the calls to pmap_mapdev/pmap_unmapdev. Seems to work for me now, please review. Thanks, JC. --0016e64c25c6e6d5b2048f924ed0 Content-Type: text/x-patch; charset=US-ASCII; name="busdma.patch" Content-Disposition: attachment; filename="busdma.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gdr0mhbi0 SW5kZXg6IHN5cy9taXBzL21pcHMvYnVzZG1hX21hY2hkZXAuYwo9PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBzeXMv bWlwcy9taXBzL2J1c2RtYV9tYWNoZGVwLmMJKHJldmlzaW9uIDIxMTk4NCkKKysrIHN5cy9taXBz L21pcHMvYnVzZG1hX21hY2hkZXAuYwkod29ya2luZyBjb3B5KQpAQCAtNjIwLDYgKzYyMCw3IEBA CiAgICAgICAgICAgICAgICAgICAgIDB1bCwgZG1hdC0+bG93YWRkciwgZG1hdC0+YWxpZ25tZW50 PyBkbWF0LT5hbGlnbm1lbnQgOiAxdWwsCiAgICAgICAgICAgICAgICAgICAgIGRtYXQtPmJvdW5k YXJ5KTsKICAgICAgICAgfQorCiAgICAgICAgIGlmICgqdmFkZHIgPT0gTlVMTCkgewogCQlpZiAo bmV3bWFwICE9IE5VTEwpIHsKIAkJCV9idXNkbWFfZnJlZV9kbWFtYXAobmV3bWFwKTsKQEAgLTYz Myw3ICs2MzQsOCBAQAogCQl2b2lkICp0bXBhZGRyID0gKHZvaWQgKikqdmFkZHI7CiAKIAkJaWYg KHRtcGFkZHIpIHsKLQkJCXRtcGFkZHIgPSAodm9pZCAqKU1JUFNfUEhZU19UT19LU0VHMSh2dG9w aHlzKHRtcGFkZHIpKTsKKwkJCXByaW50ZigidW5jYWNoZSBtYXBwaW5nICVwICVseFxuIiwgdG1w YWRkciwgKHVfbG9uZyl2dG9waHlzKHRtcGFkZHIpKTsKKwkJCXRtcGFkZHIgPSAodm9pZCAqKXBt YXBfbWFwZGV2KHZ0b3BoeXModG1wYWRkciksIGRtYXQtPm1heHNpemUpOwogCQkJbmV3bWFwLT5v cmlnYnVmZmVyID0gKnZhZGRyOwogCQkJbmV3bWFwLT5hbGxvY2J1ZmZlciA9IHRtcGFkZHI7CiAJ CQltaXBzX2RjYWNoZV93Ymludl9yYW5nZSgodm1fb2Zmc2V0X3QpKnZhZGRyLApAQCAtNjYwLDYg KzY2Miw5IEBACiAJCXZhZGRyID0gbWFwLT5vcmlnYnVmZmVyOwogCX0KIAorCWlmIChtYXAtPmZs YWdzICYgRE1BTUFQX1VOQ0FDSEVBQkxFKSAKKwkJcG1hcF91bm1hcGRldigodm1fb2Zmc2V0X3Qp bWFwLT5hbGxvY2J1ZmZlciwgZG1hdC0+bWF4c2l6ZSk7CisKICAgICAgICAgaWYgKG1hcC0+Zmxh Z3MgJiBETUFNQVBfTUFMTE9DVVNFRCkKIAkJZnJlZSh2YWRkciwgTV9ERVZCVUYpOwogICAgICAg ICBlbHNlCkBAIC0xMzU5LDggKzEzNjQsOSBAQAogCQkJYnJlYWs7CiAJCX0KIAkJYnBhZ2UtPmJ1 c2FkZHIgPSBwbWFwX2tleHRyYWN0KGJwYWdlLT52YWRkcik7Ci0JCWJwYWdlLT52YWRkcl9ub2Nh Y2hlID0gCi0JCSAgICAodm1fb2Zmc2V0X3QpTUlQU19QSFlTX1RPX0tTRUcxKGJwYWdlLT5idXNh ZGRyKTsKKwkJYnBhZ2UtPnZhZGRyX25vY2FjaGUgPSAodm1fb2Zmc2V0X3QpcG1hcF9tYXBkZXYo YnBhZ2UtPmJ1c2FkZHIsIFBBR0VfU0laRSk7CisJCXByaW50ZigiYm91bmNlIG1hcHBpbmcgJXAg JXBcbiIsICh2b2lkICopYnBhZ2UtPmJ1c2FkZHIsCisJCSAgICAodm9pZCAqKWJwYWdlLT52YWRk cl9ub2NhY2hlKTsKIAkJbXR4X2xvY2soJmJvdW5jZV9sb2NrKTsKIAkJU1RBSUxRX0lOU0VSVF9U QUlMKCZiei0+Ym91bmNlX3BhZ2VfbGlzdCwgYnBhZ2UsIGxpbmtzKTsKIAkJdG90YWxfYnBhZ2Vz Kys7Cg== --0016e64c25c6e6d5b2048f924ed0-- From owner-freebsd-mips@FreeBSD.ORG Mon Sep 6 07:38:17 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AB1D10656B4; Mon, 6 Sep 2010 07:38:17 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 602168FC08; Mon, 6 Sep 2010 07:38:16 +0000 (UTC) Received: by wwb18 with SMTP id 18so2526662wwb.31 for ; Mon, 06 Sep 2010 00:38:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=tBGb2uNPZkJmoXBZcERkBYOuwQ4PMyvP3aP4voHH8Sc=; b=jokWzLmW3qr85rqzc7vAjMQIzF2wuumt2dhiSD6ZVW931cIe2emBgNYKu4DGDMJYai hiJLeHajW0tvKW3aOzYTY46RhUyqK9fC8IwvN6o/RMniJBZapoNzB3bC0IOnYDBjXH7E kySvz17wwFJvyFKB5sbuExchjR3rhVJwWSZ+Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=XgAg6rdvIBZuRYh5g0yJCLVidq6HtnLGrzGjchk5Q01CT/mRpbYZKkCvyswTJXr3ES MaX8Mfd3GCU28K28+QHZwpBXvYijPtHQCruwpUysqVzhdIW5cuDT5MKCUMh4cuwZlKMx Hayb/fPeRx4HdzSF5PhXq1bULkNAihqyIUkNU= MIME-Version: 1.0 Received: by 10.216.17.207 with SMTP id j57mr1140562wej.68.1283758695465; Mon, 06 Sep 2010 00:38:15 -0700 (PDT) Received: by 10.216.171.12 with HTTP; Mon, 6 Sep 2010 00:38:15 -0700 (PDT) In-Reply-To: References: Date: Mon, 6 Sep 2010 13:08:15 +0530 Message-ID: From: "Jayachandran C." To: freebsd-mips@freebsd.org Content-Type: multipart/mixed; boundary=0016364d26cb054440048f925db7 Cc: gonzo@freebsd.org Subject: Re: busdma_machdep.c with more than 512M memory X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2010 07:38:17 -0000 --0016364d26cb054440048f925db7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mon, Sep 6, 2010 at 1:04 PM, Jayachandran C. wrote: > On Wed, Sep 1, 2010 at 12:37 PM, Jayachandran C. > wrote: >> I was looking at a few crashes I see with PCI drivers, and I think it >> is caused by an issue in busdma_machdep.c where physical address is >> directly converted using MIPS_PHYS_TO_KSEG1. I have not looked at it >> in detail, but it looks obviously wrong. >> >> Any suggestions on how to fix thiis is welcome, it probably needs an >> uncached TLB entry. On 64bit we could use XKPHYS uncached. >> >> >> --- >> =A0632 =A0 =A0 =A0 =A0 if (newmap->flags & DMAMAP_UNCACHEABLE) { >> =A0633 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *tmpaddr =3D (void *)*vaddr; >> =A0634 >> =A0635 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (tmpaddr) { >> =A0636 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 tmpaddr =3D (void >> *)MIPS_PHYS_TO_KSEG1(vtophys(tmpaddr)); >> =A0637 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 newmap->origbuffe= r =3D *vaddr; >> =A0638 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 newmap->allocbuff= er =3D tmpaddr; >> =A0639 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mips_dcache_wbinv= _range((vm_offset_t)*vaddr, >> =A0640 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dmat->max= size); >> =A0641 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 *vaddr =3D tmpadd= r; >> =A0642 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } >> --- >> 1361 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 bpage->busaddr =3D pmap_kextract(bp= age->vaddr); >> 1362 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 bpage->vaddr_nocache =3D >> 1363 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (vm_offset_t)MIPS_PHYS_TO_K= SEG1(bpage->busaddr); >> 1364 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mtx_lock(&bounce_lock); > > Based on Juli's suggestion, I have a patch (attached) to switch the > calls to pmap_mapdev/pmap_unmapdev. > > Seems to work for me now, please review. That was an older version of the patch, here is the correct version. Thanks, JC. --0016364d26cb054440048f925db7 Content-Type: text/x-patch; charset=US-ASCII; name="mips-busdma.patch" Content-Disposition: attachment; filename="mips-busdma.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gdr0q3bx1 SW5kZXg6IHN5cy9taXBzL21pcHMvYnVzZG1hX21hY2hkZXAuYwo9PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBzeXMv bWlwcy9taXBzL2J1c2RtYV9tYWNoZGVwLmMJKHJldmlzaW9uIDIxMjI0NykKKysrIHN5cy9taXBz L21pcHMvYnVzZG1hX21hY2hkZXAuYwkod29ya2luZyBjb3B5KQpAQCAtNDI1LDcgKzQyNSw2IEBA CiAjZW5kaWYKIAogCWlmIChkbWF0ICE9IE5VTEwpIHsKLQkJCiAgICAgICAgICAgICAgICAgaWYg KGRtYXQtPm1hcF9jb3VudCAhPSAwKQogICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChF QlVTWSk7CiAJCQpAQCAtNjAyLDIwICs2MDEsNiBAQAogICAgICAgICAgICAgICAgICAqICAgICBh bmQgaGFuZGxlcyBtdWx0aS1zZWcgYWxsb2NhdGlvbnMuICBOb2JvZHkgaXMgZG9pbmcKICAgICAg ICAgICAgICAgICAgKiAgICAgbXVsdGktc2VnIGFsbG9jYXRpb25zIHlldCB0aG91Z2guCiAgICAg ICAgICAgICAgICAgICovCi0JICAgICAgICAgdm1fcGFkZHJfdCBtYXhwaHlzOwotCSAgICAgICAg IGlmKCh1aW50MzJfdClkbWF0LT5sb3dhZGRyID49IE1JUFNfS1NFRzBfTEFSR0VTVF9QSFlTKSB7 Ci0JCSAgIC8qIE5vdGUgaW4gdGhlIGVsc2UgY2FzZSBJIGp1c3QgcHV0IGluIHdoYXQgd2FzIGFs cmVhZHkKLQkJICAgICogYmVpbmcgcGFzc2VkIGluIGRtYXQtPmxvd2FkZHIuIEkgYW0gbm90IHN1 cmUKLQkJICAgICogaG93IHRoaXMgd291bGQgaGF2ZSB3b3JrZWQuIFNpbmNlIGxvd2FkZHIgaXMg aW4gdGhlCi0JCSAgICAqIG1heCBhZGRyZXNzIHBvc3Rpb24uIEkgd291bGQgaGF2ZSB0aG91Z2h0 IHRoYXQgdGhlCi0JCSAgICAqIGNhbGxlciB3b3VsZCBoYXZlIHdhbnRlZCBkbWF0LT5oaWdoYWRk ci4gVGhhdCBpcwotCQkgICAgKiBwcmVzdW1pbmcgdGhleSBhcmUgYXNraW5nIGZvciBwaHlzaWNh bCBhZGRyZXNzZXMKLQkJICAgICogd2hpY2ggaXMgd2hhdCBjb250aWdtYWxsb2MgdGFrZXMuIC0g UlJTCi0JCSAgICAqLwotCQkgICBtYXhwaHlzID0gTUlQU19LU0VHMF9MQVJHRVNUX1BIWVMgLSAx OwotCQkgfSBlbHNlIHsKLQkJICAgbWF4cGh5cyA9IGRtYXQtPmxvd2FkZHI7Ci0JCSB9CiAgICAg ICAgICAgICAgICAgKnZhZGRyID0gY29udGlnbWFsbG9jKGRtYXQtPm1heHNpemUsIE1fREVWQlVG LCBtZmxhZ3MsCiAgICAgICAgICAgICAgICAgICAgIDB1bCwgZG1hdC0+bG93YWRkciwgZG1hdC0+ YWxpZ25tZW50PyBkbWF0LT5hbGlnbm1lbnQgOiAxdWwsCiAgICAgICAgICAgICAgICAgICAgIGRt YXQtPmJvdW5kYXJ5KTsKQEAgLTYzMyw3ICs2MTgsOCBAQAogCQl2b2lkICp0bXBhZGRyID0gKHZv aWQgKikqdmFkZHI7CiAKIAkJaWYgKHRtcGFkZHIpIHsKLQkJCXRtcGFkZHIgPSAodm9pZCAqKU1J UFNfUEhZU19UT19LU0VHMSh2dG9waHlzKHRtcGFkZHIpKTsKKwkJCXRtcGFkZHIgPSAodm9pZCAq KXBtYXBfbWFwZGV2KHZ0b3BoeXModG1wYWRkciksCisJCQkgICAgZG1hdC0+bWF4c2l6ZSk7CiAJ CQluZXdtYXAtPm9yaWdidWZmZXIgPSAqdmFkZHI7CiAJCQluZXdtYXAtPmFsbG9jYnVmZmVyID0g dG1wYWRkcjsKIAkJCW1pcHNfZGNhY2hlX3diaW52X3JhbmdlKCh2bV9vZmZzZXRfdCkqdmFkZHIs CkBAIC02NjAsNiArNjQ2LDggQEAKIAkJdmFkZHIgPSBtYXAtPm9yaWdidWZmZXI7CiAJfQogCisJ aWYgKG1hcC0+ZmxhZ3MgJiBETUFNQVBfVU5DQUNIRUFCTEUpCisJCXBtYXBfdW5tYXBkZXYoKHZt X29mZnNldF90KW1hcC0+YWxsb2NidWZmZXIsIGRtYXQtPm1heHNpemUpOwogICAgICAgICBpZiAo bWFwLT5mbGFncyAmIERNQU1BUF9NQUxMT0NVU0VEKQogCQlmcmVlKHZhZGRyLCBNX0RFVkJVRik7 CiAgICAgICAgIGVsc2UKQEAgLTEzNjAsNyArMTM0OCw3IEBACiAJCX0KIAkJYnBhZ2UtPmJ1c2Fk ZHIgPSBwbWFwX2tleHRyYWN0KGJwYWdlLT52YWRkcik7CiAJCWJwYWdlLT52YWRkcl9ub2NhY2hl ID0gCi0JCSAgICAodm1fb2Zmc2V0X3QpTUlQU19QSFlTX1RPX0tTRUcxKGJwYWdlLT5idXNhZGRy KTsKKwkJICAgICh2bV9vZmZzZXRfdClwbWFwX21hcGRldihicGFnZS0+YnVzYWRkciwgUEFHRV9T SVpFKTsKIAkJbXR4X2xvY2soJmJvdW5jZV9sb2NrKTsKIAkJU1RBSUxRX0lOU0VSVF9UQUlMKCZi ei0+Ym91bmNlX3BhZ2VfbGlzdCwgYnBhZ2UsIGxpbmtzKTsKIAkJdG90YWxfYnBhZ2VzKys7Cg== --0016364d26cb054440048f925db7-- From owner-freebsd-mips@FreeBSD.ORG Mon Sep 6 10:46:18 2010 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28D2210656D1; Mon, 6 Sep 2010 10:46:18 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id DA4798FC0A; Mon, 6 Sep 2010 10:46:17 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.3) with ESMTP id o86AkG05066263; Mon, 6 Sep 2010 06:46:16 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.3/Submit) id o86AkGBP066252; Mon, 6 Sep 2010 10:46:16 GMT (envelope-from tinderbox@freebsd.org) Date: Mon, 6 Sep 2010 10:46:16 GMT Message-Id: <201009061046.o86AkGBP066252@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [head tinderbox] failure on mips/mips X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2010 10:46:18 -0000 TB --- 2010-09-06 10:40:14 - tinderbox 2.6 running on freebsd-current.sentex.ca TB --- 2010-09-06 10:40:14 - starting HEAD tinderbox run for mips/mips TB --- 2010-09-06 10:40:14 - cleaning the object tree TB --- 2010-09-06 10:40:41 - cvsupping the source tree TB --- 2010-09-06 10:40:41 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup18.freebsd.org /tinderbox/HEAD/mips/mips/supfile TB --- 2010-09-06 10:46:16 - WARNING: /usr/bin/csup returned exit code 1 TB --- 2010-09-06 10:46:16 - ERROR: unable to cvsup the source tree TB --- 2010-09-06 10:46:16 - 1.57 user 24.16 system 362.63 real http://tinderbox.freebsd.org/tinderbox-head-HEAD-mips-mips.full From owner-freebsd-mips@FreeBSD.ORG Mon Sep 6 13:27:01 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E897A10656BB for ; Mon, 6 Sep 2010 13:27:01 +0000 (UTC) (envelope-from products@dabber-player.com) Received: from smtprelay-h32.telenor.se (smtprelay-h32.telenor.se [213.150.131.5]) by mx1.freebsd.org (Postfix) with ESMTP id 77A208FC21 for ; Mon, 6 Sep 2010 13:27:01 +0000 (UTC) Received: from ipb1.telenor.se (ipb1.telenor.se [195.54.127.164]) by smtprelay-h32.telenor.se (Postfix) with ESMTP id 6702DC042 for ; Mon, 6 Sep 2010 15:05:40 +0200 (CEST) X-SENDER-IP: [85.229.123.188] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqtUAJ6DhExV5Xu8Omdsb2JhbACEFI9SAQGNKQwBAQEBIRS7Y4U9BIVlg3A X-IronPort-AV: E=Sophos;i="4.56,325,1280700000"; d="scan'208";a="127318833" Received: from c-bc7be555.016-94-73746f11.cust.bredbandsbolaget.se (HELO [10.0.1.5]) ([85.229.123.188]) by ipb1.telenor.se with SMTP; 06 Sep 2010 15:05:40 +0200 Message-Id: <6goPlaEHcPwJILvYyjXwX4cUC51SatLo1K35WV2ekPrG@dabber-player.com> Mime-Version: 1.0 From: "Daniel Dabber" To: "" Date: Mon, 6 Sep 2010 15:05:42 +0200 X-Bounce-Tracking-Info: Content-type: text/plain; charset=iso-8859-1; format=flowed Content-transfer-encoding: quoted-printable Subject: Today we launch The Dabber video player for free X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2010 13:27:02 -0000 Ladies and gentlemen, mina damer och herrar=2E Today we launch a free version of our popular Dabber player at http://www=2Edabber-player=2Ecom The Dabber player is one of the most beautiful 3D-interface videoplayers for embedding on any webpage=2E Now you can host your own online tv-channel, display your best content and best of all you can change= the look and feel and adapt the player to your webpage=2E No more black, boring= , standard embedded and sad videoplayers=2E Let=B4s make Internet more beautiful! You can use our entire range of improved, evolved and very beautiful Dabber= video players for only $75 and Free for non commercial use=2E And for only $95 per month you can have storage, trafik, contentmanagement = and all players! Order yours today and use them, love them, and improve all websites out there=2E You can find them at http://www=2Edabber-player=2Ecom A huge thanks goes to all you brave ones who have ordered and implemented our early Dabber players so far=2E Your orders, thoughts, feedb= ack and love have taken us to this day=2E You know who you are! New players and plugins are in the pipeline, both for YouTube, Vimeo, JW, Flow, Html5 and other=2E We can already provide a CMS as a Wordpress pl= ugin We look forward to your order and feedback! For future newsletters and info please subscribe at http://www=2Edabber= =2Etv/#news Daniel Daboczy CEO & co-founder DABBER website: http://www=2Edabber-player=2Ecom mobile: +46 (0)736 26 99 85 e-mail: daniel@dabber=2Etv SKYPE: mrdaboczy adress: Frejgatan 8, SE-114 20 Stockholm, Sweden Nominated for "Best Streaming Innovation of 2009" at the prestigious Streaming Media awards in London=2E This message was sent to freebsd-mips@freebsd=2Eorg from Dabber Stockholm= =2E To stop receiveing info or newsletters from us please reply with the word u= nsub=2E From owner-freebsd-mips@FreeBSD.ORG Thu Sep 9 04:51:15 2010 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEBB8106564A; Thu, 9 Sep 2010 04:51:15 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id 80B288FC1E; Thu, 9 Sep 2010 04:51:15 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.3) with ESMTP id o894pEZg045855; Thu, 9 Sep 2010 00:51:14 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.3/Submit) id o894pE1u045854; Thu, 9 Sep 2010 04:51:14 GMT (envelope-from tinderbox@freebsd.org) Date: Thu, 9 Sep 2010 04:51:14 GMT Message-Id: <201009090451.o894pE1u045854@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [head tinderbox] failure on mips/mips X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2010 04:51:16 -0000 TB --- 2010-09-09 03:49:52 - tinderbox 2.6 running on freebsd-current.sentex.ca TB --- 2010-09-09 03:49:52 - starting HEAD tinderbox run for mips/mips TB --- 2010-09-09 03:49:52 - cleaning the object tree TB --- 2010-09-09 03:50:17 - cvsupping the source tree TB --- 2010-09-09 03:50:17 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/HEAD/mips/mips/supfile TB --- 2010-09-09 03:51:15 - building world TB --- 2010-09-09 03:51:15 - MAKEOBJDIRPREFIX=/obj TB --- 2010-09-09 03:51:15 - PATH=/usr/bin:/usr/sbin:/bin:/sbin TB --- 2010-09-09 03:51:15 - TARGET=mips TB --- 2010-09-09 03:51:15 - TARGET_ARCH=mips TB --- 2010-09-09 03:51:15 - TZ=UTC TB --- 2010-09-09 03:51:15 - __MAKE_CONF=/dev/null TB --- 2010-09-09 03:51:15 - cd /src TB --- 2010-09-09 03:51:15 - /usr/bin/make -B buildworld >>> World build started on Thu Sep 9 03:51:15 UTC 2010 >>> Rebuilding the temporary build tree >>> stage 1.1: legacy release compatibility shims >>> stage 1.2: bootstrap tools >>> stage 2.1: cleaning up the object tree >>> stage 2.2: rebuilding the object tree >>> stage 2.3: build tools >>> stage 3: cross tools >>> stage 4.1: building includes >>> stage 4.2: building libraries >>> stage 4.3: make dependencies >>> stage 4.4: building everything [...] gzip -cn /src/usr.sbin/ntp/doc/ntpd.8 > ntpd.8.gz gzip -cn /src/usr.sbin/ntp/doc/ntpdate.8 > ntpdate.8.gz gzip -cn /src/usr.sbin/ntp/doc/ntpdc.8 > ntpdc.8.gz gzip -cn /src/usr.sbin/ntp/doc/ntpq.8 > ntpq.8.gz gzip -cn /src/usr.sbin/ntp/doc/ntptime.8 > ntptime.8.gz ===> usr.sbin/pc-sysinstall (all) ===> usr.sbin/pc-sysinstall/backend (all) make: don't know how to make installimage.sh. Stop *** Error code 2 Stop in /src/usr.sbin/pc-sysinstall. *** Error code 1 Stop in /src/usr.sbin. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2010-09-09 04:51:14 - WARNING: /usr/bin/make returned exit code 1 TB --- 2010-09-09 04:51:14 - ERROR: failed to build world TB --- 2010-09-09 04:51:14 - 2327.07 user 829.72 system 3682.04 real http://tinderbox.freebsd.org/tinderbox-head-HEAD-mips-mips.full From owner-freebsd-mips@FreeBSD.ORG Fri Sep 10 05:52:41 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9228A1065693; Fri, 10 Sep 2010 05:52:41 +0000 (UTC) (envelope-from neelnatu@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id CC6838FC17; Fri, 10 Sep 2010 05:52:40 +0000 (UTC) Received: by wyb33 with SMTP id 33so2784061wyb.13 for ; Thu, 09 Sep 2010 22:52:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=XE59MWWhhdIonSHNrckFjdFQyFThAitHbkHIPE+IfhE=; b=CJrllB6ugx+C/YWwd+8eYPFfxgeIdtdVwHyAV/SZ5LgPJZf8rckOpM7l7sJaK8gtNi aqNfBzdndTnjUqd99uv+vlVJxpyF4IcIff6ra3Ovk0Rfy3QmJQcHeOy08zDbRxk2jz4i 6csX0iW8X5riYuFLvSy+4be8TDCk9qKWdPJxk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=xe6iNAYPyEKIgMBSHTjeE/7hQSrdYWvxlebBfOeXjR0Y5NENbA+O8fNUZN9gEjtEg7 ve4TnDpRrC14rcSeqmOUTwx7OX9g8rLsyG2dOQt+SjIPNq2RQA2A4wL9NKEm9X1QZO4d O3Jq+NHh1eJbL4s4fcnDd2SwPmeyhdJj4ThZo= MIME-Version: 1.0 Received: by 10.216.155.199 with SMTP id j49mr320999wek.48.1284097959608; Thu, 09 Sep 2010 22:52:39 -0700 (PDT) Received: by 10.216.54.77 with HTTP; Thu, 9 Sep 2010 22:52:39 -0700 (PDT) In-Reply-To: References: Date: Thu, 9 Sep 2010 22:52:39 -0700 Message-ID: From: Neel Natu To: "Jayachandran C." Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: gonzo@freebsd.org, freebsd-mips@freebsd.org Subject: Re: busdma_machdep.c with more than 512M memory X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2010 05:52:41 -0000 Hi JC, On Mon, Sep 6, 2010 at 12:38 AM, Jayachandran C. wrote: > On Mon, Sep 6, 2010 at 1:04 PM, Jayachandran C. > wrote: >> On Wed, Sep 1, 2010 at 12:37 PM, Jayachandran C. >> wrote: >>> I was looking at a few crashes I see with PCI drivers, and I think it >>> is caused by an issue in busdma_machdep.c where physical address is >>> directly converted using MIPS_PHYS_TO_KSEG1. I have not looked at it >>> in detail, but it looks obviously wrong. >>> >>> Any suggestions on how to fix thiis is welcome, it probably needs an >>> uncached TLB entry. On 64bit we could use XKPHYS uncached. >>> >>> >>> --- >>> =A0632 =A0 =A0 =A0 =A0 if (newmap->flags & DMAMAP_UNCACHEABLE) { >>> =A0633 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *tmpaddr =3D (void *)*vaddr= ; >>> =A0634 >>> =A0635 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (tmpaddr) { >>> =A0636 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 tmpaddr =3D (voi= d >>> *)MIPS_PHYS_TO_KSEG1(vtophys(tmpaddr)); >>> =A0637 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 newmap->origbuff= er =3D *vaddr; >>> =A0638 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 newmap->allocbuf= fer =3D tmpaddr; >>> =A0639 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mips_dcache_wbin= v_range((vm_offset_t)*vaddr, >>> =A0640 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dmat->ma= xsize); >>> =A0641 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 *vaddr =3D tmpad= dr; >>> =A0642 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } >>> --- >>> 1361 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 bpage->busaddr =3D pmap_kextract(b= page->vaddr); >>> 1362 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 bpage->vaddr_nocache =3D >>> 1363 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (vm_offset_t)MIPS_PHYS_TO_= KSEG1(bpage->busaddr); >>> 1364 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mtx_lock(&bounce_lock); >> >> Based on Juli's suggestion, I have a patch (attached) to switch the >> calls to pmap_mapdev/pmap_unmapdev. >> >> Seems to work for me now, please review. > > That was an older version of the patch, here is the correct version. > This assumes that pmap_mapdev() always returns an uncached mapping which is true for n64 kernels but not for o32 kernels with memory beyond 512MB. Any objections if I commit the following patch that makes pmap_mapdev() always return an uncached mapping. Index: sys/mips/mips/pmap.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/mips/mips/pmap.c (revision 212404) +++ sys/mips/mips/pmap.c (working copy) @@ -828,8 +828,8 @@ /* * add a wired page to the kva */ - /* PMAP_INLINE */ void -pmap_kenter(vm_offset_t va, vm_paddr_t pa) +static void +pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int attr) { pt_entry_t *pte; pt_entry_t opte, npte; @@ -837,13 +837,8 @@ #ifdef PMAP_DEBUG printf("pmap_kenter: va: %p -> pa: %p\n", (void *)va, (void *)pa); #endif - npte =3D TLBLO_PA_TO_PFN(pa) | PTE_D | PTE_V | PTE_G | PTE_W; + npte =3D TLBLO_PA_TO_PFN(pa) | PTE_D | PTE_V | PTE_G | PTE_W | attr; - if (is_cacheable_mem(pa)) - npte |=3D PTE_C_CACHE; - else - npte |=3D PTE_C_UNCACHED; - pte =3D pmap_pte(kernel_pmap, va); opte =3D *pte; *pte =3D npte; @@ -851,6 +846,19 @@ pmap_update_page(kernel_pmap, va, npte); } +void +pmap_kenter(vm_offset_t va, vm_paddr_t pa) +{ + int attr; + + if (is_cacheable_mem(pa)) + attr =3D PTE_C_CACHE; + else + attr =3D PTE_C_UNCACHED; + + pmap_kenter_attr(va, pa, attr); +} + /* * remove a page from the kernel pagetables */ @@ -2863,7 +2871,7 @@ panic("pmap_mapdev: Couldn't alloc kernel virtual memory"); pa =3D trunc_page(pa); for (tmpva =3D va; size > 0;) { - pmap_kenter(tmpva, pa); + pmap_kenter_attr(tmpva, pa, PTE_C_UNCACHED); size -=3D PAGE_SIZE; tmpva +=3D PAGE_SIZE; pa +=3D PAGE_SIZE; best Neel > Thanks, > JC. > From owner-freebsd-mips@FreeBSD.ORG Fri Sep 10 06:17:18 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98A551065670; Fri, 10 Sep 2010 06:17:18 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 5A98B8FC13; Fri, 10 Sep 2010 06:17:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o8A6EE9c019318; Fri, 10 Sep 2010 00:14:14 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 10 Sep 2010 00:14:30 -0600 (MDT) Message-Id: <20100910.001430.1149370768114483729.imp@bsdimp.com> To: neelnatu@gmail.com From: "M. Warner Losh" In-Reply-To: References: X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: gonzo@freebsd.org, freebsd-mips@freebsd.org Subject: Re: busdma_machdep.c with more than 512M memory X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2010 06:17:18 -0000 In message: Neel Natu writes: : This assumes that pmap_mapdev() always returns an uncached mapping : which is true for n64 kernels but not for o32 kernels with memory : beyond 512MB. : : Any objections if I commit the following patch that makes : pmap_mapdev() always return an uncached mapping. Is there ever a time on MIPS you'd want to make a device you are talking to cached? I'd say it is a vanishingly rare event, if ever. If we come up with one, we, at that time, should implement a way to do that mapping. I have no objections to this patch, but I've not gone over it with a fine tooth comb. Warner From owner-freebsd-mips@FreeBSD.ORG Fri Sep 10 07:00:36 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1AE0106564A; Fri, 10 Sep 2010 07:00:36 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 823298FC13; Fri, 10 Sep 2010 07:00:36 +0000 (UTC) Received: by ywt2 with SMTP id 2so1143257ywt.13 for ; Fri, 10 Sep 2010 00:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=haS4zf0ETKXjhgVIUHJO4kqT+bRpCrtH8jDT8kbbtfQ=; b=fbBMuXTluAEEU8wnd3aEZ70jW5+ea+w5swDAI8mSWRE80D7F3/Nd+0CZYtnPik8CVd rBisFa8QJM2W2bMJH6wS+uOBJRTfwbebJ7WtYJF6rRYe2s8EE7w1Od4gpCqNW63//c/v bKV1zZ6DouOnaFxUFXexnSPIhF2GkWsQcBFuE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=VuGqDtrztM5YiZQCtdjONb7ksZzr13ZxLhzY9qhM630gTP1y9WvnoR5nYjwIRa0Px3 sAH40y6BsmBUISQCC9YptdOr+NNaSOJMzJVcqUG194Rdlw/KWqRjy8QwZfZXNgPO2Eml FHwkbHL5afO1hHRmx5DjpF6fcYDIe3xnca+DQ= MIME-Version: 1.0 Received: by 10.150.11.21 with SMTP id 21mr400674ybk.39.1284102035429; Fri, 10 Sep 2010 00:00:35 -0700 (PDT) Received: by 10.150.136.10 with HTTP; Fri, 10 Sep 2010 00:00:35 -0700 (PDT) In-Reply-To: References: Date: Fri, 10 Sep 2010 12:30:35 +0530 Message-ID: From: "Jayachandran C." To: Neel Natu Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: gonzo@freebsd.org, freebsd-mips@freebsd.org Subject: Re: busdma_machdep.c with more than 512M memory X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2010 07:00:37 -0000 On Fri, Sep 10, 2010 at 11:22 AM, Neel Natu wrote: > Hi JC, > > On Mon, Sep 6, 2010 at 12:38 AM, Jayachandran C. > wrote: >> On Mon, Sep 6, 2010 at 1:04 PM, Jayachandran C. >> wrote: >>> On Wed, Sep 1, 2010 at 12:37 PM, Jayachandran C. >>> wrote: >>>> I was looking at a few crashes I see with PCI drivers, and I think it >>>> is caused by an issue in busdma_machdep.c where physical address is >>>> directly converted using MIPS_PHYS_TO_KSEG1. I have not looked at it >>>> in detail, but it looks obviously wrong. >>>> >>>> Any suggestions on how to fix thiis is welcome, it probably needs an >>>> uncached TLB entry. On 64bit we could use XKPHYS uncached. >>>> >>>> >>>> --- >>>> =A0632 =A0 =A0 =A0 =A0 if (newmap->flags & DMAMAP_UNCACHEABLE) { >>>> =A0633 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *tmpaddr =3D (void *)*vadd= r; >>>> =A0634 >>>> =A0635 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (tmpaddr) { >>>> =A0636 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 tmpaddr =3D (vo= id >>>> *)MIPS_PHYS_TO_KSEG1(vtophys(tmpaddr)); >>>> =A0637 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 newmap->origbuf= fer =3D *vaddr; >>>> =A0638 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 newmap->allocbu= ffer =3D tmpaddr; >>>> =A0639 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mips_dcache_wbi= nv_range((vm_offset_t)*vaddr, >>>> =A0640 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dmat->m= axsize); >>>> =A0641 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 *vaddr =3D tmpa= ddr; >>>> =A0642 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } >>>> --- >>>> 1361 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 bpage->busaddr =3D pmap_kextract(= bpage->vaddr); >>>> 1362 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 bpage->vaddr_nocache =3D >>>> 1363 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (vm_offset_t)MIPS_PHYS_TO= _KSEG1(bpage->busaddr); >>>> 1364 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mtx_lock(&bounce_lock); >>> >>> Based on Juli's suggestion, I have a patch (attached) to switch the >>> calls to pmap_mapdev/pmap_unmapdev. >>> >>> Seems to work for me now, please review. >> >> That was an older version of the patch, here is the correct version. >> > > This assumes that pmap_mapdev() always returns an uncached mapping > which is true for n64 kernels but not for o32 kernels with memory > beyond 512MB. I think my original patch was incorrect, pmap_mapdev() should not be used to map physical memory uncached. It may be just for mapping device address space uncached, and that may be why it checks if the physical address is cacheable. > Any objections if I commit the following patch that makes > pmap_mapdev() always return an uncached mapping. I think we should remove the usage of pmap_mapdev() in busdma and just use your new pmap_kenter_attr() there, which I think would make it clear. Thanks, JC. From owner-freebsd-mips@FreeBSD.ORG Fri Sep 10 07:07:08 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA5ED1065695 for ; Fri, 10 Sep 2010 07:07:08 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6BCF88FC1F for ; Fri, 10 Sep 2010 07:07:08 +0000 (UTC) Received: by iwn34 with SMTP id 34so2206658iwn.13 for ; Fri, 10 Sep 2010 00:07:07 -0700 (PDT) Received: by 10.231.15.9 with SMTP id i9mr525670iba.58.1284102427741; Fri, 10 Sep 2010 00:07:07 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.231.37.135 with HTTP; Fri, 10 Sep 2010 00:06:46 -0700 (PDT) In-Reply-To: References: From: Juli Mallett Date: Fri, 10 Sep 2010 00:06:46 -0700 X-Google-Sender-Auth: F1uDaSP17eXkQOvnHVgSqsgF2Yg Message-ID: To: "Jayachandran C." Content-Type: text/plain; charset=ISO-8859-1 Cc: gonzo@freebsd.org, freebsd-mips@freebsd.org Subject: Re: busdma_machdep.c with more than 512M memory X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2010 07:07:08 -0000 On Fri, Sep 10, 2010 at 00:00, Jayachandran C. wrote: > On Fri, Sep 10, 2010 at 11:22 AM, Neel Natu wrote: >> This assumes that pmap_mapdev() always returns an uncached mapping >> which is true for n64 kernels but not for o32 kernels with memory >> beyond 512MB. > > I think my original patch was incorrect, pmap_mapdev() should not be > used to map physical memory uncached. It may be just for mapping > device address space uncached, and that may be why it checks if the > physical address is cacheable. I think that's a wrong inference from the brokenness of pmap_mapdev because of using the general-purpose pmap_kenter. pmap_mapdev is implicitly uncacheable -- check i386 pmap for confirmation. Neel's patch is right. From owner-freebsd-mips@FreeBSD.ORG Fri Sep 10 07:42:32 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC7D2106566C; Fri, 10 Sep 2010 07:42:32 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6C9D88FC19; Fri, 10 Sep 2010 07:42:32 +0000 (UTC) Received: by gyg4 with SMTP id 4so1193443gyg.13 for ; Fri, 10 Sep 2010 00:42:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=pNUFq8CKKxz9F+dVdQJmd+1siEpZfwY1NbEjaCRFSEM=; b=pLuuCqPxA+VngHHlUde3wIaUZns2VzQ2zjw1NVwrSi+S7cGkkNPDIuo3UulsuCvTaF 9O1xdqq8BtJyjo53fYm+t1VUm3Rz4XR2CSGP9S7UIdGdIIIfi3HcZ225R60Lc0P8qHUG 8peL9TBMUTdRORAygf/NQDDUWdoUvbNIYgQzI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=r8Wi0ubjt8hBT1MgpEw4XMhlNm3VVSN+LoTD33Hhed30rP8d9Khl/9EQkhgP0K+zcw ij/XoS2yHKLqBS7IhnGoeDD3JkMAyZChk72rt2YFsjicEJI84y25USCUaz2TpA9V9mHG H1L3oYdmrowQpOpETa1Uw4x3m8ImCqI81bKeU= MIME-Version: 1.0 Received: by 10.151.138.13 with SMTP id q13mr391009ybn.189.1284104551312; Fri, 10 Sep 2010 00:42:31 -0700 (PDT) Received: by 10.150.136.10 with HTTP; Fri, 10 Sep 2010 00:42:31 -0700 (PDT) In-Reply-To: References: Date: Fri, 10 Sep 2010 13:12:31 +0530 Message-ID: From: "Jayachandran C." To: Juli Mallett Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: gonzo@freebsd.org, freebsd-mips@freebsd.org Subject: Re: busdma_machdep.c with more than 512M memory X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2010 07:42:32 -0000 On Fri, Sep 10, 2010 at 12:36 PM, Juli Mallett wrote= : > On Fri, Sep 10, 2010 at 00:00, Jayachandran C. = wrote: >> On Fri, Sep 10, 2010 at 11:22 AM, Neel Natu wrote: >>> This assumes that pmap_mapdev() always returns an uncached mapping >>> which is true for n64 kernels but not for o32 kernels with memory >>> beyond 512MB. >> >> I think my original patch was incorrect, pmap_mapdev() should not be >> used to map physical memory uncached. It may be just for mapping >> device address space uncached, and that may be why it checks if the >> physical address is cacheable. > > I think that's a wrong inference from the brokenness of pmap_mapdev > because of using the general-purpose pmap_kenter. =A0pmap_mapdev is > implicitly uncacheable -- check i386 pmap for confirmation. =A0Neel's > patch is right. Ok. My point was using pmap_mapdev() on physical memory to remap it uncached may not be its intended usage - and I did not notice this when I used it in busdma_machdep.c. But looks like it is the easiest way of doing this. My suggestion of using pmap_kenter_attr() in busdma_machdep.c would imply duplicating the whole pmap_mapdev code there, which is not good either. So as it stands, all I can say is that a comment in busdma_machdep.c on pmap_mapdev() use would be useful :) JC.