LoginSignup
1
0

More than 5 years have passed since last update.

RyzenでBitVisor

Last updated at Posted at 2017-12-07

AMD Ryzenプロセッサで楽しくBitVisorにさわりましょう。

ビルドする

コア数が多いほど-jオプションによる並列makeがきいてきます。ビルドが速いと作業がはかどりますね。

a@best:/dev/shm/bitvisor-2.0$ for i in 1 2 3 4 5
> do time make -j > /dev/null 2>&1;make clean >/dev/null;done

real    0m5.941s
user    1m6.256s
sys     0m4.300s

real    0m5.896s
user    1m6.060s
sys     0m4.572s

real    0m5.901s
user    1m6.344s
sys     0m4.260s

real    0m5.939s
user    1m6.424s
sys     0m4.260s

real    0m5.747s
user    1m6.376s
sys     0m4.292s
a@best:/dev/shm/bitvisor-2.0$ 

動かす

普通に動きます。

a@best:~$ ./dbgsh
> log
Starting BitVisor...
Copyright (c) 2007, 2008 University of Tsukuba
All rights reserved.
ACPI DMAR not found.
FACS address 0xDB184C80 0xDB184C40
Module not found.
Processor 0 (BSP)
..................................................                                                  oooooooooooooooooooooooooooooooooooooooooooooooooo
Using SVM.
Processor 0 2994476640 Hz (Invariant TSC)
Loading drivers.
AES/AES-XTS Encryption Engine initialized (AES=openssl)
Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
Generic ATA/ATAPI para pass-through driver 0.4 registered
Generic AHCI para pass-through driver registered
Generic RAID para pass-through driver registered
Generic IEEE1394 para pass-through driver 0.1 registered
Broadcom NetXtreme Gigabit Ethernet Driver registered
VPN for Intel PRO/100 registered
Intel PRO/1000 driver registered
PCI device concealer registered
PCI device monitor registered
Generic EHCI para pass-through driver 0.9 registered
Generic EHCI para pass-through driver 0.9 registered
Generic UHCI para pass-through driver 1.0 registered
xHCI para pass-through driver 0.1 registered
Intel Corporation Ethernet Controller 10 Gigabit X540 Driver registered
PCI: finding devices...
PCI: 40 devices found
MCFG [0] 0000:00-3F (F8000000,4000000)
Starting a virtual machine.
Processor 1 (AP)
Processor 2 (AP)
Processor 3 (AP)
Processor 4 (AP)
Processor 5 (AP)
Processor 6 (AP)
Processor 7 (AP)
Processor 8 (AP)
Processor 9 (AP)
Processor 10 (AP)
Processor 11 (AP)
Processor 12 (AP)
Processor 13 (AP)
Processor 14 (AP)
Processor 15 (AP)
Processor 1 2994526080 Hz (Invariant TSC)
Processor 8 2994535200 Hz (Invariant TSC)
Processor 7 2994534720 Hz (Invariant TSC)
Processor 4 2994535200 Hz (Invariant TSC)
Processor 6 2994512640 Hz (Invariant TSC)
Processor 3 2994534240 Hz (Invariant TSC)
Processor 5 2994511200 Hz (Invariant TSC)
Processor 14 2994522720 Hz (Invariant TSC)
Processor 12 2994526560 Hz (Invariant TSC)
Processor 10 2994546240 Hz (Invariant TSC)
Processor 15 2994519840 Hz (Invariant TSC)
Processor 9 2994519840 Hz (Invariant TSC)
Processor 13 2994526560 Hz (Invariant TSC)
Processor 2 2994522720 Hz (Invariant TSC)
Processor 11 2994525120 Hz (Invariant TSC)
> exit

マザーボードにもよると思いますが、ここでは最初のooo...のところでしばらく引っかかりました。これを避けるにはmake configでACPI_DSDTを外しておきましょう。これは既知の問題で、Ryzenだけでなく、Athlon 5350を積んだ環境にも同様の事象が起きる環境があることがわかっています。

(以前のバージョンのBitVisorでは、1分や2分待っても先に進まない状態でしたが、バージョン2.0ではおよそ10秒前後で先に進みます。)

動くと書きましたが

たまにGNU/Linux起動時initramfsを読み込んだ後に、panicしているのか、リセットする場合があります。原因はわかっていません。

Unsafe Nested Virtualization

もちろんつかえます。

a@best:~$ ./dbgsh 
> exit 
a@best:~$ qemu-system-x86_64 -enable-kvm -m 1024 -nographic \
> -kernel /boot/vmlinuz-4.9.0-4-amd64 -initrd /boot/initrd.img-4.9.0-4-amd64 \
> -append 'console=ttyS0 quiet break'
Spawning shell within the initramfs


BusyBox v1.22.1 (Debian 1:1.22.0-19+b3) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs) dmesg|grep -i kvm
[    0.000000] Hypervisor detected: KVM
[    0.000000] kvm-clock: Using msrs 4b564d01 and 4b564d00
[    0.000000] kvm-clock: cpu 0, msr 0:3ee20001, primary cpu clock
[    0.000000] kvm-clock: using sched offset of 452661801 cycles
[    0.000000] clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns
[    0.000000] Booting paravirtualized kernel on KVM
[    0.000000] KVM setup async PF for cpu 0
[    0.000000] kvm-stealtime: cpu 0, msr 3ec0d980
[    0.259221] clocksource: Switched to clocksource kvm-clock
(initramfs) QEMU 2.8.1 monitor - type 'help' for more information
(qemu) q
a@best:~$ 

試した環境

  • マザーボード: ASUS PRIME B350M-A
  • プロセッサー: AMD Ryzen 7 1700 BOX (AM4/3.0/20M/C8/T16/65W) UA 1713SUT
  • メモリー: G.SKILL F4-2400C16D-16GFX (DDR4 PC4-19200 8GB 2枚組)
  • ビデオカード: 玄人志向 GF-GT710-E1GB/LP (GeForce GT710 1GB LP)
  • ハードディスクドライブ: Seagate Barracuda 7200.8 ST3250823AS
  • オペレーティングシステム: Debian GNU/Linux 9 amd64
  • カーネル起動オプション: nomodesetを追加
  • syscfg: kernel.dmesg_restrict=0, kernel.randomize_va_space=0
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0