RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1481252 - Add support for AMD EPYC processors
Summary: Add support for AMD EPYC processors
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Luyao Huang
URL:
Whiteboard:
Depends On: 1445834 1524824
Blocks: 1445836 1450396
TreeView+ depends on / blocked
 
Reported: 2017-08-14 12:47 UTC by Eduardo Habkost
Modified: 2018-04-10 10:56 UTC (History)
22 users (show)

Fixed In Version: libvirt-3.8.0-1.el7
Doc Type: Enhancement
Doc Text:
Clone Of: 1445834
Environment:
Last Closed: 2018-04-10 10:55:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0704 0 None None None 2018-04-10 10:56:40 UTC

Comment 2 Jiri Denemark 2017-09-06 12:13:22 UTC
Patches sent upstream for review: https://www.redhat.com/archives/libvir-list/2017-September/msg00111.html

Comment 3 Jiri Denemark 2017-09-07 12:07:18 UTC
Added upstream by

commit 92bd87a2395c8e350aa2d5694d4b8e95ce7349b0
Refs: v3.7.0-30-g92bd87a239
Author:     Jiri Denemark <jdenemar>
AuthorDate: Fri Apr 28 14:09:45 2017 +0200
Commit:     Jiri Denemark <jdenemar>
CommitDate: Thu Sep 7 13:53:32 2017 +0200

    tests: Add CPUID data for AMD Ryzen 7 1800X Eight-Core Processor

    Signed-off-by: Jiri Denemark <jdenemar>
    Reviewed-by: Pavel Hrdina <phrdina>

commit 5c83b3603cc01c29af3c21d6beec549c3c0f9a1e
Refs: v3.7.0-31-g5c83b3603c
Author:     Jiri Denemark <jdenemar>
AuthorDate: Thu Sep 7 12:58:41 2017 +0200
Commit:     Jiri Denemark <jdenemar>
CommitDate: Thu Sep 7 13:53:32 2017 +0200

    tests: Add CPUID data for AMD EPYC 7601 32-Core Processor

    Signed-off-by: Jiri Denemark <jdenemar>
    Reviewed-by: Pavel Hrdina <phrdina>

commit a0b628432a11ec97bbda9893504fb8180c36186e
Refs: [fixes], v3.7.0-32-ga0b628432a
Author:     Brijesh Singh <brijesh.singh>
AuthorDate: Wed Aug 23 13:49:41 2017 -0500
Commit:     Jiri Denemark <jdenemar>
CommitDate: Thu Sep 7 13:53:32 2017 +0200

    cpu: Add new EPYC CPU model

    Add a new CPU model called 'EPYC' to model processors from AMD EPYC
    family (which includes EPYC 76xx,75xx,74xx, 73xx and 72xx).

    The following features bits have been added/removed compare to Opteron_G5

    Added: monitor, movbe, rdrand, mmxext, ffxsr, rdtscp, cr8legacy, osvw,
           fsgsbase, bmi1, avx2, smep, bmi2, rdseed, adx, smap, clfshopt, sha
           xsaveopt, xsavec, xgetbv1, arat

    Removed: xop, fma4, tbm

    The patch is depend on EPYC CPU model supported introduced in qemu [1]

    [1] https://patchwork.kernel.org/patch/9902205/

    Cc: Tom Lendacky <Thomas.Lendacky>
    Signed-off-by: Brijesh Singh <brijesh.singh>
    Signed-off-by: Jiri Denemark <jdenemar>
    Reviewed-by: Pavel Hrdina <phrdina>

Comment 4 Xuesong Zhang 2017-09-22 08:50:20 UTC
Update the summary per following qemu-kvm-rhev comment:
https://bugzilla.redhat.com/show_bug.cgi?id=1445834#c13

Comment 6 Luyao Huang 2017-12-05 03:30:24 UTC
Test with libvirt-3.9.0-4.el7.x86_64:

1. prepare a EPYC cpu host:

# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                128
On-line CPU(s) list:   0-127
Thread(s) per core:    2
Core(s) per socket:    32
Socket(s):             2
NUMA node(s):          8
Vendor ID:             AuthenticAMD
CPU family:            23
Model:                 1
Model name:            AMD EPYC 7601 32-Core Processor
Stepping:              2
CPU MHz:               2200.000
CPU max MHz:           2200.0000
CPU min MHz:           1200.0000
BogoMIPS:              4391.45
Virtualization:        AMD-V
L1d cache:             32K
L1i cache:             64K
L2 cache:              512K
L3 cache:              8192K
NUMA node0 CPU(s):     0-7,64-71
NUMA node1 CPU(s):     8-15,72-79
NUMA node2 CPU(s):     16-23,80-87
NUMA node3 CPU(s):     24-31,88-95
NUMA node4 CPU(s):     32-39,96-103
NUMA node5 CPU(s):     40-47,104-111
NUMA node6 CPU(s):     48-55,112-119
NUMA node7 CPU(s):     56-63,120-127
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 art rep_good nopl nonstop_tsc extd_apicid amd_dcm aperfmperf eagerfpu 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 cpb hw_pstate vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic overflow_recov succor smca

2. check the libvirt host caps:

virsh # capabilities 
<capabilities>

  <host>
    <uuid>03000200-0400-0500-0006-000700080009</uuid>
    <cpu>
      <arch>x86_64</arch>
      <model>EPYC</model>
      <vendor>AMD</vendor>
      <topology sockets='1' cores='8' threads='2'/>
      <feature name='ht'/>
      <feature name='osxsave'/>
      <feature name='xsaves'/>
      <feature name='cmp_legacy'/>
      <feature name='extapic'/>
      <feature name='skinit'/>
      <feature name='wdt'/>
      <feature name='tce'/>
      <feature name='topoext'/>
      <feature name='perfctr_core'/>
      <feature name='perfctr_nb'/>
      <feature name='invtsc'/>
      <pages unit='KiB' size='4'/>
      <pages unit='KiB' size='2048'/>
      <pages unit='KiB' size='1048576'/>
    </cpu>

3. check domain caps:

    <mode name='host-model' supported='yes'>
      <model fallback='forbid'>EPYC</model>
      <vendor>AMD</vendor>
      <feature policy='require' name='x2apic'/>
      <feature policy='require' name='tsc-deadline'/>
      <feature policy='require' name='hypervisor'/>
      <feature policy='require' name='tsc_adjust'/>
      <feature policy='require' name='cmp_legacy'/>
      <feature policy='require' name='invtsc'/>
      <feature policy='disable' name='monitor'/>
      <feature policy='disable' name='svm'/>
    </mode>
    <mode name='custom' supported='yes'>
      <model usable='yes'>qemu64</model>
      <model usable='yes'>qemu32</model>
      <model usable='no'>phenom</model>
      <model usable='yes'>pentium3</model>
      <model usable='yes'>pentium2</model>
      <model usable='yes'>pentium</model>
      <model usable='no'>n270</model>
      <model usable='yes'>kvm64</model>
      <model usable='yes'>kvm32</model>
      <model usable='yes'>cpu64-rhel6</model>
      <model usable='no'>coreduo</model>
      <model usable='no'>core2duo</model>
      <model usable='no'>athlon</model>
      <model usable='yes'>Westmere</model>
      <model usable='no'>Skylake-Server</model>
      <model usable='no'>Skylake-Client</model>
      <model usable='yes'>SandyBridge</model>
      <model usable='yes'>Penryn</model>
      <model usable='no'>Opteron_G5</model>
      <model usable='no'>Opteron_G4</model>
      <model usable='yes'>Opteron_G3</model>
      <model usable='yes'>Opteron_G2</model>
      <model usable='yes'>Opteron_G1</model>
      <model usable='yes'>Nehalem</model>
      <model usable='no'>IvyBridge</model>
      <model usable='no'>Haswell</model>
      <model usable='no'>Haswell-noTSX</model>
      <model usable='yes'>EPYC</model>
      <model usable='yes'>Conroe</model>
      <model usable='no'>Broadwell</model>
      <model usable='no'>Broadwell-noTSX</model>
      <model usable='yes'>486</model>
    </mode>

4. start a guest with host-model cpu and check guest active xml:

# virsh dumpxml r7
  <cpu mode='custom' match='exact' check='full'>
    <model fallback='forbid'>EPYC</model>
    <vendor>AMD</vendor>
    <feature policy='require' name='x2apic'/>
    <feature policy='require' name='tsc-deadline'/>
    <feature policy='require' name='hypervisor'/>
    <feature policy='require' name='tsc_adjust'/>
    <feature policy='require' name='cmp_legacy'/>
    <feature policy='disable' name='monitor'/>
    <feature policy='disable' name='svm'/>
    <numa>
      <cell id='0' cpus='0-4' memory='524288' unit='KiB'/>
      <cell id='1' cpus='5-9' memory='524288' unit='KiB'/>
    </numa>
  </cpu>

