2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

BitVisorAdvent Calendar 2020

Day 1

BitVisor は 2 ソケットマシンで動く?

Last updated at Posted at 2020-12-01

はじめに

今年も 12 月になり Advent Calendar の季節になりました。BitVisor Advent Calendar, 今年は完走できるか不安ですが(初日から遅刻しています) やっていければと思います。
というわけで、この記事は BitVisor Advent Calendar(https://qiita.com/advent-calendar/2020/bitvisor) 1 日目の記事になります。

この記事は、BitVisor が 2 ソケットマシン (Xeon Gold 6142 が 2 個) で動くか試してみたという内容です。

環境

CloudLab という研究目的で利用可能なクラウド(?) で Xeon Gold 6142 が 2 個載っているマシンを借りて試しました。
ちなみに、 CloudLab にはほかにも EPYC マシンや ARM マシンなども貸し出しているようです。

結論

(メモリの割り当てを増やせば)動きました。
2 ソケットマシンだと(後述のメモリ容量以外に)なにか問題があるかもと思ったのですがそんなことはありませんでした。

BitVisor のメモリ使用量について

以前の記事 でも言及されていますが、BitVisor は EPT の管理のために 1 コアあたり 4 MiB のメモリを確保します。一方、BitVisor は自身のために 128 MiB のメモリを確保します。今回のマシンは 16 コア x 2 threads x 2 sockets = 64 論理コアであり、 64 コア x 4 MiB = 256 MiB ということで完全に容量オーバーです。

確保するメモリの容量を変える

core/mm.c にある VMMSIZE_ALL というマクロの値が、 BitVisor が自身のために確保するメモリの容量です。なので、これを書き換えれば OK です。今回はこれを 1 GiB にしてみました。もうすこし減らしても動くかもしれませんが、今回は試していません。

結果

こんな感じです。

user@node0:~/bitvisor/tools/dbgsh$ ./dbgsh
> log
Starting BitVisor...
Copyright (c) 2007, 2008 University of Tsukuba
All rights reserved.
410913169408 bytes (391877 MiB) RAM available.
VMM will use 0x2C400000-0x6C400000 (1024 MiB).
ACPI DMAR found.
FACS address 0x6F1F0000
Module not found.
Processor 0 (BSP)
Processor 1 (AP)
Processor 9 (AP)
Processor 38 (AP)
Processor 4 (AP)
Processor 19 (AP)
Processor 15 (AP)
Processor 60 (AP)
Processor 40 (AP)
...Processor 13 (AP)
Processor 26 (AP)
Processor 54 (AP)
Processor 58 (AP)
Processor 14 (AP)
Processor 59 (AP)
Processor 62 (AP)
Processor 30 (AP)
Processor 29 (AP)
Processor 48 (AP)
Processor 44 (AP)
Processor 25 (AP)
Processor 28 (AP)
Processor 27 (AP)
Processor 21 (AP)
Processor 18 (AP)
Processor 43 (AP)
Processor 17 (AP)
Processor 41 (AP)
Processor 52 (AP)
Processor 56 (AP)
Processor 22 (AP)
.Processor 42 (AP)
Processor 63 (AP)
Processor 61 (AP)
Processor 47 (AP)
Processor 3 (AP)
Processor 46 (AP)
Processor 57 (AP)
Processor 51 (AP)
Processor 7 (AP)
Processor 35 (AP)
Processor 12 (AP)
Processor 50 (AP)
.Processor 24 (AP)
Processor 55 (AP)
Processor 37 (AP)
Processor 20 (AP)
Processor 32 (AP)
Processor 31 (AP)
Processor 2 (AP)
Processor 49 (AP)
Processor 34 (AP)
Processor 16 (AP)
Processor 36 (AP)
Processor 23 (AP)
Processor 6 (AP)
Processor 8 (AP)
Processor 5 (AP)
Processor 53 (AP)
Processor 39 (AP)
Processor 33 (AP)
.Processor 45 (AP)
Processor 11 (AP)
Processor 10 (AP)
............................................                                                  oUsing VMX.
ooooooooooooooooooooooooooooooooooooooooooooooooo
Processor 58 2594335776 Hz (Invariant TSC)
Processor 30 2594360640 Hz (Invariant TSC)
Processor 29 2594362560 Hz (Invariant TSC)
Processor 24 2594340320 Hz (Invariant TSC)
Processor 40 2594375072 Hz (Invariant TSC)
Processor 37 2594376992 Hz (Invariant TSC)
Processor 11 2594314656 Hz (Invariant TSC)
Processor 42 2594367200 Hz (Invariant TSC)
Processor 41 2594364640 Hz (Invariant TSC)
Processor 10 2594371200 Hz (Invariant TSC)
Processor 63 2594376512 Hz (Invariant TSC)
Processor 46 2594332192 Hz (Invariant TSC)
Processor 20 2594335232 Hz (Invariant TSC)
Processor 53 2594193152 Hz (Invariant TSC)
Processor 22 2594267520 Hz (Invariant TSC)
Processor 56 2594362048 Hz (Invariant TSC)
Processor 49 2594370912 Hz (Invariant TSC)
Processor 3 2594381440 Hz (Invariant TSC)
Processor 45 2594039520 Hz (Invariant TSC)
Processor 16 2594324256 Hz (Invariant TSC)
Processor 28 2594263488 Hz (Invariant TSC)
Processor 7 2594263520 Hz (Invariant TSC)
Processor 13 2594307776 Hz (Invariant TSC)
Processor 4 2594309728 Hz (Invariant TSC)
Processor 62 2594191264 Hz (Invariant TSC)
Processor 2 2594380352 Hz (Invariant TSC)
Processor 48 2594373760 Hz (Invariant TSC)
Processor 17 2594324096 Hz (Invariant TSC)
Processor 5 2594267296 Hz (Invariant TSC)
Processor 50 2594136320 Hz (Invariant TSC)
Processor 9 2594366048 Hz (Invariant TSC)
Processor 47 2594365568 Hz (Invariant TSC)
Processor 43 2594365504 Hz (Invariant TSC)
Processor 36 2594038912 Hz (Invariant TSC)
Processor 61 2594377696 Hz (Invariant TSC)
Processor 1 2594340352 Hz (Invariant TSC)
Processor 18 2594340992 Hz (Invariant TSC)
Processor 14 2594330176 Hz (Invariant TSC)
Processor 39 2594402656 Hz (Invariant TSC)
Processor 33 2594403360 Hz (Invariant TSC)
Processor 31 2594256896 Hz (Invariant TSC)
Processor 55 2594158528 Hz (Invariant TSC)
Processor 27 2594403296 Hz (Invariant TSC)
Processor 15 2594330208 Hz (Invariant TSC)
Processor 8 2594365536 Hz (Invariant TSC)
Processor 32 2594256288 Hz (Invariant TSC)
Processor 21 2594403136 Hz (Invariant TSC)
Processor 59 2594336448 Hz (Invariant TSC)
Processor 38 2594371168 Hz (Invariant TSC)
Processor 57 2594335936 Hz (Invariant TSC)
Processor 6 2594340448 Hz (Invariant TSC)
Processor 12 2594342336 Hz (Invariant TSC)
Processor 35 2594346720 Hz (Invariant TSC)
Processor 34 2594346688 Hz (Invariant TSC)
Processor 19 2594271904 Hz (Invariant TSC)
Processor 26 2594150688 Hz (Invariant TSC)
Processor 51 2594337120 Hz (Invariant TSC)
Processor 60 2594135616 Hz (Invariant TSC)
Processor 44 2594157248 Hz (Invariant TSC)
Processor 54 2594151360 Hz (Invariant TSC)
Processor 0 2594303872 Hz (Invariant TSC)
Processor 25 2594339776 Hz (Invariant TSC)
Processor 52 2594361632 Hz (Invariant TSC)
Processor 23 2594315264 Hz (Invariant TSC)
Loading drivers.
PCI device concealer registered
PCI device monitor registered
PCI: finding devices...
PCI: 311 devices found
MCFG [0] 0000:00-FF (80000000,10000000)
Starting a virtual machine.
Loading MBR.
user@node0:~/bitvisor/tools/dbgsh$
user@node0:~/bitvisor/tools/dbgsh$ lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              64
On-line CPU(s) list: 0-63
Thread(s) per core:  2
Core(s) per socket:  16
Socket(s):           2
NUMA node(s):        2
Vendor ID:           GenuineIntel
CPU family:          6
Model:               85
Model name:          Intel(R) Xeon(R) Gold 6142 CPU @ 2.60GHz
Stepping:            4
CPU MHz:             1670.740
BogoMIPS:            5200.00
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            1024K
L3 cache:            22528K
NUMA node0 CPU(s):   0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62
NUMA node1 CPU(s):   1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke md_clear flush_l1d

おわりに

CPU が 2 個載っているマシンでも難なく動いてよかったです。これで大きなマシンでも BitVisor を使えそうです。ただ、今回は dbgsh が動いていることしか確認していませんので、para-passthrough driver や virtio が動くか否かは未検証です。興味がある方はどなたか試してみて記事にして頂けると幸いです。

2
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?