From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 9ECB3235 for ; Tue, 21 Nov 2017 14:19:47 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 51E9820985; Tue, 21 Nov 2017 08:19:47 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:19:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=h95BR1UspZeo6F8F9 5GMfWkmcRutrXycZsTE/fn+oxA=; b=NRrufFoO9tDtK5GIahKmdtEXClEMZWMQj p7AsJ/DJjhbZQRxngS83OhP4BwmoijebyTdV1/5J2aMIGmf3TlCz3npK38w7DnPe s2oHffmKq7FXXO6eH1Aa6Rsn1Wq3pIN4tvlr1+DqIelOJzHOg0QpcMsh0uhepC5p C/FTS8p5NUr139Fs31Sm4GBY6x0RtKs5huUYwylF6uFdN4b01HwHRtUfYuudPygd o4KyHu4G5r4Cf+oY7TMLP2a+oFI48vaBDVrenS6MckW9h0ovbMFF5C/S1uM5c5ce DOLQFPiFZrsQydB88W67bvYlLJPsB7wulM3fFrd6s8Leuyuo2764g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=h95BR1UspZeo6F8F95GMfWkmcRutrXycZsTE/fn+oxA=; b=DUdL9IoF SrYqHiIxgI5RpU/ZJh5qDTrBVfbVRfgBsNbYWwJWeJw9e6EsifafMEIDyhRYbRtU axnRw8HapPXgSq2QgJMmVGOksCH9vBdr0g3TaaBnAENpSnlMzjQRiVnEU5IrzeUX mDovJZAkUZKCIj9zQInF9oCrzmDH0aIVMz0EY4QGQBXm4bJhWEIT6hKqayhzh8GG lKZbZ6PCzKIXPGA7F1TDrvqNGOi35UOwOYkCKUFwR79MZU/qmGLy9i8Gkb6WXkT6 lVev/BIwmjN2RfC8jBtxqI3FZBs14LM5aSuwABnO8xP8FZDeMsTWwLTz6lIEMLIQ 9Pka8hXJdsoqaA== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id 6BA8C248B4; Tue, 21 Nov 2017 08:19:44 -0500 (EST) From: Yuanhan Liu To: Lukasz Majczak Cc: Jan Viktorin , Chao Zhu , dpdk stable Date: Tue, 21 Nov 2017 21:15:49 +0800 Message-Id: <1511270333-31002-7-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> References: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'eal: fix auxv open check for ARM and PPC' has been queued to stable release 17.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 13:19:47 -0000 Hi, FYI, your patch has been queued to stable release 17.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From c65b83ba128f7b58fae44ebde6f2ac8326c6cfaf Mon Sep 17 00:00:00 2001 From: Lukasz Majczak Date: Thu, 28 Sep 2017 08:54:59 +0200 Subject: [PATCH] eal: fix auxv open check for ARM and PPC [ upstream commit 1e0a17ac4c816fc41f6cf8c1fcd56149d8927263 ] The assertion of return value from the open() function is done against 0, while it is a correct value - open() returns -1 in case of an error. It causes problems while trying to run as a daemon, in which case, this call to open() will return 0 as a valid descriptor. Fixes: b94e5c9406b5 ("eal/arm: add CPU flags for ARMv7") Fixes: 97523f822ba9 ("eal/arm: add CPU flags for ARMv8") Fixes: 9ae155385686 ("eal/ppc: cpu flag checks for IBM Power") Signed-off-by: Lukasz Majczak Acked-by: Jan Viktorin Acked-by: Chao Zhu --- lib/librte_eal/common/arch/arm/rte_cpuflags.c | 2 +- lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/arch/arm/rte_cpuflags.c b/lib/librte_eal/common/arch/arm/rte_cpuflags.c index 5636e9c..88f1cbe 100644 --- a/lib/librte_eal/common/arch/arm/rte_cpuflags.c +++ b/lib/librte_eal/common/arch/arm/rte_cpuflags.c @@ -137,7 +137,7 @@ rte_cpu_get_features(hwcap_registers_t out) _Elfx_auxv_t auxv; auxv_fd = open("/proc/self/auxv", O_RDONLY); - assert(auxv_fd); + assert(auxv_fd != -1); while (read(auxv_fd, &auxv, sizeof(auxv)) == sizeof(auxv)) { if (auxv.a_type == AT_HWCAP) { out[REG_HWCAP] = auxv.a_un.a_val; diff --git a/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c b/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c index fcf96e0..970a61c 100644 --- a/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c +++ b/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c @@ -108,7 +108,7 @@ rte_cpu_get_features(hwcap_registers_t out) Elf64_auxv_t auxv; auxv_fd = open("/proc/self/auxv", O_RDONLY); - assert(auxv_fd); + assert(auxv_fd != -1); while (read(auxv_fd, &auxv, sizeof(Elf64_auxv_t)) == sizeof(Elf64_auxv_t)) { if (auxv.a_type == AT_HWCAP) -- 2.7.4