mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
bhyve: implement ignore unknown MSRs feature
Implement the MSRs ignore unknown reads and writes feature that's specified using: <features> ... <msrs unknown='ignore'> ... </features> in the domain XML. In bhyve, it's just passing '-w' command line argument to the bhyve(8) executable. Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
b71de701b8
commit
e9528f41c6
@ -2010,6 +2010,7 @@
|
||||
<tlbflush state='on'/>
|
||||
<ipi state='on'/>
|
||||
<evmcs state='on'/>
|
||||
<msrs unknown='ignore'/>
|
||||
</hyperv>
|
||||
<kvm>
|
||||
<hidden state='on'/>
|
||||
@ -2307,6 +2308,15 @@
|
||||
defined, the hypervisor default will be used.
|
||||
<span class="since">Since 4.10.0</span> (QEMU/KVM only)
|
||||
</dd>
|
||||
<dt><code>msrs</code></dt>
|
||||
<dd>Some guests might require ignoring unknown
|
||||
Model Specific Registers (MSRs) reads and writes. It's possible
|
||||
to switch this by setting <code>unknown</code> attribute
|
||||
of <code>msrs</code> to <code>ignore</code>. If the attribute is
|
||||
not defined, or set to <code>fault</code>, unknown reads and writes
|
||||
will not be ignored.
|
||||
<span class="since">Since 5.1.0</span> (bhyve only)
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h3><a id="elementsTime">Time keeping</a></h3>
|
||||
|
@ -506,6 +506,10 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn,
|
||||
virCommandAddArg(cmd, "-A"); /* Create an ACPI table */
|
||||
if (def->features[VIR_DOMAIN_FEATURE_APIC] == VIR_TRISTATE_SWITCH_ON)
|
||||
virCommandAddArg(cmd, "-I"); /* Present ioapic to the guest */
|
||||
if (def->features[VIR_DOMAIN_FEATURE_MSRS] == VIR_TRISTATE_SWITCH_ON) {
|
||||
if (def->msrs_features[VIR_DOMAIN_MSRS_UNKNOWN] == VIR_DOMAIN_MSRS_UNKNOWN_IGNORE)
|
||||
virCommandAddArg(cmd, "-w");
|
||||
}
|
||||
|
||||
switch (def->clock.offset) {
|
||||
case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME:
|
||||
|
10
tests/bhyvexml2argvdata/bhyvexml2argv-msrs.args
Normal file
10
tests/bhyvexml2argvdata/bhyvexml2argv-msrs.args
Normal file
@ -0,0 +1,10 @@
|
||||
/usr/sbin/bhyve \
|
||||
-c 1 \
|
||||
-m 214 \
|
||||
-w \
|
||||
-u \
|
||||
-H \
|
||||
-P \
|
||||
-s 0:0,hostbridge \
|
||||
-s 2:0,ahci,hd:/tmp/freebsd.img \
|
||||
-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 bhyve
|
3
tests/bhyvexml2argvdata/bhyvexml2argv-msrs.ldargs
Normal file
3
tests/bhyvexml2argvdata/bhyvexml2argv-msrs.ldargs
Normal file
@ -0,0 +1,3 @@
|
||||
/usr/sbin/bhyveload \
|
||||
-m 214 \
|
||||
-d /tmp/freebsd.img bhyve
|
26
tests/bhyvexml2argvdata/bhyvexml2argv-msrs.xml
Normal file
26
tests/bhyvexml2argvdata/bhyvexml2argv-msrs.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<domain type='bhyve'>
|
||||
<name>bhyve</name>
|
||||
<uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
|
||||
<memory>219136</memory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type>hvm</type>
|
||||
</os>
|
||||
<features>
|
||||
<msrs unknown='ignore'/>
|
||||
</features>
|
||||
<devices>
|
||||
<disk type='file'>
|
||||
<driver name='file' type='raw'/>
|
||||
<source file='/tmp/freebsd.img'/>
|
||||
<target dev='hda' bus='sata'/>
|
||||
<address type='drive' controller='0' bus='0' target='2' unit='0'/>
|
||||
</disk>
|
||||
<interface type='bridge'>
|
||||
<mac address='52:54:00:b9:94:02'/>
|
||||
<model type='virtio'/>
|
||||
<source bridge="virbr0"/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
||||
</interface>
|
||||
</devices>
|
||||
</domain>
|
@ -211,6 +211,7 @@ mymain(void)
|
||||
DO_TEST("cputopology");
|
||||
DO_TEST_FAILURE("cputopology-nvcpu-mismatch");
|
||||
DO_TEST("commandline");
|
||||
DO_TEST("msrs");
|
||||
|
||||
/* Address allocation tests */
|
||||
DO_TEST("addr-single-sata-disk");
|
||||
|
36
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-msrs.xml
Normal file
36
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-msrs.xml
Normal file
@ -0,0 +1,36 @@
|
||||
<domain type='bhyve'>
|
||||
<name>bhyve</name>
|
||||
<uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
|
||||
<memory unit='KiB'>219136</memory>
|
||||
<currentMemory unit='KiB'>219136</currentMemory>
|
||||
<vcpu placement='static'>1</vcpu>
|
||||
<os>
|
||||
<type arch='x86_64'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<features>
|
||||
<msrs unknown='ignore'/>
|
||||
</features>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<disk type='file' device='disk'>
|
||||
<driver name='file' type='raw'/>
|
||||
<source file='/tmp/freebsd.img'/>
|
||||
<target dev='hda' bus='sata'/>
|
||||
<address type='drive' controller='0' bus='0' target='2' unit='0'/>
|
||||
</disk>
|
||||
<controller type='pci' index='0' model='pci-root'/>
|
||||
<controller type='sata' index='0'>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
||||
</controller>
|
||||
<interface type='bridge'>
|
||||
<mac address='52:54:00:b9:94:02'/>
|
||||
<source bridge='virbr0'/>
|
||||
<model type='virtio'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
||||
</interface>
|
||||
</devices>
|
||||
</domain>
|
@ -111,6 +111,7 @@ mymain(void)
|
||||
DO_TEST_DIFFERENT("vnc-vgaconf-io");
|
||||
DO_TEST_DIFFERENT("vnc-autoport");
|
||||
DO_TEST_DIFFERENT("commandline");
|
||||
DO_TEST_DIFFERENT("msrs");
|
||||
|
||||
/* Address allocation tests */
|
||||
DO_TEST_DIFFERENT("addr-single-sata-disk");
|
||||
|
Loading…
Reference in New Issue
Block a user