Backport "cpu: Fix cpuid check for some AMD processors."

Resolves: #2211747
f38 imports/e9/openvswitch-3.1.1-3.el9
Timothy Redaelli 2 years ago
parent 89c329fd59
commit c27c2466b2

@ -0,0 +1,37 @@
From 3fcb817840fd4bed114d6bbe7275d08310feb797 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 7 Jun 2023 10:24:40 +0200
Subject: [PATCH] cpu: Fix cpuid check for some AMD processors.
Some venerable AMD processors do not support querying extended features
(EAX=7) with cpuid.
In this case, it is not a programmatic error and the runtime check should
simply return the isa is unsupported.
Reported-by: Davide Repetto <red@idp.it>
Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2211747
Fixes: b366fa2f4947 ("dpif-netdev: Call cpuid for x86 isa availability.")
Signed-off-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
lib/cpu.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/cpu.c b/lib/cpu.c
index 0292f715e..fbbea4005 100644
--- a/lib/cpu.c
+++ b/lib/cpu.c
@@ -37,7 +37,9 @@ static bool x86_has_isa(uint32_t leaf, enum x86_reg reg, uint32_t bit)
{
uint32_t regs[4];
- ovs_assert(__get_cpuid_max(leaf & X86_LEAF_MASK, NULL) >= leaf);
+ if (__get_cpuid_max(leaf & X86_LEAF_MASK, NULL) < leaf) {
+ return false;
+ }
__cpuid_count(leaf, 0, regs[EAX], regs[EBX], regs[ECX], regs[EDX]);
return (regs[reg] & ((uint32_t) 1 << bit)) != 0;
--
2.40.1

@ -48,7 +48,7 @@ Name: openvswitch
Summary: Open vSwitch daemon/database/utilities Summary: Open vSwitch daemon/database/utilities
URL: https://www.openvswitch.org/ URL: https://www.openvswitch.org/
Version: 3.1.1 Version: 3.1.1
Release: 2%{?dist} Release: 3%{?dist}
# Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the
# lib/sflow*.[ch] files are SISSL # lib/sflow*.[ch] files are SISSL
@ -68,6 +68,7 @@ Source1: openvswitch.sysusers
# ovs-patches # ovs-patches
# OVS (including OVN) backports (0 - 300) # OVS (including OVN) backports (0 - 300)
Patch0: 0001-cpu-Fix-cpuid-check-for-some-AMD-processors.patch
BuildRequires: gcc gcc-c++ make BuildRequires: gcc gcc-c++ make
BuildRequires: autoconf automake libtool BuildRequires: autoconf automake libtool
@ -601,6 +602,9 @@ fi
%{_sysusersdir}/openvswitch.conf %{_sysusersdir}/openvswitch.conf
%changelog %changelog
* Thu Jun 08 2023 Timothy Redaelli <tredaelli@redhat.com> - 3.1.1-3
- Backport "cpu: Fix cpuid check for some AMD processors." (#2211747)
* Mon May 22 2023 Timothy Redaelli <tredaelli@redhat.com> - 3.1.1-2 * Mon May 22 2023 Timothy Redaelli <tredaelli@redhat.com> - 3.1.1-2
- Replace fgrep with grep -F (#2203601) - Replace fgrep with grep -F (#2203601)
- Delete ovs-vswitchd, if it's not a link (#2188710) - Delete ovs-vswitchd, if it's not a link (#2188710)

Loading…
Cancel
Save