5. login guest and check cpu:

# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                5
On-line CPU(s) list:   0-4
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             5
NUMA node(s):          2
Vendor ID:             AuthenticAMD
CPU family:            23
Model:                 1
Model name:            AMD EPYC Processor
Stepping:              2
CPU MHz:               2195.872
BogoMIPS:              4391.74
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             64K
L1i cache:             64K
L2 cache:              512K
NUMA node0 CPU(s):     0-4
NUMA node1 CPU(s):     
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm art rep_good nopl extd_apicid eagerfpu pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw fsgsbase tsc_adjust bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 arat

5. try to use EPYC cpu model on a host which cpu is Opteron_G5:

# virsh start r7-mig
error: Failed to start domain r7-mig
error: the CPU is incompatible with host CPU: Host CPU does not provide required features: movbe, rdrand, fsgsbase, avx2, smep, bmi2, rdseed, adx, smap, clflushopt, sha-ni, xsaveopt, xsavec, xgetbv1

Comment 7 Luyao Huang 2017-12-05 06:30:42 UTC
And i found there is a compatibility problem when update libvirt from 7.3 to 7.5 on host which use EPYC cpu:

1. prepare a EPYC host:

# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                128
On-line CPU(s) list:   0-127
Thread(s) per core:    2
Core(s) per socket:    32
Socket(s):             2
NUMA node(s):          8
Vendor ID:             AuthenticAMD
CPU family:            23
Model:                 1
Model name:            AMD EPYC 7601 32-Core Processor

2. install 7.3 libvirt and qemu:

3. start a guest which use host-model:

# virsh dumpxml r7-mig
...
  <cpu mode='host-model'>
    <model fallback='allow'/>
...

# virsh start r7-mig
Domain r7-mig started

4. recheck xml:
# virsh dumpxml r7-mig
...
  <cpu mode='host-model'>
    <model fallback='allow'/>
    <numa>
      <cell id='0' cpus='0-4' memory='524288' unit='KiB'/>
      <cell id='1' cpus='5-9' memory='524288' unit='KiB'/>
    </numa>
  </cpu>


# virsh dumpxml r7-mig --migratable
...
  <cpu mode='host-model' match='exact'>
    <model fallback='allow'>Opteron_G3</model>
    <vendor>AMD</vendor>
    <feature policy='require' name='vme'/>
    <feature policy='require' name='ht'/>
    <feature policy='require' name='pclmuldq'/>
    <feature policy='require' name='ssse3'/>
    <feature policy='require' name='fma'/>
    <feature policy='require' name='sse4.1'/>
    <feature policy='require' name='sse4.2'/>
    <feature policy='require' name='movbe'/>
    <feature policy='require' name='aes'/>
    <feature policy='require' name='xsave'/>
    <feature policy='require' name='osxsave'/>
    <feature policy='require' name='avx'/>
    <feature policy='require' name='f16c'/>
    <feature policy='require' name='rdrand'/>
    <feature policy='require' name='arat'/>
    <feature policy='require' name='fsgsbase'/>
    <feature policy='require' name='bmi1'/>
    <feature policy='require' name='avx2'/>
    <feature policy='require' name='smep'/>
    <feature policy='require' name='bmi2'/>
    <feature policy='require' name='rdseed'/>
    <feature policy='require' name='adx'/>
    <feature policy='require' name='smap'/>
    <feature policy='require' name='clflushopt'/>
    <feature policy='require' name='xsaveopt'/>
    <feature policy='require' name='xsavec'/>
    <feature policy='require' name='xgetbv1'/>
    <feature policy='require' name='mmxext'/>
    <feature policy='require' name='fxsr_opt'/>
    <feature policy='require' name='pdpe1gb'/>
    <feature policy='require' name='cmp_legacy'/>
    <feature policy='require' name='extapic'/>
    <feature policy='require' name='cr8legacy'/>
    <feature policy='require' name='3dnowprefetch'/>
    <feature policy='require' name='osvw'/>
    <feature policy='require' name='skinit'/>
    <feature policy='require' name='wdt'/>
    <feature policy='require' name='tce'/>
    <feature policy='require' name='topoext'/>
    <feature policy='require' name='perfctr_core'/>
    <feature policy='require' name='perfctr_nb'/>
    <numa>
      <cell id='0' cpus='0-4' memory='524288' unit='KiB'/>
      <cell id='1' cpus='5-9' memory='524288' unit='KiB'/>
    </numa>
  </cpu>
...

