在qemu vexpress-a15平台运行xen, guest OS Dom0 Linux和guest OS DomU1 Linux

        本节使用上一实验章节在qemu vexpress-a15平台运行xen,guest OS Dom0 Linux编译生成的linux镜像和文件系统为基础进行测试运行。

        首先需要修改设备树文件:

/ {
        model = "V2P-CA15_CA7";
        arm,hbi = <0x249>;
        arm,vexpress,site = <0xf>;
        compatible = "arm,vexpress,v2p-ca15_a7", "arm,vexpress";
        interrupt-parent = <&gic>;
        #address-cells = <2>;
        #size-cells = <2>;

        chosen {
                bootargs = "dom0_mem=768M console=dtuart dtuart=serial0 dom0_vcpus_pin hmp-unsafe=true dom0_max_vcpus=1 bootscrub=0 loglvl=all";
                /delete-property/stdout-path;
                xen,dom0-bootargs = "rw root=/dev/ram rdinit=/sbin/init earlyprintk=serial,ttyAMA0 console=hvc0 earlycon=xenboot";

                modules {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        module@1 {
                                compatible = "xen,linux-zimage", "xen,multiboot-module";
                                reg = <0xa0008000 0xffffff>;
                        };

                        module@2 {
                                compatible = "multiboot,ramdisk", "multiboot,module";
                                reg = <0x82000000 0xffffff>;
                        };
                };

                domU1 {
                        compatible = "xen,domain";
                        #address-cells = <0x2>;
                        #size-cells = <0x1>;
                        memory = <0 131072>;
                        cpus = <1>;
                        vpl011;
                        module@1 {
                                compatible = "multiboot,kernel", "multiboot,module";
                                reg = <0x0 0xb0008000 0xffffff>;
                                bootargs = "rw root=/dev/ram rdinit=/sbin/init console=ttyAMA0";
                        };

                        module@2 {
                                compatible = "multiboot,ramdisk", "multiboot,module";
                                reg = <0x0 0x84000000 0xffffff>;
                        };
                };
        };

添加DomU1相关配置,memory字段指定DomU1内存空间大小,以kb为单位;cpus指定DomU1创建的vcpu数量;module@1和module@2的字段跟DomU0配置一样,只需修改起始地址,kernel的镜像位置指定为0xb0008000,ramdisk的起始地址指定为0x84000000,配置在qemu传参时要对应上。然后编译生成.dtb文件,作为设备树二进制文件传给xen启动使用。

运行 Qemu Xen DomU0 Linux和DomU1 Linux

qemu-system-aarch64 -machine vexpress-a15 -machine virtualization=true -cpu cortex-a15 -m 2048 -kernel u-boot -device loader,file=xen-uImage,force-raw=on,addr=0x80400000 -device loader,file=zImage,addr=0xa0008000 -device loader,file=vexpress-v2p-ca15_a7.dtb,addr=0x81f00000 -device loader,file=rootfs.img.gz,addr=0x82000000 -device loader,file=zImage,addr=0xb0008000 -device loader,file=rootfs.img.gz,addr=0x84000000 -nographic

U-Boot 2019.01 (Sep 14 2021 - 02:57:40 -0700)

DRAM:  1 GiB
WARNING: Caches not enabled
Flash: 128 MiB
MMC:   MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   smc911x-0
Hit any key to stop autoboot:  0 
=> bootm 0x80400000 - 0x81f00000

输入bootm 0x80400000 - 0x81f00000,启动xen,如下是启动输出流程。

## Booting kernel from Legacy Image at 80400000 ...
   Image Name:   
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1048584 Bytes = 1 MiB
   Load Address: 80200000
   Entry Point:  80200000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 81f00000
   Booting using the fdt blob at 0x81f00000
   Loading Kernel Image ... OK
   Loading Device Tree to 9fe61000, end 9fe68606 ... OK

Starting kernel ...

- UART enabled -
- Boot CPU booting -
- Setting up control registers -
- Turning on paging -
- Zero BSS -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000080000000 - 000000009fffffff
(XEN) RAM: 00000000a0000000 - 00000000bfffffff
(XEN) 
(XEN) MODULE[0]: 0000000080200000 - 000000008033e290 Xen         
(XEN) MODULE[1]: 000000009fe61000 - 000000009fe66000 Device Tree 
(XEN) MODULE[2]: 00000000a0008000 - 00000000a0a08000 Kernel      
(XEN) MODULE[3]: 0000000082000000 - 0000000082ffffff Ramdisk     
(XEN) MODULE[4]: 00000000b0008000 - 00000000b1007fff Kernel      
(XEN) MODULE[5]: 0000000084000000 - 0000000084ffffff Ramdisk     
(XEN)  RESVD[0]: 000000009ffbf000 - 000000009ffbf138
(XEN)  RESVD[1]: 000000009fe61000 - 000000009fe66000
(XEN) 
(XEN) CMDLINE[00000000b0008000]:domU1 rw root=/dev/ram rdinit=/sbin/init console=ttyAMA0
(XEN) 
(XEN) Command line: dom0_mem=768M console=dtuart dtuart=serial0 dom0_vcpus_pin hmp-unsafe=true dom0_max_vcpus=1 bootscrub=0 loglvl=all
(XEN) PFN compression on bits 18...18
(XEN) Xen heap: 00000000be000000-00000000c0000000 (8192 pages)
(XEN) Dom heap: 253952 pages
(XEN) Domain heap initialised
(XEN) Booting using Device Tree
(XEN) Platform: VERSATILE EXPRESS
(XEN) Looking for dtuart at "serial0", options ""
 Xen 4.16-unstable
(XEN) Xen version 4.16-unstable (hdwei@) (arm-linux-gnueabihf-gcc (Linaro GCC 6.5-2018.12) 6.5.0) debug=y Thu Apr  7 19:39:17 PDT 2022
(XEN) Latest ChangeSet: Thu Sep 9 17:34:39 2021 +0100 git:c76cfad-dirty
(XEN) build-id: 4830b94fe5739cf53a28a8c9222535f48d661f54
(XEN) Processor: 412fc0f1: "ARM Limited", variant: 0x2, part 0xc0f,rev 0x1
(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: 10201105 20000000
(XEN)                          01240000 02102211
(XEN)   ISA Features: 02101110 13112111 21232041
(XEN)                 11112131 10011142 00000000
(XEN) Set SYS_FLAGS to 00000000802000d4 (002000d4)
(XEN) SMP: Allowing 1 CPUs
(XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 62500 KHz
(XEN) GICv2 initialization:
(XEN)         gic_dist_addr=000000002c001000
(XEN)         gic_cpu_addr=000000002c002000
(XEN)         gic_hyp_addr=000000002c004000
(XEN)         gic_vcpu_addr=000000002c006000
(XEN)         gic_maintenance_irq=25
(XEN) GICv2: 160 lines, 1 cpu, secure (IID 00000000).
(XEN) XSM Framework v1.0.0 initialized
(XEN) Initialising XSM SILO mode
(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) Allocated console ring of 16 KiB.
(XEN) VFP implementer 0x41 architecture 4 part 0x30 variant 0xf rev 0x0
(XEN) CPU0: Guest atomics will try 1 times before pausing the domain
(XEN) Brought up 1 CPUs
(XEN) I/O virtualisation disabled
(XEN) P2M: 40-bit IPA
(XEN) P2M: 3 levels with order-1 root, VTCR 0x80003558
(XEN) Scheduling granularity: cpu, 1 CPU per sched-resource
(XEN) Adding cpu 0 to runqueue 0
(XEN)  First cpu on runqueue, activating
(XEN) alternatives: Patching with alt table 002d267c -> 002d276c
(XEN) CPU0 will execute ICIALLU on guest exit
(XEN) *** LOADING DOMAIN 0 ***
(XEN) Loading d0 kernel from boot module @ 00000000a0008000
(XEN) Loading ramdisk from boot module @ 0000000082000000
(XEN) Allocating 1:1 mappings totalling 768MB for dom0:
(XEN) BANK[0] 0x00000086000000-0x0000009e000000 (384MB)
(XEN) BANK[1] 0x000000a2000000-0x000000b0000000 (224MB)
(XEN) BANK[2] 0x000000b2000000-0x000000bc000000 (160MB)
(XEN) Grant table range: 0x00000080200000-0x00000080240000
(XEN) Allocating PPI 16 for event channel interrupt
(XEN) Loading zImage from 00000000a0008000 to 000000008da00000-000000008de22998
(XEN) Loading d0 initrd from 0000000082000000 to 0x000000008e200000-0x000000008f1fffff
(XEN) Loading d0 DTB to 0x000000008e000000-0x000000008e003eaa
(XEN) *** LOADING DOMU cpus=1 memory=20000KB ***
(XEN) Loading d1 kernel from boot module @ 00000000b0008000
(XEN) Loading ramdisk from boot module @ 0000000084000000
(XEN) Allocating mappings totalling 128MB for d1:
(XEN) d1 BANK[0] 0x00000040000000-0x00000048000000 (128MB)
(XEN) d1 BANK[1] 0x00000200000000-0x00000200000000 (0MB)
(XEN) Loading zImage from 00000000b0008000 to 0000000047a00000-0000000047e22998
(XEN) Loading d1 initrd from 0000000084000000 to 0x0000000046a00000-0x00000000479fffff
(XEN) Loading d1 DTB to 0x0000000046800000-0x00000000468004bb
(XEN) Initial low memory virq threshold set at 0x4000 pages.
(XEN) Std. Loglevel: All
(XEN) Guest Loglevel: All
(XEN) ***************************************************
(XEN) WARNING: HMP COMPUTING HAS BEEN ENABLED.
(XEN) It has implications on the security and stability of the system,
(XEN) unless the cpu affinity of all domains is specified.
(XEN) ***************************************************
(XEN) 3... 2... 1... 
(XEN) *** Serial input to DOM0 (type 'CTRL-a' three times to switch input)
(XEN) Freed 348kB init memory.
Booting Linux on physical CPU 0x0
Linux version 4.20.0 (hdwei@ubuntu) (gcc version 6.5.0 (Linaro GCC 6.5-2018.12)) #2 SMP Sun Sep 26 01:35:27 PDT 2021
CPU: ARMv7 Processor [412fc0f1] revision 1 (ARMv7), cr=10c5387d
CPU: div instructions available: patching division code
CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
OF: fdt: Machine model: V2P-CA15_CA7
OF: fdt: Ignoring memory range 0x86000000 - 0x88000000
earlycon: xenboot0 at I/O port 0x0 (options '')
printk: bootconsole [xenboot0] enabled
Memory policy: Data cache writealloc
Xen 4.16 support found
(XEN) d1v0: vGICD: unhandled word write 0xffffffff to ICACTIVER4
(XEN) d1v0: vGICD: unhandled word write 0xffffffff to ICACTIVER8
(XEN) d1v0: vGICD: unhandled word write 0xffffffff to ICACTIVER12
(XEN) d1v0: vGICD: unhandled word write 0xffffffff to ICACTIVER16
(XEN) d1v0: vGICD: unhandled word write 0xffffffff to ICACTIVER0
psci: probing for conduit method from DT.
psci: PSCIv1.1 detected in firmware.
psci: Using standard PSCI v0.2 function IDs
psci: Trusted OS migration not required
psci: SMC Calling Convention v1.1
random: get_random_bytes called from start_kernel+0x9c/0x464 with crng_init=0
percpu: Embedded 17 pages/cpu @(ptrval) s37772 r8192 d23668 u69632
Built 1 zonelists, mobility grouping on.  Total pages: 186752
Kernel command line: rw root=/dev/ram rdinit=/sbin/init earlyprintk=serial,ttyAMA0 console=hvc0 earlycon=xenboot
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 719648K/753664K available (7168K kernel code, 406K rwdata, 1456K rodata, 1024K init, 165K bss, 34016K reserved, 0K cma-reserved)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xb4800000 - 0xff800000   (1200 MB)
    lowmem  : 0x80000000 - 0xb4000000   ( 832 MB)
    modules : 0x7f000000 - 0x80000000   (  16 MB)
      .text : 0x(ptrval) - 0x(ptrval)   (8160 kB)
      .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
      .data : 0x(ptrval) - 0x(ptrval)   ( 407 kB)
       .bss : 0x(ptrval) - 0x(ptrval)   ( 166 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
rcu: Hierarchical RCU implementation.
rcu: 	RCU event tracing is enabled.
rcu: 	RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
(XEN) d0v0: vGICD: unhandled word write 0xffffffff to ICACTIVER4
(XEN) d0v0: vGICD: unhandled word write 0xffffffff to ICACTIVER8
(XEN) d0v0: vGICD: unhandled word write 0xffffffff to ICACTIVER12
(XEN) d0v0: vGICD: unhandled word write 0xffffffff to ICACTIVER16
(XEN) d0v0: vGICD: unhandled word write 0xffffffff to ICACTIVER0
sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
clocksource: arm,sp804: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275 ns
Failed to initialize '/smb@8000000/motherboard/iofpga@3,00000000/timer@120000': -22
arch_timer: cp15 timer(s) running at 62.50MHz (virt).
clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1cd42e208c, max_idle_ns: 881590405314 ns
sched_clock: 56 bits at 62MHz, resolution 16ns, wraps every 4398046511096ns
Switching to timer-based delay loop, resolution 16ns
Console: colour dummy device 80x30
printk: console [hvc0] enabled
printk: console [hvc0] enabled
printk: bootconsole [xenboot0] disabled
printk: bootconsole [xenboot0] disabled
Calibrating delay loop (skipped), value calculated using timer frequency.. 125.00 BogoMIPS (lpj=625000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
CPU0: Spectre v2: firmware did not set auxiliary control register IBE bit, system vulnerable
/cpus/cpu@0 missing clock-frequency property
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
xen:grant_table: Grant tables using version 1 layout
Grant table initialized
xen:events: Using FIFO-based ABI
Xen: initializing cpu0
Setting up static identity map for 0x88100000 - 0x88100060
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
smp: Brought up 1 node, 1 CPU
SMP: Total of 1 processors activated (125.00 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 4 part 30 variant f rev 0
(XEN) DOM1: Booting Linux on physical CPU 0x0
(XEN) DOM1: Linux version 4.20.0 (hdwei@ubuntu) (gcc version 6.5.0 (Linaro GCC 6.5-2018.12)) #2 SMP Sun Sep 26 01:35:27 PDT 2021
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: 2, 16384 bytes)
(XEN) DOM1: CPU: ARMv7 Processor [412fc0f1] revision 1 (ARMv7), cr=10c5387d
(XEN) DOM1: CPU: div instructions available: patching division code
(XEN) DOM1: CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
(XEN) DOM1: OF: fdt: Machine model: (null)
(XEN) DOM1: Memory policy: Data cache writealloc
(XEN) DOM1: psci: probing for conduit method from DT.
(XEN) DOM1: psci: PSCIv1.1 detected in firmware.
(XEN) DOM1: psci: Using standard PSCI v0.2 function IDs
(XEN) DOM1: psci: Trusted OS migration not required
(XEN) DOM1: psci: SMC Calling Convention v1.1
(XEN) DOM1: random: get_random_bytes called from start_kernel+0x9c/0x464 with crng_init=0
(XEN) DOM1: percpu: Embedded 17 pages/cpu @(ptrval) s37772 r8192 d23668 u69632
(XEN) DOM1: Built 1 zonelists, mobility grouping on.  Total pages: 32512
(XEN) DOM1: Kernel command line: rw root=/dev/ram rdinit=/sbin/init console=ttyAMA0
(XEN) DOM1: Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
(XEN) DOM1: Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
(XEN) DOM1: Memory: 102640K/131072K available (7168K kernel code, 406K rwdata, 1456K rodata, 1024K init, 165K bss, 28432K reserved, 0K cma
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at drivers/mfd/vexpress-sysreg.c:189 vexpress_sysreg_probe+0x19c/0x1d4
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.20.0 #2
Hardware name: ARM-Versatile Express
[<801113ec>] (unwind_backtrace) from [<8010d2b0>] (show_stack+0x10/0x14)
[<8010d2b0>] (show_stack) from [<806e8ad4>] (dump_stack+0x84/0x98)
[<806e8ad4>] (dump_stack) from [<80121360>] (__warn+0xf8/0x110)
[<80121360>] (__warn) from [<8012148c>] (warn_slowpath_null+0x40/0x48)
[<8012148c>] (warn_slowpath_null) from [<804c2790>] (vexpress_sysreg_probe+0x19c/0x1d4)
[<804c2790>] (vexpress_sysreg_probe) from [<8049ae1c>] (platform_drv_probe+0x48/0x9c)
[<8049ae1c>] (platform_drv_probe) from [<80498f8(XEN) DOM1: -reserved)
(XEN) DOM1: Virtual kernel memory layout:
(XEN) DOM1:     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
(XEN) DOM1:     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
(XEN) DOM1:     vmalloc : 0x88800000 - 0xff800000   (1904 MB)
(XEN) DOM1:     lowmem  : 0x80000000 - 0x88000000   ( 128 MB)
(XEN) DOM1:     modules : 0x7f000000 - 0x80000000   (  16 MB)
(XEN) DOM1:       .text : 0x(ptrval) - 0x(ptrval)   (8160 kB)
(XEN) DOM1:       .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
(XEN) DOM1:       .data : 0x(ptrval) - 0x(ptrval)   ( 407 kB)
(XEN) DOM1:        .bss : 0x(ptrval) - 0x(ptrval)   ( 166 kB)
c>] (really_probe+0x1cc/0x2b0)
[<80498f8c>] (really_probe) from [<804991d4>] (driver_probe_device+0x60/0x164)
[<804991d4>] (driver_probe_device) from [<804993b4>] (__driver_attach+0xdc/0xe0)
[<804993b4>] (__driver_attach) from [<804972d0>] (bus_for_each_dev+0x68/0xb4)
[<804972d0>] (bus_for_each_dev) from [<80498398>] (bus_add_driver+0x104/0x210)
[<80498398>] (bus_add_driver) from [<80499f3c>] (driver_register+0x78/0x10c)
[<80499f3c>] (driver_register) from [<80102e08>] (do_one_initcall+0x54/0x1fc)
[<80102e08>] (do_one_initcall) from [<80a010e0>] (kernel_init_freeable+0x28c/0x380)
[<80a010e0>] (kernel_init_freeable) from [<80700a70>] (kernel_init+0x8/0x10c)
[<80700a70>] (kernel_init) from [<801010e8>] (ret_from_fork+0x14/0x2c)
Exception stack(0xb34affb0 to 0xb34afff8)
ffa0:                                     00000000 00000000 00000000 00000000
ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
ffe0: 00000000 00000000 00000000 00000000 00000013 00000000
---[ end trace a5fd6d7f5d2396d7 ]---
vexpress-sysreg 1c010000.sysreg: DT HBI (249) is not matching hardware (237)!
(XEN) DOM1: SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
(XEN) DOM1: rcu: Hierarchical RCU implementation.
(XEN) DOM1: rcu: 	RCU event tracing is enabled.
(XEN) DOM1: rcu: 	RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
(XEN) DOM1: rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
(XEN) DOM1: rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
(XEN) DOM1: NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
(XEN) DOM1: arch_timer: cp15 timer(s) running at 62.50MHz (virt).
(XEN) DOM1: clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1cd42e208c, max_idle_ns: 881590405314 ns
(XEN) DOM1: sched_clock: 56 bits at 62MHz, resolution 16ns, wraps every 4398046511096ns
(XEN) DOM1: Switching to timer-based delay loop, resolution 16ns
(XEN) DOM1: Console: colour dummy device 80x30
(XEN) DOM1: Calibrating delay loop (skipped), value calculated using timer frequency.. 125.00 BogoMIPS (lpj=625000)
(XEN) DOM1: pid_max: default: 32768 minimum: 301
(XEN) DOM1: Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
(XEN) DOM1: Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
(XEN) DOM1: CPU: Testing write buffer coherency: ok
(XEN) DOM1: CPU0: Spectre v2: firmware did not set auxiliary control register IBE bit, system vulnerable
(XEN) DOM1: /cpus/cpu@0 missing clock-frequency property
(XEN) DOM1: CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
(XEN) DOM1: Setting up static identity map for 0x40100000 - 0x40100060
(XEN) DOM1: rcu: Hierarchical SRCU implementation.
(XEN) DOM1: smp: Bringing up secondary CPUs ...
(XEN) DOM1: smp: Brought up 1 node, 1 CPU
(XEN) DOM1: SMP: Total of 1 processors activated (125.00 BogoMIPS).
(XEN) DOM1: CPU: All CPU(s) started in SVC mode.
(XEN) DOM1: devtmpfs: initialized
(XEN) DOM1: VFP support v0.3: implementor 41 architecture 4 part 30 variant f rev 0
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
(XEN) DOM1: clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
(XEN) DOM1: futex hash table entries: 256 (order: 2, 16384 bytes)
(XEN) DOM1: NET: Registered protocol family 16
(XEN) DOM1: DMA: preallocated 256 KiB pool for atomic coherent allocations
(XEN) DOM1: cpuidle: using governor ladder
(XEN) DOM1: hw-breakpoint: Failed to enable monitor mode on CPU 0.
(XEN) DOM1: Serial: AMBA PL011 UART driver
(XEN) DOM1: 22000000.sbsa-uart: ttyAMA0 at MMIO 0x22000000 (irq = 19, base_baud = 0) is a SBSA
(XEN) DOM1: printk: console [ttyAMA0] enabled
(XEN) DOM1: SCSI subsystem initialized
(XEN) DOM1: usbcore: registered new interface driver usbfs
(XEN) DOM1: usbcore: registered new interface driver hub
(XEN) DOM1: usbcore: registered new device driver usb
(XEN) DOM1: Advanced Linux Sound Architecture Driver Initialized.
(XEN) DOM1: clocksource: Switched to clocksource arch_sys_counter
(XEN) DOM1: NET: Registered protocol family 2
(XEN) DOM1: tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes)
(XEN) DOM1: TCP established hash table entries: 1024 (order: 0, 4096 bytes)
(XEN) DOM1: TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
(XEN) DOM1: TCP: Hash tables configured (established 1024 bind 1024)
(XEN) DOM1: UDP hash table entries: 256 (order: 1, 8192 bytes)
(XEN) DOM1: UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
(XEN) DOM1: NET: Registered protocol family 1
(XEN) DOM1: RPC: Registered named UNIX socket transport module.
(XEN) DOM1: RPC: Registered udp transport module.
(XEN) DOM1: RPC: Registered tcp transport module.
(XEN) DOM1: RPC: Registered tcp NFSv4.1 backchannel transport module.
(XEN) DOM1: Trying to unpack rootfs image as initramfs...
xen:swiotlb_xen: Warning: only able to allocate 4 MB for software IO TLB
software IO TLB: mapped [mem 0xbac00000-0xbb000000] (4MB)
hw-breakpoint: Failed to enable monitor mode on CPU 0.
Serial: AMBA PL011 UART driver
1c0a0000.uart: ttyAMA1 at MMIO 0x1c0a0000 (irq = 30, base_baud = 0) is a PL011 rev1
1c0b0000.uart: ttyAMA2 at MMIO 0x1c0b0000 (irq = 31, base_baud = 0) is a PL011 rev1
1c0c0000.uart: ttyAMA3 at MMIO 0x1c0c0000 (irq = 32, base_baud = 0) is a PL011 rev1
OF: amba_device_add() failed (-19) for /smb@8000000/motherboard/iofpga@3,00000000/wdt@f0000
OF: amba_device_add() failed (-19) for /wdt@2a490000
OF: amba_device_add() failed (-19) for /memory-controller@2b0a0000
OF: amba_device_add() failed (-19) for /memory-controller@7ffd0000
OF: amba_device_add() failed (-19) for /dma@7ff00000
OF: amba_device_add() failed (-19) for /etb@20010000
OF: amba_device_add() failed (-19) for /tpiu@20030000
OF: amba_device_add() failed (-19) for /funnel@20040000
OF: amba_device_add() failed (-19) for /ptm@2201c000
xen:balloon: Initialising balloon driver
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource arch_sys_counter
NET: Registered protocol family 2
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes)
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
(XEN) DOM1: Freeing initrd memory: 16384K
(XEN) DOM1: workingset: timestamp_bits=30 max_order=15 bucket_order=0
(XEN) DOM1: squashfs: version 4.0 (2009/01/31) Phillip Lougher
(XEN) DOM1: jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
(XEN) DOM1: 9p: Installing v9fs 9p2000 file system support
(XEN) DOM1: io scheduler noop registered (default)
(XEN) DOM1: io scheduler mq-deadline registered
(XEN) DOM1: io scheduler kyber registered
(XEN) DOM1: brd: module loaded
(XEN) DOM1: libphy: Fixed MDIO Bus: probed
(XEN) DOM1: usbcore: registered new interface driver usb-storage
(XEN) DOM1: ledtrig-cpu: registered to indicate activity on CPUs
(XEN) DOM1: usbcore: registered new interface driver usbhid
(XEN) DOM1: usbhid: USB HID core driver
(XEN) DOM1: oprofile: no performance counters
(XEN) DOM1: oprofile: using timer interrupt.
(XEN) DOM1: NET: Registered protocol family 17
(XEN) DOM1: 9pnet: Installing 9P2000 support
(XEN) DOM1: Registering SWP/SWPB emulation handler
(XEN) DOM1: hctosys: unable to open rtc device (rtc0)
(XEN) DOM1: ALSA device list:
(XEN) DOM1:   No soundcards found.
Freeing initrd memory: 16384K
(XEN) DOM1: Freeing unused kernel memory: 1024K
(XEN) DOM1: Run /sbin/init as init process
failed to build OPP table
workingset: timestamp_bits=30 max_order=18 bucket_order=0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
9p: Installing v9fs 9p2000 file system support
(XEN) DOM1: mount: mounting tmpfs on /tmp failed: No such file or directory
io scheduler noop registered (default)
io scheduler mq-deadline registered
io scheduler kyber registered
clcd-pl11x 1c1f0000.clcd: PL111 designer 41 rev2 at 0x1c1f0000
clcd-pl11x 1c1f0000.clcd: clcd@1f0000 hardware, 640x480@59 display
Console: switching to colour frame buffer device 80x30
xen:xen_evtchn: Event-channel device installed
brd: module loaded
Invalid max_queues (4), will use default max: 1.
8000000.flash: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000
Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
8000000.flash: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000
Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
Concatenating MTD devices:
(0): "8000000.flash"
(1): "8000000.flash"
into device "8000000.flash"
libphy: Fixed MDIO Bus: probed
smsc911x 1a000000.ethernet: Linked as a consumer to regulator.1
libphy: smsc911x-mdio: probed
smsc911x 1a000000.ethernet eth0: MAC Address: 52:54:00:12:34:56
xen_netfront: Initialising Xen virtual ethernet driver
isp1760 1b000000.usb: bus width: 32, oc: digital
isp1760 1b000000.usb: NXP ISP1760 USB Host Controller
isp1760 1b000000.usb: new USB bus registered, assigned bus number 1
isp1760 1b000000.usb: Scratch test failed.
isp1760 1b000000.usb: can't setup: -19
isp1760 1b000000.usb: USB bus 1 deregistered
usbcore: registered new interface driver usb-storage
rtc-pl031 1c170000.rtc: registered as rtc0
mmci-pl18x 1c050000.mmci: Got CD GPIO
mmci-pl18x 1c050000.mmci: Got WP GPIO
mmci-pl18x 1c050000.mmci: Linked as a consumer to regulator.1
mmci-pl18x 1c050000.mmci: mmc0: PL181 manf 41 rev0 at 0x1c050000 irq 26,27 (pio)
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
input: AT Raw Set 2 keyboard as /devices/platform/smb@8000000/smb@8000000:motherboard/smb@8000000:motherboard:iofpga@3,00000000/1c060000.kmi/serio0/input/input0
aaci-pl041 1c040000.aaci: ARM AC'97 Interface PL041 rev0 at 0x1c040000, irq 25
aaci-pl041 1c040000.aaci: FIFO 512 entries
oprofile: no per(XEN) DOM1: ifconfig: SIOCSIFADDR: No such device
formance counters
oprofile: using timer interrupt.
NET: Registered protocol family 17
9pnet: Installing 9P2000 support
Registering SWP/SWPB emulation handler
rtc-pl031 1c170000.rtc: setting system clock to 2022-04-20 00:38:52 UTC (1650415132)
ALSA device list:
  #0: ARM AC'97 Interface PL041 rev0 at 0x1c040000, irq 25
(XEN) DOM1: 
Freeing unused kernel memory: 1024K
Run /sbin/init as init process
mount: mounting tmpfs on /tmp failed: No such file or directory
input: ImExPS/2 Generic Explorer Mouse as /devices/platform/smb@8000000/smb@8000000:motherboard/smb@8000000:motherboard:iofpga@3,00000000/1c070000.kmi/serio1/input/input2
Generic PHY 1a000000.ethernet-ffffffff:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=1a000000.ethernet-ffffffff:01, irq=POLL)
smsc911x 1a000000.ethernet eth0: SMSC911x/921x identified at 0xb51d0000, IRQ: 23

Please press Enter to activate this console.

输入Ctrl+a切换控制台,连续输入6次切换到DomU1:

Please press Enter to activate this console. 
[root@vexpress ]# (XEN) *** Serial input to DOM1 (type 'CTRL-a' three times to switch input)
(XEN) Please press Enter to activate this console. 
(XEN) 
(XEN) [root@vexpress ]# 

再次连续输入6次Ctrl+a切换到Xen:

(XEN) *** Serial input to Xen (type 'CTRL-a' three times to switch input)
(XEN) 'h' pressed -> showing installed handlers
(XEN)  key '%' (ascii '25') => trap to xendbg
(XEN)  key '*' (ascii '2a') => print all diagnostics
(XEN)  key '+' (ascii '2b') => increase log level threshold
(XEN)  key '-' (ascii '2d') => decrease log level threshold
(XEN)  key '0' (ascii '30') => dump Dom0 registers
(XEN)  key 'A' (ascii '41') => toggle alternative key handling
(XEN)  key 'G' (ascii '47') => toggle host/guest log level adjustment
(XEN)  key 'H' (ascii '48') => dump heap info
(XEN)  key 'R' (ascii '52') => reboot machine
(XEN)  key 'a' (ascii '61') => dump timer queues
(XEN)  key 'd' (ascii '64') => dump registers
(XEN)  key 'e' (ascii '65') => dump evtchn info
(XEN)  key 'g' (ascii '67') => print grant table usage
(XEN)  key 'h' (ascii '68') => show this message
(XEN)  key 'm' (ascii '6d') => memory info
(XEN)  key 'q' (ascii '71') => dump domain (and guest debug) info
(XEN)  key 'r' (ascii '72') => dump run queues
(XEN)  key 't' (ascii '74') => display multi-cpu clock info
(XEN)  key 'w' (ascii '77') => synchronously dump console ring buffer (dmesg)

再次连续输入6次Ctrl+a切换到DomU0:

(XEN) *** Serial input to DOM0 (type 'CTRL-a' three times to switch input)

[root@vexpress ]# 

         到此本章节的实验内容结束,可以实现xen启动两个虚拟机域DomU0和DomU1分别运行linux内核,同学们可以动起手来尝试一遍,如果使用ubuntu直接安装的qemu跑不起来的话,不妨编译更新版本的qemu来试试,本人使用的是qemu5.0版本。

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值