Impossível inicializar um convidado kvm via qemu / kvm-tools

0

Estou usando o Modelo de Fundação ARM para imitar um braço v8 environment (Eu preciso tanto do TrustZone quanto do KVM), e eu executo um linux habilitado para kvm nele como o SO Host, a versão do kernel é 3.14.0 (eu clonei seguindo o guide on virtualopensystems .

No entanto, quando tento executar um sistema operacional convidado, encontrei alguns problemas ( kvm-tools e qemu-system-aarch64 ). Aqui está o que eu conheci:

Todas as ferramentas e o código fonte do kernel são do guia mencionado acima, e eu uso os binários pré-construídos. Mas eu mesmo compilei o kernel.

  1. Ferramentas do KVM:

    • Eu uso as ferramentas kvm pré-construídas encontradas no website de virtualopensystems, lkvm-static
    • Quando eu inicializo o kernel guest, ele fica pendurado em bootconsole [earlycon0] desativado . Eu fiz alguns trabalhos no Google, mas não achei muito. Alguns dizem que pode por causa do devicetree errado, mas eu não há nenhum arquivo dtb no guia.
  2. qemu-system-aarch64

    • Além disso, eu uso os binários pré-construídos
    • Quando eu inicializo o kernel guest, parece 'normal' até que ele forneça mensagens como as seguintes:
      • 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
    • O log completo do QEMU estaria no final desta questão.

Outra coisa precisa ser mencionada , o arquivo .config do sistema operacional host NÃO é o original. O arquivo .config original tem o recurso KVM, mas não tem suporte para funções relevantes para DMA, o que é necessário para meu próprio bem.

Então substituí-lo pelo .config no kernel do 3.18-rc. Claro, eles não são iguais, e quando eu executo make , eu tenho que decidir manualmente algumas configurações, eu decido todas elas como padrão . E depois da compilação, o recurso TrustZone é normal e o / dev / kvm também é gerado, mas quando tento executar um sistema operacional convidado, encontrei os problemas acima.

Alguém poderia me dar algumas sugestões?
Muito obrigado.
Tgn Yang

=============================================== ==========

Aqui está a saída ao usar o 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
    
por Tgn Yang 25.02.2016 / 17:19

1 resposta

0

Acontece que é a questão de Image , eu recompilo o kernel e então tudo bem.

Mas há alguns problemas com o lkvm-tools, ele não pôde inicializar o ioctl normalmente.

    
por 01.03.2016 / 17:27