Xen和香蕉派的故事

这篇文章将介绍如果在bananapi M1+上运行虚拟化系统XEN。

1. 准备bananapi 的环境

制作可以启动的sd卡。

wget https://dl.bananian.org/releases/bananian-latest.zip
unzip ./bananian-latest.zip
# Write the image to sdcard, replace `mmcblk0` below with the device name
# returned from `lsblk`
sudo dd bs=1M if=~/bananian-*.img of=/dev/mmcblk0

因为u-boot可以直接使用,所以不需要自己重新编译u-boot.
确保基本的linux系统可以启动。

2. 编译XEN

在电脑端编译xen,电脑需要配置好arm交叉编译链。

cd ~
wget https://releases.linaro.org/components/toolchain/binaries/latest-5/arm-linux-gnueabihf/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz
tar -xf gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz

#Update environment path
export PATH=$PATH:$(pwd)/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin

git clone git://xenbits.xen.org/xen.git
cd xen
make dist-xen XEN_TARGET_ARCH=arm32 CROSS_COMPILE=arm-linux-gnueabihf- CONFIG_EARLY_PRINTK=sun7i -j4

将dist/install/boot/xen 拷贝到sd卡的启动分区

3. 编译支持虚拟化XEN的linux kernel和DTB

修改sun7i-a20-bananapi-m1-plus.dts, 因为dom0的linux 没有使用serial0, 所以需要删除如下节点:

...
chosen {
	stdout-path = "serial0:115200n8";
}
...

编译kernel和dts

