SHA256
1
0
forked from pool/dpdk
dpdk/0001-fix-cpu-compatibility.patch
Madhu Mohan Nelemane ebd2e5f1b0 Accepting request 807340 from home:jaicaa:branches:network
- Update to v19.11.1. For a list of changes, check:
  * https://doc.dpdk.org/guides/rel_notes/release_19_11.html#new-features 
- Removed patches no longer applying to the code base:
  * 0001-vhost-fix-possible-denial-of-service-on-SET_VRING_NU.patch
  * 0002-vhost-fix-possible-denial-of-service-by-leaking-FDs.patch
  * 0002-fix-cpu-compatibility.patch
- Rebased patches:
  * 0001-fix-cpu-compatibility.patch
- Add patches to fix vulnerability where malicious guest/container can
  cause resource leak resulting a Denial-of-Service, or memory corruption
  and crash, or information leak in vhost-user backend application
  (bsc#1171477, CVE-2020-10722, CVE-2020-10723, CVE-2020-10724,
  CVE-2020-10725, CVE-2020-10726).
  * 0001-vhost-check-log-mmap-offset-and-size-overflow.patch
  * 0002-vhost-fix-vring-index-check.patch
  * 0003-vhost-crypto-validate-keys-lengths.patch
  * 0004-vhost-fix-translated-address-not-checked.patch
  * 0005-vhost-fix-potential-memory-space-leak.patch
  * 0006-vhost-fix-potential-fd-leak.patch

OBS-URL: https://build.opensuse.org/request/show/807340
OBS-URL: https://build.opensuse.org/package/show/network/dpdk?expand=0&rev=115
2020-05-20 09:15:07 +00:00

74 lines
2.4 KiB
Diff

From e2950fec9cd9c235a7847ed97b6914174857bf93 Mon Sep 17 00:00:00 2001
From: "mvarlese@suse.de" <mvarlese@suse.de>
Date: Wed, 29 Apr 2020 12:24:16 +0200
Subject: [PATCH] fix cpu compatibility
---
drivers/bus/vdev/vdev.c | 4 ++++
lib/librte_eal/common/eal_common_bus.c | 5 ++++-
lib/librte_eal/common/include/rte_common.h | 14 +++++++++++++-
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index a89ea2353..cf8e8dca6 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -55,7 +55,11 @@ static struct vdev_custom_scans vdev_custom_scans =
static rte_spinlock_t vdev_custom_scan_lock = RTE_SPINLOCK_INITIALIZER;
/* register a driver */
+#if defined(__x86_64__) || defined(__i386__)
+void __attribute__((target ("sse2")))
+#else
void
+#endif
rte_vdev_register(struct rte_vdev_driver *driver)
{
TAILQ_INSERT_TAIL(&vdev_driver_list, driver, next);
diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c
index baa5b532a..58f3fdbaa 100644
--- a/lib/librte_eal/common/eal_common_bus.c
+++ b/lib/librte_eal/common/eal_common_bus.c
@@ -15,8 +15,11 @@
static struct rte_bus_list rte_bus_list =
TAILQ_HEAD_INITIALIZER(rte_bus_list);
-
+#if defined(__x86_64__) || defined(__i386__)
+void __attribute__((target ("sse2")))
+#else
void
+#endif
rte_bus_register(struct rte_bus *bus)
{
RTE_VERIFY(bus);
diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index c35283807..8f4f98ed4 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -107,8 +107,20 @@ typedef uint16_t unaligned_uint16_t;
* Lowest number is the first to run.
*/
#ifndef RTE_INIT_PRIO /* Allow to override from EAL */
+#if defined(__x86_64__) || defined(__i386__)
#define RTE_INIT_PRIO(func, prio) \
-static void __attribute__((constructor(RTE_PRIO(prio)), used)) func(void)
+static void \
+ __attribute__((constructor(RTE_PRIO(prio)), used)) \
+ __attribute__((target ("sse2"))) \
+ __attribute__((target ("no-sse3"))) \
+ __attribute__((target ("no-sse4"))) \
+ func(void)
+#else
+#define RTE_INIT_PRIO(func, prio) \
+static void \
+ __attribute__((constructor(RTE_PRIO(prio)), used)) \
+ func(void)
+#endif
#endif
/**
--
2.16.4