Bug 1615682 - Guest should get 2 threads per core and all of them should be on-line when booting guest with old amd cpu model + topoext
Summary: Guest should get 2 threads per core and all of them should be on-line when bo...
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.6
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Eduardo Habkost
QA Contact: Yumei Huang
Jiri Herrmann
URL:
Whiteboard:
: 1619166 (view as bug list)
Depends On: 1723520
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-14 03:20 UTC by Guo, Zhiyi
Modified: 2019-07-22 20:30 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
.SMT works only on AMD EPYC CPU models Currently, only the *AMD EPYC* CPU models support the simultaneous multithreading (SMT) feature. As a consequence, manually enabling the *topoext* feature when configuring a virtual machine (VM) with a different CPU model causes the VM not to detect the vCPU topology correctly, and the vCPU does not perform as configured. To work around this problem, do not enable *topoext* manually and do not use the *threads* vCPU option on AMD hosts unless the host is using the *AMD EPYC* model
Clone Of:
Environment:
Last Closed: 2019-07-22 20:30:58 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Guo, Zhiyi 2018-08-14 03:20:28 UTC
Description of problem:
Guest should get 2 threads per core and all of them should be on-line when booting guest with old amd cpu model + smt

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.12.0-10.el7.x86_64
kernel-3.10.0-933.el7.x86_64(host & guest)

How reproducible:
100%

Steps to Reproduce:
1.Boot rhel7.6 guest with cli:
/usr/libexec/qemu-kvm -name rhel7.6 -m 16G -machine pc,accel=kvm \
        -S \
        -cpu Opteron_G3,+topoext,xlevel=0x8000001e,enforce \
        -smp 2,threads=2 \
        -monitor stdio \
        -qmp unix:/tmp/qmp2,server,nowait \
        -device VGA \
        -vnc :0 \
        -serial unix:/tmp/console2,server,nowait \
        -uuid 115e11b2-a869-41b5-91cd-6a32a907be7f \
        -drive file=rhel7.6-20180812.qcow2,if=none,id=drive-scsi-disk0,format=qcow2,cache=none,werror=stop,rerror=stop -device ide-hd,drive=drive-scsi-disk0,id=scsi-disk0 \
        -netdev tap,id=idinWyYY,vhost=on -device virtio-net-pci,mac=2e:39:fa:ff:88:a1,id=idlbq7eA,netdev=idinWyYY \

2.check cpu info inside guest
3.

Actual results:
Guest gets one online cpu, one offline cpu and one thread per core:
# lscpu
lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0
Off-line CPU(s) list:  1
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             AuthenticAMD
CPU family:            16
Model:                 2
Model name:            AMD Opteron 23xx (Gen 3 Class Opteron)
Stepping:              3
CPU MHz:               2096.060
BogoMIPS:              4192.12
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             64K
L1i cache:             64K
L2 cache:              512K
L3 cache:              16384K
NUMA node0 CPU(s):     0
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 art rep_good nopl extd_apicid pni cx16 x2apic popcnt hypervisor lahf_lm cmp_legacy abm sse4a misalignsse topoext retpoline_amd ibp_disable vmmcall


Expected results:
Guest should get 2 threads per core and all of them should be on-line

Additional info:

Comment 2 Guo, Zhiyi 2018-08-14 10:48:25 UTC
Looks like windows 2016 guest supports to enable smt on old cpu model.
Processor info inside windows 2016 is AMD Opteron 23xx(Gen 3 Class Opteron), 2096 Mhz, 1 Core(s), 2 Logical Processor(s)

Comment 5 Yumei Huang 2019-06-18 03:18:17 UTC
Tested with qemu-kvm-rhev-2.12.0-32.el7,  both of the 2 vcpus are online, but thread is 1.

qemu-kvm-rhev-2.12.0-32.el7
kernel-3.10.0-1055.el7.x86_64

QEMU cli: -cpu Opteron_G3,+topoext,xlevel=0x8000001e,enforce  -smp 2,threads=2  

Guest:
# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1                ----> thread is 1
Core(s) per socket:    2
Socket(s):             1
NUMA node(s):          1
Vendor ID:             AuthenticAMD
CPU family:            16
Model:                 2
Model name:            AMD Opteron 23xx (Gen 3 Class Opteron)
Stepping:              3
CPU MHz:               2300.026
BogoMIPS:              4600.05
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             64K
L1i cache:             64K
L2 cache:              512K
L3 cache:              16384K
NUMA node0 CPU(s):     0,1
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 art rep_good nopl extd_apicid pni cx16 x2apic popcnt hypervisor lahf_lm cmp_legacy abm sse4a misalignsse topoext retpoline_amd ibp_disable vmmcall

Comment 6 Yumei Huang 2019-06-18 04:34:45 UTC
RHEL8 has same issue as above.   

qemu-kvm-4.0.0-4.module+el8.1.0+3356+cda7f1ee
kernel-4.18.0-107.el8.x86_64

Comment 8 Eduardo Habkost 2019-06-24 17:20:47 UTC
*** Bug 1619166 has been marked as a duplicate of this bug. ***

Comment 9 Eduardo Habkost 2019-06-24 17:29:40 UTC
RHEL-AV-8 bug created: bug 1723520.


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