[BitVisor-devel:114] BitVisor 2.0 released
Hideki EIRAKU
hdk @ igel.co.jp
2017年 12月 4日 (月) 19:44:29 JST
こんにちは。
BitVisor 2.0 のリリースをお知らせできることをうれしく思います。
http://sourceforge.net/projects/bitvisor/files/
BitVisor 2.0 と BitVisor 1.4 との違いは以下の通りです。
1. PCIデバイスドライバーの改良
PCIデバイスドライバーが大きく変更された。どのデバイスに対してどのドラ
イバーを使用するかを設定する方法、ドライバーの登録方法と、ドライバーか
らPCI configuration spaceをアクセスする方法が変更された。
各ドライバーはconfigを参照せず常に自身を登録する。
config.vmm.driver.pciに指定された文字列に基づいてどのドライバーを有効
化するかどうかが決定される。
config.vmm.driver.pciの指定は、以下の3項目を順に並べたものをひとかたま
りとして、ひとつのドライバーを指定し、複数のかたまりをandを挟んで連結
し、最後に,区切りでひとつの文字列に連結したものである。
DeviceSelection (0個以上)
SpecifyDriver (ひとつだけ)
DriverOptions (0個以上)
DeviceSelectionとして指定できる項目には、以下のものがある。=の右辺には
*や?記号を用いるワイルドカードと、ORを意味する|記号を使用できる。省略
するとdevice=DriverNameが指定されたとみなされる。複数指定するとすべて
を同時に満たすデバイスが選択される。
slot=%02x:%02x.%u (bus_no, device_no, func_no)
class=%04x (class_code >> 8)
id=%04x:%04x (vendor_id, device_id)
subsystem=%04x:%04x (sub_vendor_id, sub_device_id)
revision=%02x (revision_id)
rev=%02x (revision_id)
programming_interface=%02x (programming_interface)
if=%02x (programming_interface)
class_code=%06x (class_code)
header_type=%02x (header_type)
device=%s (device name)
number=%d (number)
SpecifyDriverは、driver=DriverNameの形式である。DriverNameには以下のよ
うなものが指定できる。
ahci
ata
bnx
conceal
ehci
ieee1394
ieee1394log
monitor
pro100
pro1000
raid
rtl8169
uhci
vga_intel
x540
DriverOptionsはドライバーによって異なるが、key=value形式で複数の指定も
可能である。
concealはデバイス隠蔽のための特殊なドライバーである。
config.vmm.driver.pci_concealの代わりに使用することができる。
device=concealではどのデバイスも選択されないため、DeviceSelectionで具
体的なデバイスを指定する。
monitorはデバイスに対するI/Oを記録しdbgsh経由で提供するデバッグ用ドラ
イバーである。device=monitorではどのデバイスも選択されないため、
DeviceSelectionで具体的なデバイスを指定する。また、どのI/Oを記録するか
をDriverOptionsで指定する。詳しくはdrivers/pci_monitor.cを参照されたい。
互換性のために従来のconfigは変換されるが、新たに追加されたドライバーを
使うにはconfig.vmm.driver.pciが必要となる。
詳しくはdrivers/pci_match.cおよびdrivers/pci_match_compat.cを参照され
たい。
ドライバーの登録方法が変更された。VMMにリンクされたドライバーは、
configを参照することなく、pci_register_driver()関数を呼び出す。struct
pci_driverが変更され、idおよびclassに代わり、上のDeviceSelectionと同様
の書式によるdeviceが必要である。また、driver_optionsは上の
DriverOptionsのために使用される。
PCI configuration spaceのアクセスに関して、レースコンディションや、
memory-mapped configurationが使えない場合の一部機能の問題を修正するた
め、関数を整理し、ロックを見直した。以下の関数は削除された:
- pci_read_config_data_port
- pci_write_config_data_port
- pci_read_config_data8
- pci_read_config_data16
- pci_read_config_data32
- pci_write_config_data8
- pci_write_config_data16
- pci_write_config_data32
代わりに以下の関数が追加された:
- pci_readwrite_config_pmio
- pci_read_config_pmio
- pci_write_config_pmio
- pci_config_read
- pci_config_write
この変更により、ドライバーは、ゲストOSの状況に関係なく、いつでもPCI
configuration spaceにアクセスできる。
2. ネットワーク機能の改良
ネットワークドライバーをVPNモジュールから切り離し、VPN以外の用途にも使
用できるようにするためのnetapiを導入した。ログ出力もドライバーごとの設
定ではなくnetapi経由で行われ、複数のネットワークデバイスへのログ出力が
可能となった。
また、TCP/IPスタック (lwIP)、UDP/IPのsyslogによるログ出力機能や、一部
のネットワークドライバーがvirtio-netデバイスをエミュレートする機能も追
加された。
設定にはネットワークドライバーに対するドライバーオプションが用いられる。
以下のオプションがある:
- net (すべてのネットワークドライバー): ネットワークの処理モジュールを
指定する。vpn, ip, ippass, pass、または、空文字列が指定可能。
- tty (bnx, pro1000, rtl8169): ログ出力に使用するかどうかを指定する。1
が指定されたデバイスからログが出力される。ログの出力先および出力プロ
トコルは、config.vmm.tty_mac_address, config.vmm.tty_syslog.enable,
config.vmm.tty_syslog.src_ipaddr, および、
config.vmm.tty_syslog.dst_ipaddrで指定する。
- virtio (bnx, pro1000): Virtio-netを使用するかどうかを指定する。1が指
定されると各デバイスがvirtio-netデバイスに化ける。netが空文字列また
はipの場合、ドライバーは隠蔽モードとなり、隠蔽モードに非対応の場合、
または、virtio=1の場合はOSの通信内容がすべて破棄される。netがそれ以
外の場合は準パススルーモードとなり、virtioが指定されていない場合、ま
たは、virtio=0の場合はVMMはNICの初期化を行わず、OSによるNICの初期化
により通信できるようになる。virtio=1の場合はVMMが起動直後にNICの初期
化を行い、OSはvirtio-netを使用して通信できる。bnxはvirtio-netを使用
しない準パススルーモードに対応していない。
TCP/IPスタックを使用するには、ひとつのネットワークドライバーにnet=ipま
たはnet=ippassを指定し、config.ip.use_dhcp, config.ip.ipaddr,
config.ip.netmaskおよびconfig.ip.gatewayを適切に設定する。
echo-server/clientのサンプルプログラムが含まれており、dbgshからechoctl
コマンドにより起動することができる。
3. UEFI対応の改良
UEFI環境用のパスワード認証対応ブートローダーboot/uefi-loader-loginを追
加した。これに伴い、boot/uefi-loaderも変更されたため、以前のバージョン
との互換性がなくなっている。
また、ファームウェアドライバーとの衝突を避けるため、ネットワークなどい
くつかのドライバーがデバイスを初期化する前に、ファームウェアドライバー
を切り離すようにした。
4. 新規ドライバー
- bnx: add a Broadcom NetXtreme GbE driver
- xhci: add xHCI driver
- add 10GbE X540 driver for tty
5. パフォーマンスとメモリ使用量の改善
- svm: share msrbmp with other vcpus
- svm, vt: share iobmp with other vcpus
- vt, svm: cache nested paging pointers
- vt: use CR0 and CR4 guest/host mask to decrease number of VM exits
- vt: control CR3-load/store exiting bit to decrease number of VM
exits
- svm, vt: use msrbmp to reduce number of VM exits
- svm, vt: make some MSRs be able to be pass-through
- vt, svm: use 2MiB pages in nested paging
- vt: make another 5 MSRs be able to be pass-through
- vt: use lazy switching MSRs for processes to improve performance
- vt: reduce overhead of switching registers for VM entry/exit
- asm: use setne instead of je/inc to improve performance
- core_io: reduce number of VM exits after unregistering pio handlers
- thread: add CONFIG_THREAD_1CPU that disables parallel thread
processing
6. バグfixと機能改善
ACPI
- acpi_dsdt: apply ObjectList removal in ACPI spec 6.1 Errata A
- acpi_dsdt: apply DefExternal update in ACPI spec 6.0
- acpi_dsdt: apply FieldElement update in ACPI spec 5.0
- acpi_dsdt: apply MethodInvocation update in ACPI spec 5.0
- acpi_dsdt: apply NamedObj update in ACPI spec 5.0 to the comment
- acpi_dsdt: add debug macros
- acpi_dsdt: ThinkPad L570 workaround
- acpi: add CONFIG_ACPI_IGNORE_ERROR for ignoring errors
- acpi: prevent dereferencing NULL pointers when MCFG or FACP is not
found
- acpi: put variable declaration in the correct position in case of
unchecked ACPI_DSDT.
Core
- cache: check whether SYSCFG MSR is writable
- cpuid_pass: conceal INVPCID instruction
- x2APIC support
- delete a function prototype of an undefined function in time.h
- assert: evaluate an argument even when CONFIG_ENABLE_ASSERT=0
- initfunc: sort by filename to fix the order of dbsp and pcpu
- gmm_access: make write_gphys_q work properly when crossing a page
boundary
- mm: fix race condition in mm_page_alloc()
AMD SVM
- svm: use nRIP or interpreter to support rdmsr/wrmsr with prefixes
that previously supported before changeset a47c448f1855
- svm: add unsafe_nested_virtualization support
Intel VT-x
- msr_pass: microcode update passthrough on Intel CPUs like on AMD
CPUs
- acpi: add CONFIG_DISABLE_VTD option to disable VT-d DMA-remapping
translation if enabled by firmware
- vt: fix NMI handling problems
- vt: enable RDTSCP
- vt: xsaves/xrstors support
- vt: show VM-instruction error number when VM entry failed
- vt: print VM-entry interruption fields in panic dump
- add message of printexitreason()
- vt_io: always enable iobmp like svm_io for simplification
Thread
- thread: add thread_pcpu_data containing thread-related data for each
pcpu
- thread: use ticketlock in schedule()
Debugging
- remove definition and configs of FWDBG
- add tty_ieee1394
- vt: add number of each exit reason to status
- tools/vmmstatus-gtk: fix a bug in timer_callback function
- ieee1394: remove an unused variable and a function that accesses the
variable
- tools: 64bit Windows support
- tools/log: newer Linux support
- tools/common/call_vmm: glibc version >= 2.19 support
- panic, tty: save panic log to RAM for next boot and reboot if
vmm.panic_reboot=1
- tty: increase UDP/IP TTL to 64
- ieee1394log: improve initialization
- tools/dbgsh-uefi: add dbgsh for UEFI Shell
- tools/dbgsh: allow building without MinGW
- tools/common/call_vmm: suppress a warning of glibc version >= 2.20
- tools/common/call_vmm: position-independent executable support
- tools/ieee1394log: add retry option
AHCI
- ahci: fix command timeout 1h11m36s after VMM starts
- ahci: modify PxCLB and PxCLBU after clearing PxCMD.ST to align with
AHCI specification
- ahci: modify PxFB and PxFBU while PxCMD.FRE=0 as described in spec
- ahci: wait for PxCMD.FR/CR to change properly when PxCMD.FRE/ST is
modified
- ahci: passthrough PxCMD register write before ahci_port_data_init
ATA
- ata: pass-through READ LOG DMA EXT command
Intel GbE
- vpn_pro1000: look at proper descriptors when receiving packets
- pro1000: do not initialize PHY
- pro1000: enable bus master and memory space before initialization
- pro1000: check range of head/tail register value to avoid accessing
incorrect address of memory
- pro1000: make an interrupt when intr_set() is called by virtio-net
implementation
- pro1000: abort receiving instead of panic if head/tail register
value is out of range
- pro1000: disable I/O space if option virtio=1 is specified
- pro1000: add 8086:15b7 I219-LM
- pro1000: add 8086:1570 I219-V
- pro1000: add 8086:15d8 I219-V
- pro1000: add 8086:15d7 I219-LM
USB
- usb: fix get_edesc_by_address() bug
- usb_mscd: handle URB_STATUS_ERRORS
- usb: introduce struct usb_init_dev_operations to prepare for xHCI
driver
Virtio-net
- pro1000: add virtio-net emulation
- bnx, virtio-net: add multifunction option for multifunction device
passthrough
- bnx: PCIe capabilities passthrough for virtio-net
- virtio-net: reset ISR status field to zero after read
- pro1000, virtio-net: add virtio-net MSI-X support
Idman
- idman: remove a macro definition with a very long string to avoid a
core dump of the "global" command
PCI Bridge
- pci: save PCI/PCIe bridge info and use initial bus number for
pci_match
- pci: PCI/PCIe bridge secondary bus number modification support
- pci: fix panic if a secondary bus number is changed to out of range
of MCFG
PCI Driver
- pci: mask BAR value properly and ignore size detection
- pci: ignore BAR address bit63=1
- pci: fix range check bug in pci_driver_option_get_int() function
- pci: do not conceal accesses to PCIe configuration space of
non-existent devices
- pci: call default_config_read/write from config handlers to save
BARs by default
- pci: add functions getting BAR information
- pci: dump PCI devices and drivers if CONFIG_DUMP_PCI_DEV_LIST=1
- pci: add pci_register_intr_callback() for external interrupt
notification
- pci: handle new device in MCFG (MMCONFIG) handler
- pci: use MCFG (MMCONFIG) if available in pci_new_device()
UEFI
- uefi: fix load error when loading a stripped binary
- calluefi: CR4.PGE=0 for a VM
- calluefi: 16-byte stack alignment
boot/loader
- boot/loader: allow to specify a compiler at command line
- boot/loader: support Mac
boot/uefi-loader
- boot/uefi-loader: allow to speficy a compiler at command line
- boot/uefi-loader: add stdint.h for C99-compliant compiler and add
-nostdinc
- boot/uefi-loader: print and return error if 32bit binary or error in
uefi_init
Compilation
- makefile: GNU Make 4.0 support
- add some C99 interger types to avoid a compile error
- Suppress the link time warnings
- makefile: auto-detect MinGW compilers
- process: change the name of the system call "restrict" to "setlimit"
- makefile: fix syntax errors
- edk: avoid using stdint.h
- tools/iccard: fix type of WinMain function
- fix linker error "PHDR segment not covered by LOAD segment"
- fix compiler errors if compiler is configured with
--enable-default-pie
- tools/log: GNU Make 4.0 load directive workaround
既知の問題
CONFIG_ACPI_DSDT=1の時、ACPIのDSDTまたはSSDTに含まれる内容によっては、
正常に起動しない。ASUS PRIME B350M-Aなどのマザーボードで構成されたPCに
おいてそのようなSSDTがあることがわかっている。
楽しんで下さい!
--
Hideki EIRAKU <hdk @ igel.co.jp>
BitVisor-devel メーリングリストの案内