Mark Cave-Ayland | 1 Jan 14:09 2011
Picon

Re: [PATCH 3/6] Introduce va2pa() and pa2va() functions for PPC for subsequent use by OFMEM.

On 30/12/10 23:46, Andreas Färber wrote:

> Only for sparc! For ppc I located it further below, beneath the
> (aligned) hash map iirc.

Ah okay.

> Obviously we all try to set up sane translations initially, so I was
> more worried about runtime. But on second thoughts, if someone remaps
> our malloc zone with whatever alignment then we're doomed anyway.
>
> I must admit that I still don't understand which case exactly broke the
> alignment on sparc in the first place, so I'm unable to provide
> pinpointed solutions. I'm regarding these as general functions - thus a
> va2pa() that doesn't respect the va translations is broken IMO.

The issue is that the old routines just aligned the virtual address, 
whereas the new ones also ensure the physical address is aligned. This 
is required for the memory used for the MMU page tables, for example.

ATB,

Mark.

--

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063
(Continue reading)

Blue Swirl | 1 Jan 23:15 2011
Picon

Re: [PATCH 00/13] Convert SPARC32 to OFMEM v2

On Thu, Dec 30, 2010 at 11:22 PM, Mark Cave-Ayland
<mark.cave-ayland@...> wrote:
> This patchset converts SPARC32 and its associated devices over from
> its own private memory routines over to using the OFMEM API as used
> by PPC and SPARC64.

For all patches:
Tested-by: Blue Swirl <blauwirbel@...>
Reviewed-by: Blue Swirl <blauwirbel@...>

repository service | 2 Jan 01:05 2011

[commit] r998 - in trunk/openbios-devel: arch/sparc32 config/examples

Author: mcayland
Date: Sun Jan  2 01:05:44 2011
New Revision: 998
URL: http://tracker.coreboot.org/trac/openbios/changeset/998

Log:
Change the SPARC32 build system so that OFMEM is now included within SPARC32 builds.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@...>
Tested-by: Blue Swirl <blauwirbel@...>
Reviewed-by: Blue Swirl <blauwirbel@...>

Added:
   trunk/openbios-devel/arch/sparc32/ofmem_sparc32.c
Modified:
   trunk/openbios-devel/arch/sparc32/build.xml
   trunk/openbios-devel/arch/sparc32/lib.c
   trunk/openbios-devel/config/examples/sparc32_config.xml

Modified: trunk/openbios-devel/arch/sparc32/build.xml
==============================================================================
--- trunk/openbios-devel/arch/sparc32/build.xml	Thu Dec 30 23:02:09 2010	(r997)
+++ trunk/openbios-devel/arch/sparc32/build.xml	Sun Jan  2 01:05:44 2011	(r998)
 <at>  <at>  -15,6 +15,7  <at>  <at> 
   <object source="udiv.S"/>
   <object source="linux_load.c"/>
   <object source="sys_info.c"/>
+  <object source="ofmem_sparc32.c"/>
   <object source="romvec.c"/>
   <object source="call-romvec.S"/>
(Continue reading)

repository service | 2 Jan 01:05 2011

[commit] r999 - trunk/openbios-devel/arch/sparc32

Author: mcayland
Date: Sun Jan  2 01:05:51 2011
New Revision: 999
URL: http://tracker.coreboot.org/trac/openbios/changeset/999

Log:
Reduce memory of the Forth machine to 16k.

Since this memory is only being used by alloc-mem and free-mem then the majority of memory allocations will
not actually be
taken from this pool but from the C malloc()/free() implementations instead.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@...>
Tested-by: Blue Swirl <blauwirbel@...>
Reviewed-by: Blue Swirl <blauwirbel@...>

Modified:
   trunk/openbios-devel/arch/sparc32/ldscript
   trunk/openbios-devel/arch/sparc32/openbios.c

Modified: trunk/openbios-devel/arch/sparc32/ldscript
==============================================================================
--- trunk/openbios-devel/arch/sparc32/ldscript	Sun Jan  2 01:05:44 2011	(r998)
+++ trunk/openbios-devel/arch/sparc32/ldscript	Sun Jan  2 01:05:51 2011	(r999)
 <at>  <at>  -12,8 +12,8  <at>  <at> 

 /* 16KB stack */
 STACK_SIZE = 16384;
-/* 256k general alloc + 256k Forth dictionary + 128k Forth memory */
-VMEM_SIZE = (256 + 256 + 128) * 1024;
(Continue reading)

