[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [PATCH v3 00/43] MINI-OS: enable the arm64 support



 1) Code.
   The work is based on Chen Baozi and Volodymyr's patches.
   I tested this patch set with my Softiron board.
   
   This patch set is based on the latest mini-os code:
    (git tree: git://xenbits.xen.org/mini-os.git
     The top is "48d3b31 Save/Restore Support: Add fini_shutdown call to app 
exit flow.")

   Please check the code in tree:
   https://github.com/zyzii/mini-os (branch: arm64_v3)

   After this patch set:
          1.) The scheduler for arm64 works fine.
          2.) The gic/timer for arm64 works fine.
   
   The log for the mini-os:
   =================================================
   (d20) - Mini-OS booting -
   (d20) - Setup CPU -
   (d20) - Setup booting pagetable -
   (d20) - MMU on -
   (d20) - Setup stack -
   (d20) - Jumping to C entry -
   (d20) Virtual -> physical offset = 1000040000000 
   (d20) Checking DTB at 0xffff000008000000...
   (d20) Found GIC: gicd_base = 0xffff00ffc0000000, gicc_base = 
0xffff00ffc0001000
   (d20) MM: Init
   (d20)     _text:       0xffff000000000000(VA)
   (d20)     _etext:      0xffff00000001cc00(VA)
   (d20)     _erodata:    0xffff000000024000(VA)
   (d20)     _edata:      0xffff00000002f41c(VA)
   (d20)     stack start: 0xffff00000002b000(VA)
   (d20)     _end:        0xffff0000000388e8(VA)
   (d20) Found memory at 0x40000000 (len 0x20000000)
   (d20) Using pages 262206 to 393216 as free space for heap.
   (d20) MM: Initialise page allocator for 
ffff00000003e000(4003e000)-ffff00001ffff000(5ffff000)
   (d20)     Adding memory range 4004a000-5ffff000
   (d20) MM: done
   (d20) Initialising timer interface
   (d20) Virtual Count register is 51B76CA, freq = 250000000 Hz
   (d20) Initialising console ... done.
   (d20) FDT suggests grant table base 38000000
   (d20) gnttab_table mapped at 0xffff00ffc0003000.
   (d20) Initialising scheduler
   (d20) Thread "Idle": pointer: 0x0xffff00001fffe078, stack: 
0x0xffff00001fff8000
   (d20) Thread "xenstore": pointer: 0x0xffff00001fffe0d8, stack: 
0x0xffff00000004c000
   (d20) xenbus initialised on irq 1
   (d20) Thread "shutdown": pointer: 0x0xffff00001fffe138, stack: 
0x0xffff00001fff0000
   (d20) Test main: par=0
   (d20) Thread "xenbus_tester": pointer: 0x0xffff00001fffe198, stack: 
0x0xffff00001fff4000
   (d20) Thread "periodic_thread": pointer: 0x0xffff00001fffe1f8, stack: 
0x0xffff00001ffe0000
   (d20) Thread "netfront": pointer: 0x0xffff00001fffe258, stack: 
0x0xffff00001ffe4000
   (d20) Thread "blkfront": pointer: 0x0xffff00001fffe2b8, stack: 
0x0xffff00001ffe8000
   (d20) Thread "fbfront": pointer: 0x0xffff00001fffe318, stack: 
0x0xffff00001ffec000
   (d20) Thread "kbdfront": pointer: 0x0xffff00001fffe378, stack: 
0x0xffff000000050000
   (d20) Thread "shutdown": pointer: 0x0xffff00001fffe3d8, stack: 
0x0xffff000000054000
   (d20) Doing xenbus test.
   (d20) Periodic thread started.
      =================================================

 2.) Tests  
   I tested this patch set on Softiron(arm64) and x86_64 platform.       
   (Please use "make CONFIG_USE_XEN_CONSOLE=y" to compile the minios.)
   
   In the Softiron, I did the Block Read/Write tests by enabling 
