Bug 1456273 - kvm disabled by bios on AMD Ryzen 7 1700
Summary: kvm disabled by bios on AMD Ryzen 7 1700
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: virt-manager
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Cole Robinson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-28 15:16 UTC by Jan Vlug
Modified: 2018-05-29 02:28 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-31 10:55:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jan Vlug 2017-05-28 15:16:41 UTC
KVM seems not to be enabled for Ryzen 7 AMD processor

When I try to create a virtual machine with GNOME boxes, I get this warning:
"Virtualization extensions are unavailable on your system
Check your BIOS to enable them"

I have a MSI B350 PC MATE motherboard with a AMD Ryzen 7 1700 processor.

I could not find an option in the BIOS to enable or disable the virtualization settings, so I assume they are enabled.

See also this bug 1445834

During boot I get this message:
dmesg | grep -i kvm
[   35.740901] kvm: disabled by bios

egrep '^flags.*(vmx|svm)' /proc/cpuinfo
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_l2 mwaitx hw_pstate vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic overflow_recov succor smca
(repeated for each core)

dmesg | grep -i amd
[    0.000000] RAMDISK: [mem 0x3d5b4000-0x3e921fff]
[    0.000000] ACPI: SSDT 0x00000000DD4E5FC0 0020E4 (v01 AMD    AmdTable 00000001 AMD  00000001)
[    0.000000] ACPI: SRAT 0x00000000DD4E80A8 000130 (v03 AMD    AmdTable 00000001 AMD  00000001)
[    0.000000] ACPI: CRAT 0x00000000DD4E81D8 000F50 (v01 AMD    AmdTable 00000001 AMD  00000001)
[    0.000000] ACPI: CDIT 0x00000000DD4E9128 000029 (v01 AMD    AmdTable 00000001 AMD  00000001)
[    0.000000] ACPI: SSDT 0x00000000DD4E9158 0017E1 (v01 AMD    AOD      00000001 INTL 20120913)
[    0.000000] ACPI: SSDT 0x00000000DD4EA9B8 000024 (v01 AMDFCH FCHZP    00001000 INTL 20120913)
[    0.000000] ACPI: IVRS 0x00000000DD4EAA28 0000D0 (v02                 00000001 AMD  00000000)
[    0.000000] ACPI: SSDT 0x00000000DD4EAC28 001664 (v01 AMD    CPMCMN   00000001 INTL 20120913)
[    0.332280] smpboot: CPU0: AMD Ryzen 7 1700 Eight-Core Processor (family: 0x17, model: 0x1, stepping: 0x1)
[    0.332322] Performance Events: Fam17h core perfctr, AMD PMU driver.
[    0.815130] AMD-Vi: IOMMU performance counters supported
[    0.816610] AMD-Vi: Found IOMMU at 0000:00:00.2 cap 0x40
[    0.816611] AMD-Vi: Extended features (0xf77ef22294ada):
[    0.816613] AMD-Vi: Interrupt remapping enabled
[    0.816613] AMD-Vi: virtual APIC enabled
[    0.816744] AMD-Vi: Lazy IO/TLB flushing enabled
[    0.817684] perf: AMD NB counters detected
[    0.817686] perf: AMD L2I counters detected
[    0.818204] perf: amd_iommu: Detected. (0 banks, 0 counters/bank)
[    0.851247] AMD-Vi: Event logged [
[   35.757019] EDAC amd64: DRAM ECC disabled.
[   35.757021] EDAC amd64: ECC disabled in the BIOS or no ECC capability, module will not load.
[   35.814500] EDAC amd64: DRAM ECC disabled.
[   35.814501] EDAC amd64: ECC disabled in the BIOS or no ECC capability, module will not load.

uname -a
Linux nyx 4.10.17-200.fc25.x86_64 #1 SMP Mon May 22 18:12:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Comment 1 Jan Vlug 2017-05-28 15:24:11 UTC
Some additional version info:
dnf list installed | grep virt
libgovirt.x86_64                       0.3.4-1.fc25                    @anaconda
libvirt-client.x86_64                  2.2.1-1.fc25                    @updates 
libvirt-daemon.x86_64                  2.2.1-1.fc25                    @updates 
libvirt-daemon-config-network.x86_64   2.2.1-1.fc25                    @updates 
libvirt-daemon-driver-interface.x86_64 2.2.1-1.fc25                    @updates 
libvirt-daemon-driver-network.x86_64   2.2.1-1.fc25                    @updates 
libvirt-daemon-driver-nodedev.x86_64   2.2.1-1.fc25                    @updates 
libvirt-daemon-driver-nwfilter.x86_64  2.2.1-1.fc25                    @updates 
libvirt-daemon-driver-qemu.x86_64      2.2.1-1.fc25                    @updates 
libvirt-daemon-driver-secret.x86_64    2.2.1-1.fc25                    @updates 
libvirt-daemon-driver-storage.x86_64   2.2.1-1.fc25                    @updates 
libvirt-daemon-kvm.x86_64              2.2.1-1.fc25                    @updates 
libvirt-gconfig.x86_64                 1.0.0-1.fc25                    @updates 
libvirt-glib.x86_64                    1.0.0-1.fc25                    @updates 
libvirt-gobject.x86_64                 1.0.0-1.fc25                    @updates 
libvirt-libs.x86_64                    2.2.1-1.fc25                    @updates 
libvirt-python.x86_64                  2.2.0-1.fc25                    @fedora  
virt-install.noarch                    1.4.1-2.fc25                    @updates 
virt-manager.noarch                    1.4.1-2.fc25                    @updates 
virt-manager-common.noarch             1.4.1-2.fc25                    @updates 
virt-viewer.x86_64                     5.0-1.fc25                      @updates

dnf list installed | grep kvm
libvirt-daemon-kvm.x86_64              2.2.1-1.fc25                    @updates 
qemu-kvm.x86_64                        2:2.7.1-6.fc25                  @updates

Comment 2 Jan Vlug 2017-05-28 20:48:32 UTC
If I execute:
# modprobe kvm-amd
I get:
modprobe: ERROR: could not insert 'kvm_amd': Operation not supported

And in the log:
kvm: disabled by bios

I looked in the BIOS, but could not find an option to enable or disable virtualization extensions, of course there is the risk that I overlooked the setting in the BIOS.

Comment 3 Jan Vlug 2017-05-28 21:32:36 UTC
Here the details of the problematic AMD-Vi Event:
[    0.839574] AMD-Vi: Event logged [
[    0.839576] INVALID_DEVICE_REQUEST device=00:00.0 address=0xfffffffdf8000000 flags=0x0a00]

Comment 4 Paolo Bonzini 2017-05-29 12:08:18 UTC
Sorry, this is a BIOS issue.  The "disabled by bios" message only comes up if the BIOS has set a specific bit in the processor's MSR_VM_CR model specific register.

It has nothing to do with bug 1445834.

However, before closing this bug, please report the output of running this as root:

modprobe msr
dd if=/dev/cpu/0/msr iflag=skip_bytes skip=$((0xc0010114)) bs=8 count=1

Comment 5 Jan Vlug 2017-05-30 11:03:23 UTC
1+0 records in
1+0 records out
8 bytes copied, 3.8182e-05 s, 210 kB/s

Comment 6 Jan Vlug 2017-05-30 11:09:25 UTC
Note that there is a special character in front of the output, that is not visible anymore here in Bugzilla. It is the U+0018 CANCEL control character:
https://unicode-table.com/en/0018/

Comment 7 Jan Vlug 2017-05-31 10:55:54 UTC
I got some feedback on the MSI forum:
https://forum-en.msi.com/index.php?topic=287179
The virtualization was indeed not enabled in the BIOS. After enabling it (see details in the MSI forum) KVM works fine, and I get these results:

# dmesg | grep -i kvm
[   15.843001] kvm: Nested Virtualization enabled
[   15.843008] kvm: Nested Paging enabled

# lsmod | grep amd
edac_mce_amd           28672  0
kvm_amd              2179072  0
kvm                   593920  1 kvm_amd

The CANCEL character does not show up anymore in:
# dd if=/dev/cpu/0/msr iflag=skip_bytes skip=$((0xc0010114)) bs=8 count=1
1+0 records in
1+0 records out

There is still this AMD-Vi Event logged:
[    0.845332] AMD-Vi: Event logged [
[    0.845334] INVALID_DEVICE_REQUEST device=00:00.0 address=0xfffffffdf8000000 flags=0x0a00]

I will close this bug, because KVM is working fine now.

Comment 8 Paolo Bonzini 2017-06-01 10:57:39 UTC
Thanks, 0x18 is SVMDIS+LOCK.  Because it's locked, KVM could not fix up the value of the MSR.


Note You need to log in before you can comment on or make changes to this bug.