NetBSD Problem Report #52010
From www@NetBSD.org Mon Feb 27 17:47:16 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id DAA947A16C
for <gnats-bugs@gnats.NetBSD.org>; Mon, 27 Feb 2017 17:47:16 +0000 (UTC)
Message-Id: <20170227174715.79A207A2A7@mollari.NetBSD.org>
Date: Mon, 27 Feb 2017 17:47:15 +0000 (UTC)
From: smesgr@gmail.com
Reply-To: smesgr@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Regression: Gumstix Verdex is hanging in enabling cache + KASSERT ram_size
X-Send-Pr-Version: www-1.0
>Number: 52010
>Category: port-evbarm
>Synopsis: Regression: Gumstix Verdex is hanging in enabling cache + KASSERT ram_size
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: skrll
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Feb 27 17:50:00 +0000 2017
>Closed-Date: Tue Mar 14 21:08:32 +0000 2017
>Last-Modified: Tue Mar 14 21:08:32 +0000 2017
>Originator: Stephan Meisinger
>Release: 7.0 and higher
>Organization:
>Environment:
>Description:
Gumstix Verdex (very likely every XSCALE Gumstix) is hanging after enabling cache code, because no cache clean address is set.
Additionally a KASSERT is triggered, which is afaik only for a __HAVE_MM_MD_DIRECT_MAPPED_PHYS setup.
Please see patch below. The regression was introduced with the switch to arm32_bootmem_init code
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/evbarm/gumstix/gumstix_machdep.c.diff?r1=1.48&r2=1.49&only_with_tag=MAIN&f=h
>How-To-Repeat:
boot GUMSTIX Verdex with NetBSD 7 or higher
>Fix:
Index: sys/arch/evbarm/gumstix/gumstix_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/gumstix/gumstix_machdep.c,v
retrieving revision 1.57
diff -u -r1.57 gumstix_machdep.c
--- sys/arch/evbarm/gumstix/gumstix_machdep.c 20 Oct 2016 09:53:08 -0000 1.57
+++ sys/arch/evbarm/gumstix/gumstix_machdep.c 27 Feb 2017 17:31:28 -0000
@@ -456,6 +456,9 @@
u_int
initarm(void *arg)
{
+#if defined(CPU_XSCALE)
+ extern vaddr_t xscale_cache_clean_addr;
+#endif
extern char KERNEL_BASE_phys[];
extern uint32_t *u_boot_args[];
extern uint32_t ram_size;
@@ -594,7 +597,11 @@
bootconfig.dram[0].address = SDRAM_START;
bootconfig.dram[0].pages = ram_size / PAGE_SIZE;
+#if defined(CPU_XSCALE)
+ xscale_cache_clean_addr = 0xff000000U;
+#else
KASSERT(ram_size <= KERNEL_VM_BASE - KERNEL_BASE);
+#endif
arm32_bootmem_init(bootconfig.dram[0].address, ram_size,
(uintptr_t) KERNEL_BASE_phys);
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: port-evbarm-maintainer->skrll
Responsible-Changed-By: skrll@NetBSD.org
Responsible-Changed-When: Mon, 27 Feb 2017 21:25:32 +0000
Responsible-Changed-Why:
Take
From: Nick Hudson <skrll@netbsd.org>
To: gnats-bugs@NetBSD.org, port-evbarm-maintainer@netbsd.org,
gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc:
Subject: Re: port-evbarm/52010: Regression: Gumstix Verdex is hanging in
enabling cache + KASSERT ram_size
Date: Tue, 28 Feb 2017 07:49:40 +0000
This is a multi-part message in MIME format.
--------------020700070203080902030601
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Does this patch work for you?
Thanks,
Nick
--------------020700070203080902030601
Content-Type: text/plain; charset=UTF-8;
name="diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="diff"
Index: sys/arch/evbarm/gumstix/gumstix_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/gumstix/gumstix_machdep.c,v
retrieving revision 1.57
diff -u -p -r1.57 gumstix_machdep.c
--- sys/arch/evbarm/gumstix/gumstix_machdep.c 20 Oct 2016 09:53:08 -0000 1.57
+++ sys/arch/evbarm/gumstix/gumstix_machdep.c 28 Feb 2017 07:48:38 -0000
@@ -206,13 +206,16 @@
#endif
/*
- * The range 0xc1000000 - 0xcfffffff is available for kernel VM space
- * Core-logic registers and I/O mappings occupy 0xfd000000 - 0xffffffff
+ * The range 0xc1000000 - 0xfd000000 is available for kernel VM space
+ * Core-logic registers and I/O mappings occupy
+ *
+ * 0xfd000000 - 0xfd800000 on gumstix
+ * 0xc0000000 - 0xc0400000 on overo, duovero and pepper
*/
#ifndef KERNEL_VM_BASE
-#define KERNEL_VM_BASE 0xc1000000
+#define KERNEL_VM_BASE 0xc8000000
#endif
-#define KERNEL_VM_SIZE 0x0f000000
+#define KERNEL_VM_SIZE 0x35000000
BootConfig bootconfig; /* Boot config storage */
static char bootargs[MAX_BOOT_STRING];
@@ -487,6 +490,9 @@ initarm(void *arg)
*/
#if defined(CPU_XSCALE)
+ extern vaddr_t xscale_cache_clean_addr;
+ xscale_cache_clean_addr = 0xff000000U;
+
cpu_reset_address = NULL;
#elif defined(OMAP2)
cpu_reset_address = omap_reset;
--------------020700070203080902030601--
From: smesgr <smesgr@gmail.com>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: port-evbarm/52010
Date: Tue, 28 Feb 2017 19:31:45 +0100
You patch also works for me, even through I can't test the other Gumstix
boards (e.g. boards with Cortex chips)
Best Regards
Stephan
From: "Nick Hudson" <skrll@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/52010 CVS commit: src/sys/arch/evbarm/gumstix
Date: Wed, 1 Mar 2017 16:44:54 +0000
Module Name: src
Committed By: skrll
Date: Wed Mar 1 16:44:54 UTC 2017
Modified Files:
src/sys/arch/evbarm/gumstix: gumstix_machdep.c
Log Message:
Set xscale_cache_clean_addr appropriately and re-arrange default KVA
layout to allow direct map for all boards.
OVERO/DUOVERO/PEPPER aren't tested.
PR/52010: Regression: Gumstix Verdex is hanging in enabling cache + KASSERT ram_size
To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->pending-pullups
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Wed, 01 Mar 2017 16:51:54 +0000
State-Changed-Why:
[pullup-7 #1366]
From: "Soren Jacobsen" <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/52010 CVS commit: [netbsd-7] src/sys/arch
Date: Sat, 11 Mar 2017 07:40:21 +0000
Module Name: src
Committed By: snj
Date: Sat Mar 11 07:40:21 UTC 2017
Modified Files:
src/sys/arch/arm/arm32 [netbsd-7]: pmap.c
src/sys/arch/arm/include/arm32 [netbsd-7]: pmap.h
src/sys/arch/evbarm/gumstix [netbsd-7]: gumstix_machdep.c
Log Message:
Pull up following revision(s) (requested by skrll in ticket #1366):
sys/arch/arm/include/arm32/pmap.h: 1.145
sys/arch/arm/arm32/pmap.c: 1.343, 1.344
sys/arch/evbarm/gumstix/gumstix_machdep.c: 1.58 via patch
Fixup the compile time decisions around PMAP_{INCLUDE,NEEDS}_PTE_SYNC and
fix the options for xscale boards which require the code in
pmap_l2ptp_ctor marked as #ifndef PMAP_INCLUDE_PTE_SYNC.
Fix the typo (pte -> opte) in this code block and consistently use opte
elsewhere.
PR/51990: Regression data_abort_handler: data_aborts fsr=0x406 far=0xbfffeff5 on copyout in init
--
fix unused.
--
Set xscale_cache_clean_addr appropriately and re-arrange default KVA
layout to allow direct map for all boards.
OVERO/DUOVERO/PEPPER aren't tested.
PR/52010: Regression: Gumstix Verdex is hanging in enabling cache + KASSERT ram_size
To generate a diff of this commit:
cvs rdiff -u -r1.295.2.8 -r1.295.2.9 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.135.2.2 -r1.135.2.3 src/sys/arch/arm/include/arm32/pmap.h
cvs rdiff -u -r1.50 -r1.50.2.1 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: pending-pullups->feedback
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Sat, 11 Mar 2017 09:29:46 +0000
State-Changed-Why:
OK to close?
From: smesgr <smesgr@gmail.com>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: port-evbarm/52010
Date: Tue, 14 Mar 2017 19:26:26 +0100
for me - yes thanks
State-Changed-From-To: feedback->closed
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Tue, 14 Mar 2017 21:08:32 +0000
State-Changed-Why:
Confirmed fixed
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.