git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
git clone https://github.com/Bananian/bananian.git
cd ~/linux-stable
git checkout v4.3.3
for i in ../bananian/kernel/4.3.3/patches/*; do patch -p1 < $i; done

sudo apt-get update && sudo apt-get install -y build-essential libncurses5 libncurses5-dev
#replace the config file
wget https://github.com/lemonflynn/my-linux/blob/v4.3-rc3/.config
sudo apt-get update && sudo apt-get install -y build-essential libncurses5 libncurses5-dev
make ARCH=arm menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 zImage uImage modules dtbs LOADADDR=40008000

menuconfig的配置可以参考Mainline Linux Kernel Configs

生成boot.cmd文件,内容如下

# SUNXI Xen Boot Script

# Addresses suitable for 1GB system, adjust as appropriate for a 2GB system.
# Top of RAM:         0x80000000
# Xen relocate addr   0x7fe00000
setenv kernel_addr_r  0x7f600000 # 8M
setenv ramdisk_addr_r 0x7ee00000 # 8M
setenv fdt_addr       0x7ec00000 # 2M
setenv xen_addr_r     0x7ea00000 # 2M

setenv fdt_high      0xffffffff # Load fdt in place instead of relocating

# Load xen/xen to ${xen_addr_r}.
fatload mmc 0 ${xen_addr_r} xen
setenv bootargs "console=dtuart dtuart=/soc@01c00000/serial@01c28000 dom0_mem=256M"

# Load appropriate .dtb file to ${fdt_addr}
fatload mmc 0 ${fdt_addr} dtb/sun7i-a20-bananapi-m1-plus.dtb 
fdt addr ${fdt_addr} 0x40000
fdt resize
fdt chosen
fdt set /chosen \#address-cells <1>
fdt set /chosen \#size-cells <1>

# Load Linux arch/arm/boot/zImage to ${kernel_addr_r}
fatload mmc 0 ${kernel_addr_r} zImage  

fdt mknod /chosen module@0
fdt set /chosen/module@0 compatible "xen,linux-zimage" "xen,multiboot-module"
fdt set /chosen/module@0 reg <${kernel_addr_r} 0x${filesize} >
fdt set /chosen/module@0 bootargs "console=hvc0 rw root=/dev/mmcblk0p2 rootwait clk_ignore_unused"

bootz ${xen_addr_r} - ${fdt_addr}

首先安装u-boot-tools

apt-get update && apt-get install -y u-boot-tools

将sd卡插入电脑,拷贝必要文件到sd卡。

mkimage -C none -A arm -T script -d boot.cmd boot.scr
#assume your root partition is mounted on /media/root, ohterwise, replace with your dir.
cp boot.src /media/root/
cp arch/arm/boot/zImage /media/root/
cp arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dtb /media/root/dts

注意事项

因为dom0的linux使用的是hvc0的虚拟终端,所以需要修改etc/inittab中的getty启动项

...
# T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100
 72 T0:23:respawn:/sbin/getty -L hvc0 115200 vt100
...

不知为何文件系统中没有以下的文件节点,所以也需要注释etc/init.d/bananian-settings中的echo操作。

...
 # cpu frequency
    # echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    # echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
    # echo 1008000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
    # echo 25 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
    # echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
    # echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
...

将sd卡插回香蕉派,重启。
至此,Dom0可以成功启动运行:)

Dom0 booting log

U-Boot 2016.01-00002-g954c1f1-dirty (Apr 19 2016 - 09:22:56 +0200) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
Setting up a 720x576i composite-pal console (overscan 32x20)
In:    serial
Out:   vga
Err:   vga
SCSI:  SUNXI SCSI INIT
SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
Net:   eth0: ethernet@01c50000
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
reading /boot.scr
1246 bytes read in 25 ms (47.9 KiB/s)
## Executing script at 43100000
reading xen
851976 bytes read in 92 ms (8.8 MiB/s)
reading dtb/sun7i-a20-bananapi-m1-plus-xen.dtb
28716 bytes read in 55 ms (509.8 KiB/s)
reading zImage
4281592 bytes read in 248 ms (16.5 MiB/s)
Kernel image @ 0x7ea00000 [ 0x000000 - 0x115780 ]
## Flattened Device Tree blob at 7ec00000
   Booting using the fdt blob at 0x7ec00000
   reserving fdt memory region: addr=7ec00000 size=8000
   Using Device Tree in place at 7ec00000, end 7ec0afff

Starting kernel ...

- UART enabled -
- CPU 00000000 booting -
- Xen starting in Hyp mode -
- Zero BSS -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000040000000 - 000000007fe69fff
(XEN)
(XEN) MODULE[0]: 000000007ec00000 - 000000007ec08000 Device Tree
(XEN) MODULE[1]: 000000007f600000 - 000000007fa154f8 Kernel
(XEN)  RESVD[0]: 000000007ec00000 - 000000007ec08000
(XEN)
(XEN) CMDLINE[000000007f600000]:chosen console=hvc0 rw root=/dev/mmcblk0p2 rootwait clk_ignore_unused
(XEN)
(XEN) Command line: console=dtuart dtuart=/soc@01c00000/serial@01c28000 dom0_mem=256M
(XEN) Xen heap: 000000007c000000-000000007e000000 (8192 pages)
(XEN) Dom heap: 253546 pages
(XEN) Domain heap initialised
(XEN) Booting using Device Tree
(XEN) Platform: Allwinner ARMv7
(XEN) Looking for dtuart at "/soc@01c00000/serial@01c28000", options ""
 Xen 4.13-unstable
(XEN) Xen version 4.13-unstable (flynn@) (arm-linux-gnueabihf-gcc (Linaro GCC 5.3-2016.05) 5.3.1 20160412) debug=y  Tue Apr  9 05:16:40 EDT 2019
(XEN) Latest ChangeSet: Mon Mar 18 16:22:29 2019 +0000 git:cb70a26f78-dirty
(XEN) Processor: 410fc074: "ARM Limited", variant: 0x0, part 0xc07, rev 0x4
(XEN) 32-bit Execution:
(XEN)   Processor Features: 00001131:00011011
(XEN)     Instruction Sets: AArch32 A32 Thumb Thumb-2 ThumbEE Jazelle
(XEN)     Extensions: GenericTimer Security
(XEN)   Debug Features: 02010555
(XEN)   Auxiliary Features: 00000000
(XEN)   Memory Model Features: 10101105 40000000 01240000 02102211
(XEN)  ISA Features: 02101110 13112111 21232041 11112131 10011142 00000000
(XEN) Using SMC Calling Convention v1.0
(XEN) Using PSCI v0.1
(XEN) SMP: Allowing 2 CPUs
(XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 24000 KHz
(XEN) GICv2: WARNING: The GICC size is too small: 0x1000 expected 0x2000
(XEN) GICv2 initialization:
(XEN)         gic_dist_addr=0000000001c81000
(XEN)         gic_cpu_addr=0000000001c82000
(XEN)         gic_hyp_addr=0000000001c84000
(XEN)         gic_vcpu_addr=0000000001c86000
(XEN)         gic_maintenance_irq=25
(XEN) GICv2: 160 lines, 2 cpus, secure (IID 0100143b).
(XEN) Using scheduler: SMP Credit Scheduler rev2 (credit2)
(XEN) Initializing Credit2 scheduler
(XEN)  load_precision_shift: 18
(XEN)  load_window_shift: 30
(XEN)  underload_balance_tolerance: 0
(XEN)  overload_balance_tolerance: -3
(XEN)  runqueues arrangement: socket
(XEN)  cap enforcement granularity: 10ms
(XEN) load tracking window length 1073741824 ns
(XEN) Adding cpu 0 to runqueue 0
(XEN)  First cpu on runqueue, activating
(XEN) Allocated console ring of 16 KiB.
(XEN) VFP implementer 0x41 architecture 2 part 0x30 variant 0x7 rev 0x4
(XEN) Bringing up CPU1
- CPU 00000001 booting -
- Xen starting in Hyp mode -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) Adding cpu 1 to runqueue 0
(XEN) CPU 1 booted.
(XEN) Brought up 2 CPUs
(XEN) P2M: 40-bit IPA
(XEN) P2M: 3 levels with order-1 root, VTCR 0x80003558
(XEN) I/O virtualisation disabled
(XEN) build-id: 89804400afa4f1747993210a4752e0856f43802a
(XEN) alternatives: Patching with alt table 002a2220 -> 002a228c
(XEN) *** LOADING DOMAIN 0 ***
(XEN) Loading Domd0 kernel from boot module @ 000000007f600000
(XEN) Allocating 1:1 mappings totalling 256MB for dom0:
(XEN) BANK[0] 0x00000060000000-0x00000070000000 (256MB)
(XEN) Grant table range: 0x0000007ea00000-0x0000007ea40000
(XEN) Allocating PPI 16 for event channel interrupt
(XEN) Loading zImage from 000000007f600000 to 0000000067a00000-0000000067e154f8
(XEN) Loading dom0 DTB to 0x0000000068000000-0x0000000068006ad7
(XEN) Initial low memory virq threshold set at 0x4000 pages.
(XEN) Scrubbing Free RAM in background
(XEN) Std. Loglevel: All
(XEN) Guest Loglevel: All
(XEN) *** Serial input to DOM0 (type 'CTRL-a' three times to switch input)
(XEN) Freed 340kB init memory.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.3.3-00004-g51ad250fb068-dirty (flynn@francisco) (gcc version 5.3.1 20160412 (Linaro GCC 5.3-2016.05) ) #90 SMP Tue Apr 9 21:58:36 EDT 2019
[    0.000000] CPU: ARMv7 Processor [410fc074] revision 4 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Banana Pi BPI-M1-Plus
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: Trusted OS migration not required
[    0.000000] Xen 4.13 support found
[    0.000000] PERCPU: Embedded 13 pages/cpu @cfd84000 s23808 r8192 d21248 u53248
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 64960
[    0.000000] Kernel command line: console=hvc0 rw root=/dev/mmcblk0p2 rootwait clk_ignore_unused
[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Memory: 241660K/262144K available (6611K kernel code, 547K rwdata, 1832K rodata, 504K init, 8193K bss, 20484K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xd0800000 - 0xff000000   ( 744 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc084706c   (8445 kB)
[    0.000000]       .init : 0xc0848000 - 0xc08c6000   ( 504 kB)
[    0.000000]       .data : 0xc08c6000 - 0xc094ef00   ( 548 kB)
[    0.000000]        .bss : 0xc0951000 - 0xc115160c   (8194 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Running RCU self tests
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU lockdep checking is enabled.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000]  RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] Architected cp15 timer(s) running at 24.00MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000009] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000027] Switching to timer-based delay loop, resolution 41ns
[    0.000698] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.001256] clocksource: hstimer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 12741736309 ns
[    0.002144] Console: colour dummy device 80x30
[    0.003675] console [hvc0] enabled
[    0.003715] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
[    0.003754] ... MAX_LOCKDEP_SUBCLASSES:  8
[    0.003780] ... MAX_LOCK_DEPTH:          48
[    0.003805] ... MAX_LOCKDEP_KEYS:        8191
[    0.003842] ... CLASSHASH_SIZE:          4096
[    0.003872] ... MAX_LOCKDEP_ENTRIES:     32768
[    0.003900] ... MAX_LOCKDEP_CHAINS:      65536
[    0.003929] ... CHAINHASH_SIZE:          32768
[    0.003957]  memory used by lock dependency info: 5167 kB
[    0.003987]  per task-struct memory footprint: 1536 bytes
[    0.004017] ------------------------
[    0.004040] | Locking API testsuite:
[    0.004065] ----------------------------------------------------------------------------
[    0.004104]                                  | spin |wlock |rlock |mutex | wsem | rsem |
[    0.004143]   --------------------------------------------------------------------------
[    0.004201]                      A-A deadlock:  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |
[    0.015805]                  A-B-B-A deadlock:  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |
[    0.027508]              A-B-B-C-C-A deadlock:  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |
[    0.039655]              A-B-C-A-B-C deadlock:  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |
[    0.051790]          A-B-B-C-C-D-D-A deadlock:  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |
[    0.064564]          A-B-C-D-B-D-D-A deadlock:  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |
[    0.077288]          A-B-C-D-B-C-D-A deadlock:  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |
[    0.090035]                     double unlock:  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |
[    0.101143]                   initialize held:  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |
[    0.112188]                  bad unlock order:  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |
[    0.123830]   --------------------------------------------------------------------------
[    0.123876]               recursive read-lock:             |  ok  |             |  ok  |
[    0.127685]            recursive read-lock #2:             |  ok  |             |  ok  |
[    0.131403]             mixed read-write-lock:             |  ok  |             |  ok  |
[    0.135174]             mixed write-read-lock:             |  ok  |             |  ok  |
[    0.139071]   --------------------------------------------------------------------------
[    0.139116]      hard-irqs-on + irq-safe-A/12:  ok  |  ok  |  ok  |
[    0.144639]      soft-irqs-on + irq-safe-A/12:  ok  |  ok  |  ok  |
[    0.150315]      hard-irqs-on + irq-safe-A/21:  ok  |  ok  |  ok  |
[    0.155882]      soft-irqs-on + irq-safe-A/21:  ok  |  ok  |  ok  |
[    0.161557]        sirq-safe-A => hirqs-on/12:  ok  |  ok  |  ok  |
[    0.167168]        sirq-safe-A => hirqs-on/21:  ok  |  ok  |  ok  |
[    0.172804]          hard-safe-A + irqs-on/12:  ok  |  ok  |  ok  |
[    0.178365]          soft-safe-A + irqs-on/12:  ok  |  ok  |  ok  |
[    0.184012]          hard-safe-A + irqs-on/21:  ok  |  ok  |  ok  |
[    0.189618]          soft-safe-A + irqs-on/21:  ok  |  ok  |  ok  |
[    0.195260]     hard-safe-A + unsafe-B #1/123:  ok  |  ok  |  ok  |
[    0.201122]     soft-safe-A + unsafe-B #1/123:  ok  |  ok  |  ok  |
[    0.207061]     hard-safe-A + unsafe-B #1/132:  ok  |  ok  |  ok  |
[    0.212898]     soft-safe-A + unsafe-B #1/132:  ok  |  ok  |  ok  |
[    0.218832]     hard-safe-A + unsafe-B #1/213:  ok  |  ok  |  ok  |
[    0.224661]     soft-safe-A + unsafe-B #1/213:  ok  |  ok  |  ok  |
[    0.230595]     hard-safe-A + unsafe-B #1/231:  ok  |  ok  |  ok  |
[    0.236352]     soft-safe-A + unsafe-B #1/231:  ok  |  ok  |  ok  |
[    0.242263]     hard-safe-A + unsafe-B #1/312:  ok  |  ok  |  ok  |
[    0.247926]     soft-safe-A + unsafe-B #1/312:  ok  |  ok  |  ok  |
[    0.253665]     hard-safe-A + unsafe-B #1/321:  ok  |  ok  |  ok  |
[    0.259470]     soft-safe-A + unsafe-B #1/321:  ok  |  ok  |  ok  |
[    0.265340]     hard-safe-A + unsafe-B #2/123:  ok  |  ok  |  ok  |
[    0.271114]     soft-safe-A + unsafe-B #2/123:  ok  |  ok  |  ok  |
[    0.277019]     hard-safe-A + unsafe-B #2/132:  ok  |  ok  |  ok  |
[    0.282713]     soft-safe-A + unsafe-B #2/132:  ok  |  ok  |  ok  |
[    0.288621]     hard-safe-A + unsafe-B #2/213:  ok  |  ok  |  ok  |
[    0.294354]     soft-safe-A + unsafe-B #2/213:  ok  |  ok  |  ok  |
[    0.300243]     hard-safe-A + unsafe-B #2/231:  ok  |  ok  |  ok  |
[    0.305929]     soft-safe-A + unsafe-B #2/231:  ok  |  ok  |  ok  |
[    0.311791]     hard-safe-A + unsafe-B #2/312:  ok  |  ok  |  ok  |
[    0.317522]     soft-safe-A + unsafe-B #2/312:  ok  |  ok  |  ok  |
[    0.323369]     hard-safe-A + unsafe-B #2/321:  ok  |  ok  |  ok  |
[    0.329090]     soft-safe-A + unsafe-B #2/321:  ok  |  ok  |  ok  |
[    0.334904]       hard-irq lock-inversion/123:  ok  |  ok  |  ok  |
[    0.340673]       soft-irq lock-inversion/123:  ok  |  ok  |  ok  |
[    0.346580]       hard-irq lock-inversion/132:  ok  |  ok  |  ok  |
[    0.352301]       soft-irq lock-inversion/132:  ok  |  ok  |  ok  |
[    0.358214]       hard-irq lock-inversion/213:  ok  |  ok  |  ok  |
[    0.363955]       soft-irq lock-inversion/213:  ok  |  ok  |  ok  |
[    0.369873]       hard-irq lock-inversion/231:  ok  |  ok  |  ok  |
[    0.375580]       soft-irq lock-inversion/231:  ok  |  ok  |  ok  |
[    0.381469]       hard-irq lock-inversion/312:  ok  |  ok  |  ok  |
[    0.387217]       soft-irq lock-inversion/312:  ok  |  ok  |  ok  |
[    0.393094]       hard-irq lock-inversion/321:  ok  |  ok  |  ok  |
[    0.398839]       soft-irq lock-inversion/321:  ok  |  ok  |  ok  |
[    0.404693]       hard-irq read-recursion/123:  ok  |
[    0.406696]       soft-irq read-recursion/123:  ok  |
[    0.408672]       hard-irq read-recursion/132:  ok  |
[    0.410625]       soft-irq read-recursion/132:  ok  |
[    0.412591]       hard-irq read-recursion/213:  ok  |
[    0.414538]       soft-irq read-recursion/213:  ok  |
[    0.416613]       hard-irq read-recursion/231:  ok  |
[    0.418584]       soft-irq read-recursion/231:  ok  |
[    0.420564]       hard-irq read-recursion/312:  ok  |
[    0.422509]       soft-irq read-recursion/312:  ok  |
[    0.424480]       hard-irq read-recursion/321:  ok  |
[    0.426525]       soft-irq read-recursion/321:  ok  |
[    0.428513]   --------------------------------------------------------------------------
[    0.428558]   | Wound/wait tests |
[    0.428582]   ---------------------
[    0.428607]                   ww api failures:  ok  |  ok  |  ok  |
[    0.434354]                ww contexts mixing:  ok  |  ok  |
[    0.438226]              finishing ww context:  ok  |  ok  |  ok  |  ok  |
[    0.445711]                locking mismatches:  ok  |  ok  |  ok  |
[    0.451534]                  EDEADLK handling:  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |
[    0.470992]            spinlock nest unlocked:  ok  |
[    0.472944]   -----------------------------------------------------
[    0.472984]                                  |block | try  |context|
[    0.473018]   -----------------------------------------------------
[    0.473052]                           context:  ok  |  ok  |  ok  |
[    0.478898]                               try:  ok  |  ok  |  ok  |
[    0.484567]                             block:  ok  |  ok  |  ok  |
[    0.490220]                          spinlock:  ok  |  ok  |  ok  |
[    0.496219] -------------------------------------------------------
[    0.496259] Good, all 253 testcases passed! |
[    0.496288] ---------------------------------
[    0.496402] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.496501] pid_max: default: 32768 minimum: 301
[    0.497181] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.497236] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.502370] Initializing cgroup subsys io
[    0.502615] Initializing cgroup subsys memory
[    0.502755] Initializing cgroup subsys devices
[    0.502931] Initializing cgroup subsys freezer
[    0.503115] Initializing cgroup subsys perf_event
[    0.503221] CPU: Testing write buffer coherency: ok
[    0.503395] ftrace: allocating 20752 entries in 61 pages
[    0.542510] /cpus/cpu@0 missing clock-frequency property
[    0.542632] /cpus/cpu@1 missing clock-frequency property
[    0.542673] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.543247] xen:grant_table: Grant tables using version 1 layout
[    0.543355] Grant table initialized
[    0.543488] xen:events: Using FIFO-based ABI
[    0.543562] Xen: initializing cpu0
[    0.543808] Setting up static identity map for 0x60008280 - 0x600082d8
[    0.586198] Xen: initializing cpu1
[    0.586295] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.587584] Brought up 2 CPUs
[    0.587697] SMP: Total of 2 processors activated (96.00 BogoMIPS).
[    0.587731] CPU: All CPU(s) started in SVC mode.
[    0.593372] devtmpfs: initialized
[    0.636007] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 4
[    0.637554] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.639288] pinctrl core: initialized pinctrl subsystem
[    0.647202] NET: Registered protocol family 16
[    0.648403] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.653315] xen:swiotlb_xen: Warning: only able to allocate 4 MB for software IO TLB
[    0.655627] software IO TLB [mem 0x6f000000-0x6f400000] (4MB) mapped at [cf000000-cf3fffff]
[    0.679826] hw-breakpoint: Failed to enable monitor mode on CPU 1.
[    0.743278] xen:balloon: Initialising balloon driver
[    0.744481] xen_balloon: Initialising balloon driver
[    0.746124] reg-fixed-voltage usb1-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb1_vbus_pin@0, deferring probe
[    0.746336] reg-fixed-voltage usb2-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb2_vbus_pin@0, deferring probe
[    0.750166] reg-fixed-voltage gmac-3v3: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/gmac_power_pin@0, deferring probe
[    0.750362] reg-fixed-voltage vmmc3: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/vmmc3_pin@0, deferring probe
[    0.751999] SCSI subsystem initialized
[    0.754379] usbcore: registered new interface driver usbfs
[    0.754664] usbcore: registered new interface driver hub
[    0.755047] usbcore: registered new device driver usb
[    0.755616] pps_core: LinuxPPS API ver. 1 registered
[    0.755658] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.755777] PTP clock support registered
[    0.765502] clocksource: Switched to clocksource arch_sys_counter
[    1.149058] simple-framebuffer 7fe79000.framebuffer: framebuffer at 0x7fe79000, 0x178e00 bytes, mapped to 0xd0a00000
[    1.149155] simple-framebuffer 7fe79000.framebuffer: format=x8r8g8b8, mode=656x536x32, linelength=2880
[    1.152829] simple-framebuffer 7fe79000.framebuffer: fb0: simplefb registered!
[    1.197664] NET: Registered protocol family 2
[    1.199940] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[    1.200082] TCP bind hash table entries: 2048 (order: 4, 73728 bytes)
[    1.201016] TCP: Hash tables configured (established 2048 bind 2048)
[    1.201370] UDP hash table entries: 256 (order: 2, 20480 bytes)
[    1.201674] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)
[    1.203024] NET: Registered protocol family 1
[    1.205164] RPC: Registered named UNIX socket transport module.
[    1.205248] RPC: Registered udp transport module.
[    1.205294] RPC: Registered tcp transport module.
[    1.205638] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.211805] futex hash table entries: 512 (order: 3, 32768 bytes)
[    1.272264] NFS: Registering the id_resolver key type
[    1.272956] Key type id_resolver registered
[    1.273005] Key type id_legacy registered
[    1.273318] fuse init (API version 7.23)
[    1.292483] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    1.292795] io scheduler noop registered
[    1.292855] io scheduler deadline registered
[    1.293015] io scheduler cfq registered (default)
[    1.300931] sun7i-a20-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    1.306221] xen:xen_evtchn: Event-channel device installed
[    1.662130] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    1.745567] ahci-sunxi 1c18000.sata: controller can't do PMP, turning off CAP_PMP
[    1.745925] ahci-sunxi 1c18000.sata: SSS flag set, parallel bus scan disabled
[    1.746010] ahci-sunxi 1c18000.sata: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl platform mode
[    1.746067] ahci-sunxi 1c18000.sata: flags: ncq sntf stag pm led clo only pio slum part ccc
[    1.751811] scsi host0: ahci-sunxi
[    1.754386] ata1: SATA max UDMA/133 mmio [mem 0x01c18000-0x01c18fff] port 0x100 irq 31
[    1.761361] libphy: Fixed MDIO Bus: probed
[    1.764580] xen_netfront: Initialising Xen virtual ethernet driver
[    1.764882] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.764937] ehci-platform: EHCI generic platform driver
[    1.766884] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.767035] ohci-platform: OHCI generic platform driver
[    1.770402] sunxi-rtc 1c20d00.rtc: rtc core: registered rtc-sunxi as rtc0
[    1.770473] sunxi-rtc 1c20d00.rtc: RTC enabled
[    1.770828] i2c /dev entries driver
[    1.784844] sunxi-wdt 1c20c90.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.787524] sunxi-mmc 1c0f000.mmc: No vqmmc regulator found
[    1.789690] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[    1.826573] sunxi-mmc 1c0f000.mmc: base:0xd0902000 irq:26
[    1.835003] usbcore: registered new interface driver usbhid
[    1.835071] usbhid: USB HID core driver
[    1.838289] NET: Registered protocol family 17
[    1.839364] Key type dns_resolver registered
[    1.840187] Registering SWP/SWPB emulation handler
[    1.864278] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.867269] mmc0: new high speed SDHC card at address 59b4
[    1.872335] mmcblk0: mmc0:59b4 00000 14.9 GiB
[    1.880299]  mmcblk0: p1 p2
[    1.966029] sun7i-dwmac 1c50000.ethernet: no reset control found
[    1.966138]  Ring mode enabled
[    1.966172]  No HW DMA feature register supported
[    1.966205]  Normal descriptors
[    1.966235]  TX Checksum insertion supported
[    1.979377] libphy: stmmac: probed
[    1.979446] eth0: PHY ID 001cc915 at 0 IRQ POLL (stmmac-0:00) active
[    1.979486] eth0: PHY ID 001cc915 at 1 IRQ POLL (stmmac-0:01)
[    1.983415] sunxi-mmc 1c12000.mmc: No vqmmc regulator found
[    2.025654] sunxi-mmc 1c12000.mmc: base:0xd0908000 irq:27
[    2.028854] sunxi-rtc 1c20d00.rtc: setting system clock to 2019-04-10 03:58:59 UTC (1554868739)
[    2.032153] sunxi-mmc 1c12000.mmc: smc 1 err, cmd 8, RTO !!
[    2.044834] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    2.047235] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    2.049320] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    2.053008] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    2.067189] vcc3v0: disabling
[    2.067281] vcc5v0: disabling
[    2.067319] usb1-vbus: disabling
[    2.067389] usb2-vbus: disabling
[    2.067454] clk: Not disabling unused clocks
[    2.077619] mmc1: new high speed SDIO card at address 0001
[    2.105495] ata1: SATA link down (SStatus 0 SControl 300)
[    2.111098] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[    2.114845] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
[    2.149275] EXT4-fs (mmcblk0p2): warning: mounting unchecked fs, running e2fsck is recommended
[    2.159518] EXT4-fs (mmcblk0p2): mounted filesystem without journal. Opts: (null)
[    2.159811] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    2.173911] devtmpfs: mounted
[    2.175757] Freeing unused kernel memory: 504K (c0848000 - c08c6000)
Mount failed for selinuxfs on /sys/fs/selinux:  No such file or directory
INIT: version 2.88 booting
[info] Using makefile-style concurrent boot in runlevel S.
[....] Starting the hotplug events dispatcher: udevd[    3.694429] systemd-udevd[155]: starting version 215
[    3.733111] random: udevd urandom read with 8 bits of entropy available
. ok
[ ok ] Synthesizing the initial hotplug events...done.
[ ok ] Waiting for /dev to be fully populated...done.
Starting fake hwclock: loading system time.
Current system time: 2019-04-10 03:59:04
fake-hwclock saved clock information is in the past: 2019-04-10 03:17:01
To set system time to this saved clock anyway, use "force"
[ ok ] Setting preliminary keymap...done.
[    8.835972] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[....] Activating lvm and md swap...[   10.652201] Adding 524284k swap on /swapfile1.  Priority:-1 extents:3 across:622588k SS
done.
[....] Checking file systems...fsck from util-linux 2.25.2
done.
[ ok ] Cleaning up temporary files... /tmp.
[info] Loading kernel module 8021q.
modprobe: FATAL: Module 8021q not found.
[ ok ] Mounting local filesystems...done.
[ ok ] Activating swapfile swap...done.
[ ok ] Cleaning up temporary files....
[ ok ] Setting kernel variables ...done.
[   14.817440]  RX IPC Checksum Offload disabled
[   14.817528]  No MAC Management Counters available
[....] Configuring network interfaces...Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/02:d9:06:41:b2:a3
Sending on   LPF/eth0/02:d9:06:41:b2:a3
Sending on   Socket/fallback
DHCPREQUEST on eth0 to 255.255.255.255 port 67
[   18.805923] sun7i-dwmac 1c50000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.1
bound to 192.168.1.106 -- renewal in 42077 seconds.
done.
[ ok ] Cleaning up temporary files....
[info] Setting console screen modes.
setterm: cannot (un)set powersave mode: Inappropriate ioctl for device
[ ok ] Setting up console font and keymap...done.
INIT: Entering runlevel: 2
[info] Using makefile-style concurrent boot in runlevel 2.
[ ok ] Starting enhanced syslogd: rsyslogd.
[ ok ] Loading cpufreq kernel modules...done (none).
[ ok ] Starting NTP server: ntpd.
[ ok ] Starting periodic command scheduler: cron.
[ ok ] Starting OpenBSD Secure Shell server: sshd.
[ ok ] CPUFreq Utilities: Setting ondemand CPUFreq governor...disabled, governor not available...done.
[   28.352969] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)

Debian GNU/Linux 8 bananapi hvc0

bananapi login: root
Password:
Last login: Wed Apr 10 03:46:33 UTC 2019 on hvc0
Linux bananapi 4.3.3-00004-g51ad250fb068-dirty #90 SMP Tue Apr 9 21:58:36 EDT 2019 armv7l

------------------------------------------------------------------------
Welcome to Bananian Linux!
For news and updates check: https://www.bananian.org
Any questions? Read the FAQ first: https://www.bananian.org/faq

Run 'bananian-config' to set up Bananian Linux
Run 'bananian-update' to check for distribution updates
------------------------------------------------------------------------
root@bananapi ~ #

参考

https://www.sourcediver.org/blog/2014/06/19/running-arch-linux-arm-with-xen-on-cubieboard-2/
https://mirage.io/wiki/xen-on-cubieboard2
https://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensions
https://wiki.xenproject.org/wiki/Mainline_Linux_Kernel_Configs

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值