repository service | 2 Jan 01:05 2011

[commit] r1000 - trunk/openbios-devel/arch/sparc32

Author: mcayland
Date: Sun Jan  2 01:05:56 2011
New Revision: 1000
URL: http://tracker.coreboot.org/trac/openbios/changeset/1000

Log:
Alter the SPARC32 entry.S file to allow extra space for the page tables to handle OpenBIOS images up to 2MB.

Currently the page tables only allow enough space for a 1.5MB image; however during testing/development
it was
useful to temporarily allow larger images for debugging. Note that if larger ROM sizes are required for
testing, it is necessary to patch qemu to raise the hardcoded limit there too.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@...>
Tested-by: Blue Swirl <blauwirbel@...>
Reviewed-by: Blue Swirl <blauwirbel@...>

Modified:
   trunk/openbios-devel/arch/sparc32/entry.S

Modified: trunk/openbios-devel/arch/sparc32/entry.S
==============================================================================
--- trunk/openbios-devel/arch/sparc32/entry.S	Sun Jan  2 01:05:51 2011	(r999)
+++ trunk/openbios-devel/arch/sparc32/entry.S	Sun Jan  2 01:05:56 2011	(r1000)
 <at>  <at>  -38,15 +38,15  <at>  <at> 
 	 *
 	 * Top +-------------------------+
 	 *     | SMP CPU table           |
-	 *     | s + 0xf00 ... 0xf0f     |
-	 *     | s + 0xf0c valid         |
(Continue reading)

repository service | 2 Jan 01:06 2011

[commit] r1001 - trunk/openbios-devel/arch/sparc32

Author: mcayland
Date: Sun Jan  2 01:06:03 2011
New Revision: 1001
URL: http://tracker.coreboot.org/trac/openbios/changeset/1001

Log:
Switch SPARC32 page tables over to use OFMEM's ofmem_posix_memalign() rather than its internal
posix_memalign() function.

This requires a corresponding increase in the memory allocated to OFMEM in order to store the page tables.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@...>
Tested-by: Blue Swirl <blauwirbel@...>
Reviewed-by: Blue Swirl <blauwirbel@...>

Modified:
   trunk/openbios-devel/arch/sparc32/lib.c
   trunk/openbios-devel/arch/sparc32/ofmem_sparc32.c