5. update libvirt and qemu to 7.5:

6. recheck guest xml, libvirt change the model to EPYC:

# virsh dumpxml r7-mig
...
  <cpu mode='custom' match='exact' check='full'>
    <model fallback='allow'>EPYC</model>
    <vendor>AMD</vendor>
    <feature policy='disable' name='ht'/>
    <feature policy='disable' name='osxsave'/>
    <feature policy='require' name='cmp_legacy'/>
    <feature policy='disable' name='extapic'/>
    <feature policy='disable' name='skinit'/>
    <feature policy='disable' name='wdt'/>
    <feature policy='disable' name='tce'/>
    <feature policy='disable' name='topoext'/>
    <feature policy='disable' name='perfctr_core'/>
    <feature policy='disable' name='perfctr_nb'/>
    <feature policy='disable' name='monitor'/>
    <feature policy='require' name='x2apic'/>
    <feature policy='require' name='hypervisor'/>
    <feature policy='disable' name='sha-ni'/>
    <feature policy='disable' name='rdtscp'/>
    <feature policy='disable' name='svm'/>
...

# virsh dumpxml r7-mig --migratable
...
  <cpu mode='custom' match='exact' check='partial'>
    <model fallback='allow'>EPYC</model>
    <vendor>AMD</vendor>
    <feature policy='require' name='ht'/>
    <feature policy='require' name='osxsave'/>
    <feature policy='require' name='cmp_legacy'/>
    <feature policy='require' name='extapic'/>
    <feature policy='require' name='skinit'/>
    <feature policy='require' name='wdt'/>
    <feature policy='require' name='tce'/>
    <feature policy='require' name='topoext'/>
    <feature policy='require' name='perfctr_core'/>
    <feature policy='require' name='perfctr_nb'/>
...

7. this guest cannot migrate to 7.3 since there is no EPYC cpu model:
# virsh migrate r7-mig qemu+ssh://target/system --live
error: internal error: Unknown CPU model EPYC

8. and after managedsave and restart, libvirt will use EPYC cpu model to build qemu command line:

# ps aux|grep qemu
 ... -cpu Opteron_G3,+vme,+ht,+pclmuldq,+ssse3,+fma,+sse4.1,+sse4.2,+movbe,+aes,+xsave,+osxsave,+avx,+f16c,+rdrand,+arat,+fsgsbase,+bmi1,+avx2,+smep,+bmi2,+rdseed,+adx,+smap,+clflushopt,+xsaveopt,+xsavec,+xgetbv1,+mmxext,+fxsr_opt,+pdpe1gb,+cmp_legacy,+extapic,+cr8legacy,+3dnowprefetch,+osvw,+skinit,+wdt,+tce,+topoext,+perfctr_core,+perfctr_nb

# virsh managedsave r7-mig
Domain r7-mig state saved by libvirt

# virsh start r7-mig
Domain r7-mig started

# ps aux|grep qemu
 -cpu EPYC,ht=off,osxsave=off,cmp_legacy=on,extapic=off,skinit=off,wdt=off,tce=off,topoext=off,perfctr_core=off,perfctr_nb=off,monitor=off,x2apic=on,hypervisor=on,sha-ni=off,rdtscp=off,svm=off

Comment 8 Luyao Huang 2017-12-05 06:37:48 UTC
Hi jirka,

Could please help to check if the test result in comment 7 is expected ? if no, do we need open a new bug to track this issue ? thanks in advance for your answer.

Comment 10 Jiri Denemark 2017-12-05 18:40:20 UTC
Sigh, that's unfortunately caused by the older libvirt which did not store the actual CPU configuration it used to start the domain. Thus the libvirt needs to guess it. But apparently we don't do it the way we should. We should ask the running QEMU what CPU model it supports and only use one of the reported models. Please, file a new bug for this.

Comment 11 Luyao Huang 2017-12-06 01:10:14 UTC
(In reply to Jiri Denemark from comment #10)
> Sigh, that's unfortunately caused by the older libvirt which did not store
> the actual CPU configuration it used to start the domain. Thus the libvirt
> needs to guess it. But apparently we don't do it the way we should. We
> should ask the running QEMU what CPU model it supports and only use one of
> the reported models. Please, file a new bug for this.

Thanks for your quick reply, i have filed a new bug 1521202.

Comment 12 Luyao Huang 2017-12-06 01:32:14 UTC
Verify this bug with comment 6.

Comment 16 errata-xmlrpc 2018-04-10 10:55:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:0704


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