CONFIG_BLKFRONT.

 3.) Changes   
   v2 --> v3:
       0) Remove all the arm32 code. The folder like this:
             arch/arm/
             ├── arch.mk
             ├── arm64
             │   ├── arm64.S
             │   ├── asm.h
             │   ├── hypercalls64.S
             │   ├── minios-arm64.lds.S
             │   └── traps.c
             ├── balloon.c
             ├── events.c
             ├── gic.c
             ├── Makefile
             ├── mm.c
             ├── panic.c
             ├── sched.c
             ├── setup.c
             └── time.c
        
       1) Add two new patches after rebasing on the latest mini-os
           mini-os: refactor the shutdown
           arm64: add dummy arch_suspend_gnttab/arch_resume_gnttab

       2) Move dsb/dmb/mb to common place.
       3) merge several patch (about the DTC) into one.
       4) Add license information to memmove.

   v1 --> v2:
       0) make the DTC code as a subfolder, not a submodule.
       1) refactor the arm32 code, move it to a separate folder.
          Now the folder like this:
              arch/arm
              ├── arch.mk
              ├── arm32
              │   ├── arm32.S
              │   ├── hypercalls32.S
              │   └── minios-arm32.lds
              ├── arm64
              │   ├── arm64.S
              │   ├── asm.h
              │   ├── hypercalls64.S
              │   ├── minios-arm64.lds.S
              │   └── traps.c
              ├── balloon.c
              ├── events.c
              ├── gic.c
              ├── Makefile
              ├── mm.c
              ├── panic.c
              ├── sched.c
              ├── setup.c
              └── time.c
       2) fix the bug in scheduler.
       3) rewrite some GPL code, by copying and re-writing the FreeBSD code.
       4) implement the mmap/munmap(see the map_frame_ex/unmap_frames).
       5) change the mapping from 39bit to 48bit.
          rewrite some assembly code for booting. Use physical address
       7) change some code for "removing the e280 code from common place"
       8) change code in the parsing GIC information.
       9) move timer code to separate folder, such as arch/arm/arm32/time.h
       10) change the logic in to_virt.
       11) add mapping for GNT table.
       12) change the virtual memory layout to:
           /*
            * The virtual address layout for arm64(48bit):
            *
            *      
--------------------------------------------------------------------------
            *     |                                                             
             |
            *      
--------------------------------------------------------------------------
            *     ^                   ^                   ^                 ^   
             ^
            *     |<-- memory area -->|<-- kernel area -->|<- demand area ->|<- 
heap area -> |
            *     ^
            *     ^
            *     |
            * (0xffff000000000000, when TCR.T0SZ == 16)
            *
            * memory area (0xffff000000000000 ~ VIRT_KERNEL_AREA)   : used for 
linear physical memory mapping
            * kernel area (VIRT_KERNEL_AREA   ~ VIRT_DEMAND_AREA)   : used for 
map_frame_virt
            * demand area (VIRT_DEMAND_AREA   ~ VIRT_HEAP_AREA)     : used for 
ioremap
            * heap area   (VIRT_HEAP_AREA     ~ 0xffffffffffffffff) : used for 
heap
            */
           
           The code is put at 0xffff000000000000.
       13) Add memory size limits, such as MIN_MEM_SIZE/MAX_MEM_SIZE
       14) others

  4.) The comments from Julien which I did not follow:
     0) Use p2m_set_entry to setup the page table.
        I did not have good understanding of the p2m_set_entry().
        So I use my familiar way to setup the page table.

     1) Move dsb/dmb/mb to common place.
        I did not do so, because I found the older arm32 archs
        use "mcr" to do the memory barriers.    
        (I will add extra patch to fix this...)

