From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0FE1C433E0 for ; Fri, 12 Feb 2021 12:40:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8797364E23 for ; Fri, 12 Feb 2021 12:40:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231144AbhBLMkL (ORCPT ); Fri, 12 Feb 2021 07:40:11 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:45318 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231246AbhBLMhu (ORCPT ); Fri, 12 Feb 2021 07:37:50 -0500 Date: Fri, 12 Feb 2021 12:37:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1613133426; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BabadaKVsMRogXIuDo1+NwHKfEGx1tEgVepBW6m1PtI=; b=wmqBaU1cJidT7pc8JKd5ZRU4XbfJ1HCrnd/U/mXx+tFvEuh7jWTpU3+N/NBgY9r6JBF7/Q 8/HgHIgVSEoiwbvekncgASG++ORu2/JSWKdOjON+B10C+/frroH2l7iVkvANG/Lub9kAAf fVTXOnolVrfV9wuUmAePpTpz6mg/RV9+mn3RFB30n7gy8/LChWWC0bMqAkyXAJD3ykOKDS +bRP8B6SBqmbCM1o6uO/muuhguv6b+A4K9+M0Lmwaim9V3QzZ36O0NXqMnVvfbKCLg+ljX zgpUygfLzyGvSCDzGwN6IbPF2h5Mu9p//wwpLu/vH91oq3MO4LGC24P/8rKcjQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1613133426; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BabadaKVsMRogXIuDo1+NwHKfEGx1tEgVepBW6m1PtI=; b=l1wUEpURSwnaCnz5P4pVG0oTnoK502UPesG6Mf9LPaxLr6t2nOAw5FXa+Lt8yr58TYvgpr 5kmyEFmSS62bQQAQ== From: "tip-bot2 for Willy Tarreau" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: core/rcu] tools/nolibc: Implement poll() based on ppoll() Cc: Valentin Schneider , Mark Rutland , Willy Tarreau , "Paul E. McKenney" , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <161313342605.23325.10307309906235202220.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the core/rcu branch of tip: Commit-ID: 5b1c827ca3b349801e2faff4185118cfa74f94c6 Gitweb: https://git.kernel.org/tip/5b1c827ca3b349801e2faff4185118cfa74f94c6 Author: Willy Tarreau AuthorDate: Thu, 21 Jan 2021 08:20:27 +01:00 Committer: Paul E. McKenney CommitterDate: Thu, 21 Jan 2021 10:06:44 -08:00 tools/nolibc: Implement poll() based on ppoll() Some architectures like arm64 do not implement poll() and have to use ppoll() instead. This commit therefore makes poll() use ppoll() when available. This is a port of nolibc's upstream commit 800f75c13ede to the Linux kernel. Fixes: 66b6f755ad45 ("rcutorture: Import a copy of nolibc") Tested-by: Valentin Schneider Tested-by: Mark Rutland [arm64] Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney --- tools/include/nolibc/nolibc.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/include/nolibc/nolibc.h b/tools/include/nolibc/nolibc.h index fdd5524..833693f 100644 --- a/tools/include/nolibc/nolibc.h +++ b/tools/include/nolibc/nolibc.h @@ -1652,7 +1652,17 @@ int sys_pivot_root(const char *new, const char *old) static __attribute__((unused)) int sys_poll(struct pollfd *fds, int nfds, int timeout) { +#if defined(__NR_ppoll) + struct timespec t; + + if (timeout >= 0) { + t.tv_sec = timeout / 1000; + t.tv_nsec = (timeout % 1000) * 1000000; + } + return my_syscall4(__NR_ppoll, fds, nfds, (timeout >= 0) ? &t : NULL, NULL); +#else return my_syscall3(__NR_poll, fds, nfds, timeout); +#endif } static __attribute__((unused))