Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jul 2009 20:07:44 +0000 (UTC)
From:      Rafal Jaworowski <raj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r195256 - in head/sys/arm: at91 mv sa11x0
Message-ID:  <200907012007.n61K7ick022628@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: raj
Date: Wed Jul  1 20:07:44 2009
New Revision: 195256
URL: http://svn.freebsd.org/changeset/base/195256

Log:
  Map DPCPU pages into ARM kernel VA space.
  
  DPCPU area was not properly mapped into kernel VA space, which caused page
  fault on the first DPCPU access. This patch fixes the problem by mapping DPCPU
  area into kernel VA space.
  
  Submitted by:	Michal Hajduk, Piotr Ziecik
  Reviewed by:	cognet, stas
  Approved by:	re (kib)
  Obtained from:	Semihalf

Modified:
  head/sys/arm/at91/at91_machdep.c
  head/sys/arm/mv/mv_machdep.c
  head/sys/arm/sa11x0/assabet_machdep.c

Modified: head/sys/arm/at91/at91_machdep.c
==============================================================================
--- head/sys/arm/at91/at91_machdep.c	Wed Jul  1 19:55:11 2009	(r195255)
+++ head/sys/arm/at91/at91_machdep.c	Wed Jul  1 20:07:44 2009	(r195256)
@@ -301,6 +301,11 @@ initarm(void *arg, void *arg2)
 	/* Map the vector page. */
 	pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa,
 	    VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
+
+	/* Map the DPCPU pages */
+	pmap_map_chunk(l1pagetable, dpcpu.pv_va, dpcpu.pv_pa, DPCPU_SIZE,
+	    VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
+
 	/* Map the stack pages */
 	pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa,
 	    IRQ_STACK_SIZE * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);

Modified: head/sys/arm/mv/mv_machdep.c
==============================================================================
--- head/sys/arm/mv/mv_machdep.c	Wed Jul  1 19:55:11 2009	(r195255)
+++ head/sys/arm/mv/mv_machdep.c	Wed Jul  1 20:07:44 2009	(r195256)
@@ -528,9 +528,9 @@ initarm(void *mdp, void *unused __unused
 	    L2_TABLE_SIZE_REAL * l2size,
 	    VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE);
 
-	/* Map allocated stacks and msgbuf */
-	pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa,
-	    freemempos - irqstack.pv_va,
+	/* Map allocated DPCPU, stacks and msgbuf */
+	pmap_map_chunk(l1pagetable, dpcpu.pv_va, dpcpu.pv_pa,
+	    freemempos - dpcpu.pv_va,
 	    VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
 
 	/* Link and map the vector page */

Modified: head/sys/arm/sa11x0/assabet_machdep.c
==============================================================================
--- head/sys/arm/sa11x0/assabet_machdep.c	Wed Jul  1 19:55:11 2009	(r195255)
+++ head/sys/arm/sa11x0/assabet_machdep.c	Wed Jul  1 20:07:44 2009	(r195256)
@@ -313,6 +313,9 @@ initarm(void *arg, void *arg2)
 	pmap_map_chunk(l1pagetable, KERNBASE, KERNBASE,
 	    ((uint32_t)lastaddr - KERNBASE), VM_PROT_READ|VM_PROT_WRITE,
 	    PTE_CACHE);
+	/* Map the DPCPU pages */
+	pmap_map_chunk(l1pagetable, dpcpu.pv_va, dpcpu.pv_pa, DPCPU_SIZE,
+	    VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
 	/* Map the stack pages */
 	pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa,
 	    IRQ_STACK_SIZE * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907012007.n61K7ick022628>