Huang Shijie (43):
  mini-os: fix the wrong parameter for map_free() in
    init_page_allocator()
  arm32: remove the arm32 specific code file
  mini-os: replace the L1_PAGETABLE_SHIFT with PAGE_SHIFT
  mini-os: rename the L1_PROT to DEF_PAGE_PROT
  arm: create a new header for the page macros
  arm64: add the boot code
  arm64: change physical_address_offset to paddr_t
  arm64: fix the wrong mask for to_virt/to_phys
  arm64: add the __PAGE_SIZE macro in header file
  arm64: add exception support
  arm64: dump the registers for do_bad_mode()/do_sync()
  arm64: add the basic helpers for arm64
  arm64: define the quad_t for arm64
  arm64: time.c: fix the wrong format for printk
  mini-os: define ULONG_MAX/LONG_MAX for arm64
  mini-os: remove the e820 from common code
  arm64: mm.c: fix the compiler error
  arm64: refine the arch_init_mm
  arm64: add shared_info support
  mini-os: implement the memmove/memchr
  arm64: define the CALLEE_SAVED_REGISTERS
  arm64: implement the __arch_switch_threads
  arm64: implement the arm_start_thread
  arm64: change sp to "unsigned long" type
  arm64: fix the wrong size of the register
  arm64: implement the run_idle_thread
  arm64: add the hypercall support
  arm64: init the memory system
  arm64: set the mapping for console and xenbus
  arm64: add a new helper ioremap
  arm64: implement the mmap/munmap
  arm64: add the virtual address layout description
  arm64: parse out the address/size for gicd/gicc
  arm64: gic: implement the REG_WRITE32/REG_READ32
  arm64: implement the timer helpers for arm64
  arm64: add the link file
  arm64: add the makefile
  mini-os: Set TARGET_ARCH_FAM for arm64
  mini-os: create the image for arm
  mini-os: add the libfdt library
  arm64: add mapping for GNT table
  arm64: add dummy arch_suspend_gnttab/arch_resume_gnttab
  mini-os: refactor the shutdown

 .gitignore                        |    5 +
 Config.mk                         |    7 +-
 Makefile                          |   34 +-
 arch/arm/Makefile                 |   29 +
 arch/arm/arch.mk                  |    7 +
 arch/arm/arm32.S                  |  294 ------
 arch/arm/arm64/arm64.S            |  491 ++++++++++
 arch/arm/arm64/asm.h              |   18 +
 arch/arm/arm64/hypercalls64.S     |   81 ++
 arch/arm/arm64/minios-arm64.lds.S |   81 ++
 arch/arm/arm64/traps.c            |   44 +
 arch/arm/gic.c                    |   99 +-
 arch/arm/hypercalls32.S           |   64 --
 arch/arm/minios-arm32.lds         |   83 --
 arch/arm/mm.c                     |  437 ++++++++-
 arch/arm/sched.c                  |   19 +-
 arch/arm/setup.c                  |    9 +-
 arch/arm/time.c                   |   31 +-
 arch/x86/mm.c                     |   22 +-
 include/arm/arch_limits.h         |    4 +-
 include/arm/arch_mm.h             |   58 +-
 include/arm/arm64/io.h            |   18 +
 include/arm/arm64/os.h            |   51 +
 include/arm/arm64/pagetable.h     |  108 +++
 include/arm/arm64/time.h          |   34 +
 include/arm/arm64/traps.h         |   27 +
 include/arm/os.h                  |   75 +-
 include/arm/page_def.h            |    8 +
 include/arm/traps.h               |   21 +-
 include/mm.h                      |    3 +
 include/posix/limits.h            |    2 +-
 include/shutdown.h                |    2 +-
 include/types.h                   |    2 +-
 include/x86/arch_mm.h             |    2 +
 kernel.c                          |    2 +-
 lib/libfdt/Makefile.libfdt        |   11 +
 lib/libfdt/TODO                   |    3 +
 lib/libfdt/fdt.c                  |  251 +++++
 lib/libfdt/fdt.h                  |  111 +++
 lib/libfdt/fdt_addresses.c        |   96 ++
 lib/libfdt/fdt_empty_tree.c       |   83 ++
 lib/libfdt/fdt_overlay.c          |  861 +++++++++++++++++
 lib/libfdt/fdt_ro.c               |  703 ++++++++++++++
 lib/libfdt/fdt_rw.c               |  505 ++++++++++
 lib/libfdt/fdt_strerror.c         |  102 ++
 lib/libfdt/fdt_sw.c               |  300 ++++++
 lib/libfdt/fdt_wip.c              |  139 +++
 lib/libfdt/libfdt.h               | 1899 +++++++++++++++++++++++++++++++++++++
 lib/libfdt/libfdt_env.h           |  143 +++
 lib/libfdt/libfdt_internal.h      |   95 ++
 lib/libfdt/version.lds            |   71 ++
 lib/memmove.c                     |   74 ++
 lib/string.c                      |   12 +
 minios.mk                         |    4 +
 mm.c                              |   13 +-
 shutdown.c                        |   20 +-
 56 files changed, 7124 insertions(+), 644 deletions(-)
 create mode 100644 arch/arm/Makefile
 create mode 100644 arch/arm/arch.mk
 delete mode 100644 arch/arm/arm32.S
 create mode 100644 arch/arm/arm64/arm64.S
 create mode 100644 arch/arm/arm64/asm.h
 create mode 100644 arch/arm/arm64/hypercalls64.S
 create mode 100644 arch/arm/arm64/minios-arm64.lds.S
 create mode 100644 arch/arm/arm64/traps.c
 delete mode 100644 arch/arm/hypercalls32.S
 delete mode 100755 arch/arm/minios-arm32.lds
 create mode 100644 include/arm/arm64/io.h
 create mode 100644 include/arm/arm64/os.h
 create mode 100644 include/arm/arm64/pagetable.h
 create mode 100644 include/arm/arm64/time.h
 create mode 100644 include/arm/arm64/traps.h
 create mode 100644 include/arm/page_def.h
 create mode 100644 lib/libfdt/Makefile.libfdt
 create mode 100644 lib/libfdt/TODO
 create mode 100644 lib/libfdt/fdt.c
 create mode 100644 lib/libfdt/fdt.h
 create mode 100644 lib/libfdt/fdt_addresses.c
 create mode 100644 lib/libfdt/fdt_empty_tree.c
 create mode 100644 lib/libfdt/fdt_overlay.c
 create mode 100644 lib/libfdt/fdt_ro.c
 create mode 100644 lib/libfdt/fdt_rw.c
 create mode 100644 lib/libfdt/fdt_strerror.c
 create mode 100644 lib/libfdt/fdt_sw.c
 create mode 100644 lib/libfdt/fdt_wip.c
 create mode 100644 lib/libfdt/libfdt.h
 create mode 100644 lib/libfdt/libfdt_env.h
 create mode 100644 lib/libfdt/libfdt_internal.h
 create mode 100644 lib/libfdt/version.lds
 create mode 100644 lib/memmove.c

-- 
2.7.4


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.