Modified: trunk/openbios-devel/arch/sparc32/lib.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/lib.c	Sun Jan  2 01:05:56 2011	(r1000)
+++ trunk/openbios-devel/arch/sparc32/lib.c	Sun Jan  2 01:06:03 2011	(r1001)
 <at>  <at>  -273,7 +273,7  <at>  <at> 
     pte = l1[(va >> SRMMU_PGDIR_SHIFT) & (SRMMU_PTRS_PER_PGD - 1)];
     if ((pte & SRMMU_ET_MASK) == SRMMU_ET_INVALID) {
         if (alloc) {
-            ret = posix_memalign(&p, SRMMU_PTRS_PER_PMD * sizeof(int),
+            ret = ofmem_posix_memalign(&p, SRMMU_PTRS_PER_PMD * sizeof(int),
                                  SRMMU_PTRS_PER_PMD * sizeof(int));
(Continue reading)

repository service | 2 Jan 01:06 2011

[commit] r1002 - in trunk/openbios-devel: arch/sparc32 drivers include/libc

Author: mcayland
Date: Sun Jan  2 01:06:12 2011
New Revision: 1002
URL: http://tracker.coreboot.org/trac/openbios/changeset/1002

Log:
Switch IOMMU posix_memalign() calls over to ofmem_posix_memalign(), and then remove the private
SPARC32 posix_memalign() implementation since it is no longer required.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@...>
Tested-by: Blue Swirl <blauwirbel@...>
Reviewed-by: Blue Swirl <blauwirbel@...>

Modified:
   trunk/openbios-devel/arch/sparc32/lib.c
   trunk/openbios-devel/drivers/iommu.c
   trunk/openbios-devel/include/libc/stdlib.h

Modified: trunk/openbios-devel/arch/sparc32/lib.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/lib.c	Sun Jan  2 01:06:03 2011	(r1001)
+++ trunk/openbios-devel/arch/sparc32/lib.c	Sun Jan  2 01:06:12 2011	(r1002)
 <at>  <at>  -216,21 +216,6  <at>  <at> 
 	return p;
 }

-// XXX should be removed
-int
-posix_memalign(void **memptr, size_t alignment, size_t size)
-{
(Continue reading)

repository service | 2 Jan 01:06 2011

[commit] r1003 - trunk/openbios-devel/arch/sparc32

Author: mcayland
Date: Sun Jan  2 01:06:34 2011
New Revision: 1003
URL: http://tracker.coreboot.org/trac/openbios/changeset/1003

Log:
Add ofmem_init() function to openbios.c taking into account that unlike SPARC64, OFMEM needs to be setup
*before* the MMU so
that the page table allocation routines can use it.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@...>
Tested-by: Blue Swirl <blauwirbel@...>
Reviewed-by: Blue Swirl <blauwirbel@...>

Modified:
   trunk/openbios-devel/arch/sparc32/openbios.c

Modified: trunk/openbios-devel/arch/sparc32/openbios.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/openbios.c	Sun Jan  2 01:06:12 2011	(r1002)
+++ trunk/openbios-devel/arch/sparc32/openbios.c	Sun Jan  2 01:06:34 2011	(r1003)
 <at>  <at>  -25,6 +25,7  <at>  <at> 
 #include "packages/video.h"
 #define NO_QEMU_PROTOS
 #include "arch/common/fw_cfg.h"
+#include "libopenbios/ofmem.h"

 #define MEMORY_SIZE     (16*1024)       /* 16K ram for hosted system */
 #define DICTIONARY_SIZE (256*1024)      /* 256K for the dictionary   */
 <at>  <at>  -946,6 +947,9  <at>  <at> 
(Continue reading)

repository service | 2 Jan 01:06 2011

[commit] r1004 - trunk/openbios-devel/arch/sparc32

Author: mcayland
Date: Sun Jan  2 01:06:40 2011
New Revision: 1004
URL: http://tracker.coreboot.org/trac/openbios/changeset/1004

Log:
Switch SPARC32 over to use OFMEM's malloc()/free() internally rather than using it's own implementation.

Also juggle the memory to take into account that the allocations are coming from OFMEM, and remove
posix_memalign2() since it is no longer required.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@...>
Tested-by: Blue Swirl <blauwirbel@...>
Reviewed-by: Blue Swirl <blauwirbel@...>

Modified:
   trunk/openbios-devel/arch/sparc32/ldscript
   trunk/openbios-devel/arch/sparc32/lib.c
   trunk/openbios-devel/arch/sparc32/ofmem_sparc32.c

Modified: trunk/openbios-devel/arch/sparc32/ldscript
==============================================================================
--- trunk/openbios-devel/arch/sparc32/ldscript	Sun Jan  2 01:06:34 2011	(r1003)
+++ trunk/openbios-devel/arch/sparc32/ldscript	Sun Jan  2 01:06:40 2011	(r1004)
 <at>  <at>  -12,8 +12,7  <at>  <at> 

 /* 16KB stack */
 STACK_SIZE = 16384;
-/* 256k general alloc + 256k Forth dictionary + 16k Forth memory */
-VMEM_SIZE = (256 + 256 + 16) * 1024;
(Continue reading)

repository service | 2 Jan 01:06 2011

[commit] r1005 - in trunk/openbios-devel: arch/sparc32 drivers include/libopenbios

Author: mcayland
Date: Sun Jan  2 01:06:47 2011
New Revision: 1005
URL: http://tracker.coreboot.org/trac/openbios/changeset/1005

Log:
Remove the existing map_page() function and instead install a transitional API using map_pages() which
is almost identical to the OFMEM API.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@...>
Tested-by: Blue Swirl <blauwirbel@...>
Reviewed-by: Blue Swirl <blauwirbel@...>

Modified:
   trunk/openbios-devel/arch/sparc32/lib.c
   trunk/openbios-devel/drivers/iommu.c
   trunk/openbios-devel/include/libopenbios/ofmem.h

Modified: trunk/openbios-devel/arch/sparc32/lib.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/lib.c	Sun Jan  2 01:06:40 2011	(r1004)
+++ trunk/openbios-devel/arch/sparc32/lib.c	Sun Jan  2 01:06:47 2011	(r1005)
 <at>  <at>  -190,49 +190,41  <at>  <at> 
     return pa2va(pa);
 }

-/*
- * Create a memory mapping from va to epa.
- */
-int
(Continue reading)


Gmane