나는 사용하고있다ARM 기본 모델arm-v8 환경(TrustZone 및 KVM 필요)을 시뮬레이션하고 kvm 지원 Linux를 호스트 OS로 실행합니다. 커널 버전은 3.14.0입니다(저는 따랐습니다). 가상 개방형 시스템 가이드.
그러나 게스트 OS를 실행하려고 할 때 몇 가지 문제가 발생했습니다(kvm-tools 및 qemu-system-aarch64). 내가 만난 것은 다음과 같습니다.
모든 도구와 커널 소스는 위에서 언급한 가이드에서 가져온 것이며 사전 빌드된 바이너리를 사용합니다. 하지만 커널을 직접 컴파일했습니다.
KVM 도구:
- 나는 virtualopensystems 웹사이트 lkvm-static에 있는 사전 구축된 kvm 도구를 사용하고 있습니다.
- 게스트 커널을 부팅하면 다음 위치에서 멈춥니다.bootconsole [earlycon0] 비활성화됨. 인터넷 검색을 좀 해보았지만 많이 찾지 못했습니다. 어떤 사람들은 잘못된 장치 트리 때문일 수 있다고 말하지만 내 가이드에는 dtb 파일이 없습니다.
qemu-시스템-aarch64
- 또한 사전 빌드된 바이너리를 사용합니다.
- 게스트 커널을 부팅하면 다음과 같은 메시지가 나타날 때까지 "정상"으로 보입니다.
hwclock: can't open '/dev/misc/rtc': No such file or directory
modprobe: can't change directory to '3.14.0': No such file or directory
openvt: can't open '/dev/tty1': No such file or directory
- 전체 QEMU 로그는 이 질문의 끝에 있습니다.
한 가지 더 언급해야 할 점, .config
호스트 운영 체제의 파일은 원본 파일이 아닙니다. 원시 .config
파일에는 KVM 기능이 있지만 나에게 필요한 DMA 관련 기능에 대한 지원이 부족합니다.
.config
그래서 3.18-rc 커널에 있는 것으로 교체했습니다 . 물론, 그것들은 전혀 동일하지 않으며 실행할 때 일부 구성을 수동으로 결정해야 합니다 make
.저는 모두 기본값으로 설정했어요. 컴파일 후 TrustZone이 제대로 작동하고 /dev/kvm도 생성되지만 게스트 OS를 실행하려고 하면 위의 문제가 발생합니다.
누구든지 나에게 조언을 해줄 수 있습니까?
감사합니다.
양준
================================================= = =======
다음은 qemu를 사용할 때의 출력입니다.
root@FVP:/data/qemu-kvm ./qemu-system-aarch64 --enable-kvm --nographic --kernel
Image --drive if=none,file=disk_oe64.img,id=fs --device virtio-blk-device,drive=fs -m 512 -M virt --cpu host --append "earlyprintk conosole=ttyAMA0 mem=512M rootwait root=/dev/vda rw"
Initializing cgroup subsys cpu
Linux version 3.14.0 (hamayun@hamayun-laptop) (gcc version 4.8.1 (Ubuntu/Linaro4.8.1-10ubuntu7) ) #1 SMP PREEMPT Tue Apr 29 15:37:35 CEST 2014
CPU: AArch64 Processor [410fd000] revision 0
No earlyprintk arguments passed.
Memory limited to 512MB
psci: probing function IDs from device-tree
PERCPU: Embedded 11 pages/cpu @ffffffc01ffe7000 s16128 r8192 d20736 u45056
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129280
Kernel command line: earlyprintk conosole=ttyAMA0 mem=512M rootwait root=/dev/vda rw
PID hash table entries: 2048 (order: 2, 16384 bytes)
Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
Inode-cache hash table entries: 32768 (order: 6, 262144 bytes)
software IO TLB [mem 0x5b000000-0x5f000000] (64MB) mapped at [ffffffc01b000000-ffffffc01effffff]
Memory: 436272K/524288K available (4122K kernel code, 357K rwdata, 1748K rodata, 243K init, 284K bss, 88016K reserved)
Virtual kernel memory layout:
vmalloc : 0xffffff8000000000 - 0xffffffbbffff0000 (245759 MB)
vmemmap : 0xffffffbc00e00000 - 0xffffffbc01500000 ( 7 MB)
modules : 0xffffffbffc000000 - 0xffffffc000000000 ( 64 MB)
memory : 0xffffffc000000000 - 0xffffffc020000000 ( 512 MB)
.init : 0xffffffc00063d000 - 0xffffffc000679f00 ( 244 kB)
.text : 0xffffffc000080000 - 0xffffffc00063ca14 ( 5875 kB)
.data : 0xffffffc00067a000 - 0xffffffc0006d37d0 ( 358 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptible hierarchical RCU implementation.
RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
NR_IRQS:64 nr_irqs:64 0
Architected cp15 timer(s) running at 100.00MHz (virt).
sched_clock: 56 bits at 100MHz, resolution 10ns, wraps every 2748779069440ns
Calibrating delay loop (skipped), value calculated using timer frequency.. 200.00 BogoMIPS (lpj=1000000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes)
hw perfevents: enabled with arm/armv8-pmuv3 PMU driver, 1 counters available
Brought up 1 CPUs
SMP: Total of 1 processors activated.
devtmpfs: initialized
atomic64 test passed
regulator-dummy: no parameters
NET: Registered protocol family 16
vdso: 2 pages (1 code, 1 data) at base ffffffc000681000
hw-breakpoint: found 16 breakpoint and 16 watchpoint registers.
Serial: AMBA PL011 UART driver
9000000.pl011: ttyAMA0 at MMIO 0x9000000 (irq = 33, base_baud = 0) is a PL011 rev1
console [ttyAMA0] enabled
bio: create slab <bio-0> at 0
SCSI subsystem initialized
Switched to clocksource arch_sys_counter
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP: reno registered
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 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.
kvm [1]: HYP mode not available
futex hash table entries: 256 (order: 2, 16384 bytes)
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
nfs4filelayout_init: NFSv4 File Layout Driver Registering...
fuse init (API version 7.22)
9p: Installing v9fs 9p2000 file system support
msgmni has been set to 852
io scheduler noop registered
io scheduler cfq registered (default)
Serial: AMBA driver
blk-mq: CPU -> queue map
CPU 0 -> Queue 0
vda: unknown partition table
TCP: cubic registered
NET: Registered protocol family 17
9pnet: Installing 9P2000 support
Key type dns_resolver registered
regulator-dummy: disabling
kjournald starting. Commit interval 5 seconds
EXT3-fs (vda): using internal journal
EXT3-fs (vda): mounted filesystem with writeback data mode
VFS: Mounted root (ext3 filesystem) on device 254:0.
devtmpfs: mounted
Freeing unused kernel memory: 240K (ffffffc00063d000 - ffffffc000679000)
INIT: version 2.88 booting
Mounting local filesystems...
Starting udev
udevd[384]: starting version 182
Activating swap
Starting Bootlog daemon: bootlogd.
Initializing random number generator...
random: dd urandom read with 5 bits of entropy available
udev-cache: checking for /dev/shm/udev-regen... found.
Populating dev cache
Populating volatile Filesystems.
Checking for -/run/lock-.
Creating directory -/run/lock-.
Checking for -/var/volatile/log-.
Creating directory -/var/volatile/log-.
Checking for -/var/volatile/tmp-.
Creating directory -/var/volatile/tmp-.
Target already exists. Skipping.
Checking for -/var/lock-.
Creating link -/var/lock- pointing to -/run/lock-.
Checking for -/var/log-.
Creating link -/var/log- pointing to -/var/volatile/log-.
Checking for -/var/run-.
Creating link -/var/run- pointing to -/run-.
Checking for -/var/tmp-.
Creating link -/var/tmp- pointing to -/var/volatile/tmp-.
Checking for -/tmp-.
Creating link -/tmp- pointing to -/var/tmp-.
Checking for -/var/lock/subsys-.
Creating directory -/var/lock/subsys-
Checking for -/var/log/wtmp-.
Creating file -/var/log/wtmp-.
Checking for -/var/run/utmp-.
Creating file -/var/run/utmp-.
Checking for -/etc/resolv.conf-.
Creating link -/etc/resolv.conf- pointing to -/var/run/resolv.conf-.
Checking for -/var/run/resolv.conf-.
Creating file -/var/run/resolv.conf-.
Checking for -/var/log/boot-.
Creating file -/var/log/boot-.
Target already exists. Skipping.
Checking for -/var/run/sepermit-.
Creating directory -/var/run/sepermit-.
Checking for -/var/run/sshd-.
Creating directory -/var/run/sshd-.
Checking for -/var/log/lastlog-.
Creating file -/var/log/lastlog-.
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
System time was Thu Jan 1 00:00:06 UTC 1970.
Setting the System Clock using the Hardware Clock as reference...
hwclock: can't open '/dev/misc/rtc': No such file or directory
System Clock set. System local time is now Thu Jan 1 00:00:06 UTC 1970.
Thu Jun 18 11:03:04 UTC 2015
Saving the System Clock time to the Hardware Clock...
hwclock: can't open '/dev/misc/rtc': No such file or directory
Hardware Clock updated to Thu Jun 18 11:03:04 UTC 2015.
INIT: Entering runlevel: 5
Configuring network interfaces... ifconfig: SIOCGIFFLAGS: No such device
Starting OpenBSD Secure Shell server: sshd
generating ssh RSA key...
generating ssh ECDSA key...
generating ssh DSA key...
generating ssh ED25519 key...
done.
Starting rpcbind daemon...done.
starting statd: done
System time was Thu Jun 18 11:03:36 UTC 2015.
Setting the System Clock using the Hardware Clock as reference...
hwclock: can't open '/dev/misc/rtc': No such file or directory
System Clock set. System local time is now Thu Jun 18 11:03:36 UTC 2015.
modprobe: can't change directory to '3.14.0': No such file or directory
NFS daemon support not enabled in kernel
Starting syslogd/klogd: done
openvt: can't open '/dev/tty1': No such file or directory
Starting auto-serial-console: done
Stopping Bootlog daemon: bootlogd.
INIT: no more processes left in this runlevel
답변1
이 문제인 것으로 밝혀졌고 Image
커널을 다시 컴파일했는데 괜찮았습니다.
하지만 lkvm-tools에는 몇 가지 문제가 있어 초기화할 수 없습니다.I/W 제어대개.