Bug 1445834 - Add support for AMD EPYC processors
Summary: Add support for AMD EPYC processors
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.4
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Eduardo Habkost
QA Contact: Guo, Zhiyi
Keywords: FutureFeature
Depends On:
Blocks: 1445836 1450396 1481252 1524824
TreeView+ depends on / blocked
Reported: 2017-04-26 15:32 UTC by Paolo Bonzini
Modified: 2018-04-11 00:16 UTC (History)
16 users (show)

Clone Of:
: 1445836 1450396 1481252 1524824 (view as bug list)
Last Closed: 2018-04-11 00:16:25 UTC

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:1104 normal SHIPPED_LIVE Important: qemu-kvm-rhev security, bug fix, and enhancement update 2018-04-10 22:54:38 UTC
Launchpad 1703506 None None None 2017-07-26 13:18 UTC

Description Paolo Bonzini 2017-04-26 15:32:12 UTC
Based on LKML email, the processor has all the features in Opteron_G5 plus the following features:

cpu family	: 23
model		: 1
model name	: AMD Ryzen 7 1800X Eight-Core Processor
flags           :
mmxext fxsr_opt rdtscp movbe rdrand extapic cr8_legacy 3dnowprefetch fsgsbase 
bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1
xsaves clzero topoext

The "topoext" feature needs extra support in QEMU.

"bpext" and "mwaitx" may need KVM support too.

Comment 2 Paolo Bonzini 2017-04-27 10:24:05 UTC
> BTW, search from beaker, I have two suspects that maybe engineer samples of 
> Ryzen, but they lack some of flags comparing with yours: clzero bpext mwaitx  

Yes, they are engineering samples of Ryzen.  I'm not sure whether we have any machines with final parts.

Comment 5 Jan Vlug 2017-05-28 15:20:36 UTC
I added a similar issue for Fedora: bug 1456273

Comment 6 Paolo Bonzini 2017-05-29 12:02:01 UTC

rhis is not related to your issue; it is only about adding a "-cpu" flag that enables Ryzen features for the virtual machine.

Comment 7 Eduardo Habkost 2017-07-26 13:18:16 UTC
There's also SMT ("Simultaneous multithreading") support.  See upstream bug:

Comment 8 Eduardo Habkost 2017-08-14 12:52:04 UTC
libvirt bug created: bug 1481252.

SMT will be tracked at bug 1481253.

Comment 13 Eduardo Habkost 2017-08-24 22:27:53 UTC
Changing BZ summary to mention EPYC to avoid confusion.  EPYC CPU model was already submitted by AMD queued for inclusion upstream.

Comment 15 Eduardo Habkost 2017-10-05 21:14:50 UTC
Upstream commit:

commit 2e2efc7dbe2b0adc1200b5aa286cdbed729f6751
Author: Brijesh Singh <brijesh.singh@amd.com>
Date:   Tue Aug 15 12:00:51 2017 -0500

    target-i386/cpu: Add new EPYC CPU model
    Add a new base 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
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Richard Henderson <rth@twiddle.net>
    Cc: Eduardo Habkost <ehabkost@redhat.com>
    Cc: Tom Lendacky <Thomas.Lendacky@amd.com>
    Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
    Message-Id: <20170815170051.127257-1-brijesh.singh@amd.com>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Comment 16 Miroslav Rezanina 2017-10-20 09:31:37 UTC
Fix included in qemu-kvm-rhev-2.10.0-3.el7

Comment 20 Guo, Zhiyi 2017-11-09 16:16:19 UTC
Hi Edurado,

   Can I continue my test with -cpu EPYC,-rdtscp,enforce since rdtscp block the enforce option. Another interesting part is EPYC also delete some flags like fma4, does AMD not want guest boot with default, no customized cpu model like Opteron_G5 to be migrated to new EPYC host? Do I need to test migration from old host to new EPYC host?(Since intel really allow this)

Guo, Zhiyi

Comment 21 Eduardo Habkost 2017-11-09 19:23:13 UTC
If the RHEL-7.5 kernel doesn't support virtualizing RDTSCP yet (the upstream kernel does), we need to manually disable RDTSCP in the RHEL-7 machine-types.  I plan to do that soon, so please continue testing using "-cpu EPYC,-rdtscp,enforce".

About the missing fma4 feature: if the host really doesn't support it, migration of existing VMs with the FMA4 feature to a EPYC host will be impossible, and in this case all we can do is to ensure libvirt is preventing migration before it starts.  We can add a note about this on the test plan.

Comment 22 Paolo Bonzini 2017-11-10 08:07:41 UTC
Eduardo, adding support for RDTSCP on RHEL 7 is easy.  zhguo is opening a new bug for that.

Comment 23 Guo, Zhiyi 2017-11-10 08:25:52 UTC
Kernel side rdtscp bug:
Bug 1511805 - Kernel missing rdtscp for amd Ryzen/EPYC cpu model

Comment 28 errata-xmlrpc 2018-04-11 00:16:25 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.


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