rr-debugger / rr

Record and Replay Framework
http://rr-project.org/
Other
9.19k stars 585 forks source link

Unsupported CPU: AMD CPU type 0xf60 unknown (from inside KVM) #2952

Closed NonLogicalDev closed 3 years ago

NonLogicalDev commented 3 years ago

Apologies for a weird question, I have been trying to run RR from within a VM (KVM). It seems like it works on the host, but does not work inside a VM, is this expected behavior?

$ rr record -n /bin/ls
[FATAL /home/roc/rr/rr/src/PerfCounters_x86.h:94:compute_cpu_microarch()] AMD CPU type 0xf60 unknown
rr --version
rr version 5.4.0
kvm config

/usr/bin/kvm

-id 101
-name mainframe
-no-shutdown
-chardev socket,id=qmp,path=/var/run/qemu-server/101.qmp,server,nowait
-mon chardev=qmp,mode=control
-chardev socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect=5
-mon chardev=qmp-event,mode=control
-pidfile /var/run/qemu-server/101.pid
-daemonize
-smbios type=1,uuid=19189df3-a61c-4c45-b508-fe1062c32a04
-smp 15,sockets=1,cores=15,maxcpus=15
-nodefaults
-boot menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg
-vnc unix:/var/run/qemu-server/101.vnc,password
-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep
-m 50000
-device pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e
-device pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f
-device vmgenid,guid=f92941fb-c0c5-401b-8e29-c3420b3a4a70
-device piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2
-device usb-tablet,id=tablet,bus=uhci.0,port=1
-device VGA,id=vga,bus=pci.0,addr=0x2
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
-iscsi initiator-name=iqn.1993-08.org.debian:01:ea2fb294272b
-drive file=/dev/pve-local/vm-101-cloudinit,if=none,id=drive-ide1,media=cdrom,aio=threads
-device ide-cd,bus=ide.0,unit=1,drive=drive-ide1,id=ide1
-device virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5
-drive file=/dev/pve-local/vm-101-disk-0,if=none,id=drive-scsi0,format=raw,cache=none,aio=native,detect-zeroes=on
-device scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100
-netdev type=tap,id=net0,ifname=tap101i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on
-device virtio-net-pci,mac=26:40:27:D5:2D:43,netdev=net0,bus=pci.0,addr=0x12,id=net0
-machine type=pc+pve0
lscpu (inside of KVM: guest)

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
Address sizes:       40 bits physical, 48 bits virtual
CPU(s):              15
On-line CPU(s) list: 0-14
Thread(s) per core:  1
Core(s) per socket:  15
Socket(s):           1
NUMA node(s):        1
Vendor ID:           AuthenticAMD
CPU family:          15
Model:               6
Model name:          Common KVM processor
Stepping:            1
CPU MHz:             2499.998
BogoMIPS:            4999.99
Hypervisor vendor:   KVM
Virtualization type: full
L1d cache:           64K
L1i cache:           64K
L2 cache:            512K
L3 cache:            16384K
NUMA node0 CPU(s):   0-14
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 lm rep_good nopl cpuid extd_apicid tsc_known_freq pni cx16 x2apic hypervisor cmp_legacy 3dnowprefetch vmmcall
lscpu (outside of KVM: host)

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
Address sizes:       48 bits physical, 48 bits virtual
CPU(s):              16
On-line CPU(s) list: 0-15
Thread(s) per core:  2
Core(s) per socket:  8
Socket(s):           1
NUMA node(s):        1
Vendor ID:           AuthenticAMD
CPU family:          23
Model:               1
Model name:          AMD EPYC 3251 8-Core Processor
Stepping:            2
CPU MHz:             2496.905
CPU max MHz:         2500.0000
CPU min MHz:         1200.0000
BogoMIPS:            4999.99
Virtualization:      AMD-V
L1d cache:           32K
L1i cache:           64K
L2 cache:            512K
L3 cache:            8192K
NUMA node0 CPU(s):   0-15
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 cpuid 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_llc mwaitx cpb hw_pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca
rocallahan commented 3 years ago

You probably need to configure KVM to use "Host passthrough" for the CPU.

NonLogicalDev commented 3 years ago

@rocallahan Thank you so much! That totally worked!

For anyone else if they stumble upon this, changing this:

-cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep

to:

-cpu host,+kvm_pv_eoi,+kvm_pv_unhalt

Fixes the issue, or if you run Proxmox setup, make sure to select the CPU type as host.