From patchwork Wed Sep 30 18:01:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matheus Castanho X-Patchwork-Id: 1374592 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=sourceware.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=YotFADAs; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C1kbQ2Zc7z9sSG for ; Thu, 1 Oct 2020 04:01:38 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 264033870878; Wed, 30 Sep 2020 18:01:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 264033870878 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1601488896; bh=+sJEC+54/HZmYle2WveHNB4UiHrXO1OcZSLmmEGHYZ0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=YotFADAs2FfXqOe7dM+fUsF9XE69OPHtmD6ZnXE2Gco/o61PKpdGAp/R818Gam/E2 RUkmL+pV+0VRSCa2MBeDdKaR/Y50qYWEvYRaQ5Hk8R8zJnFNyY6608/zH1NBN5RION M3r2OcQ082P+dIEPBMn7jpzNVtpfEEw2vjLZGA6U= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 16C3B3861823 for ; Wed, 30 Sep 2020 18:01:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 16C3B3861823 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08UHXQlu155238; Wed, 30 Sep 2020 14:01:32 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 33vw7vkc8p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 14:01:32 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08UHw4ob017037; Wed, 30 Sep 2020 18:01:31 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma04dal.us.ibm.com with ESMTP id 33sw99hbq1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 18:01:31 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08UI1Uwq53805418 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Sep 2020 18:01:30 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B7AC2AE064; Wed, 30 Sep 2020 18:01:30 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 13184AE05C; Wed, 30 Sep 2020 18:01:30 +0000 (GMT) Received: from [9.65.230.4] (unknown [9.65.230.4]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 30 Sep 2020 18:01:29 +0000 (GMT) To: Adhemerval Zanella , GNU C Library Subject: semtimedop, powerpc, time64 and older kernels Message-ID: <6f370467-8d0a-bd3d-29b2-2fefef4e475f@linux.ibm.com> Date: Wed, 30 Sep 2020 15:01:28 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-30_09:2020-09-30, 2020-09-30 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 bulkscore=0 impostorscore=0 spamscore=0 priorityscore=1501 suspectscore=0 phishscore=0 mlxscore=0 clxscore=1015 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009300138 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Matheus Castanho via Libc-alpha From: Matheus Castanho Reply-To: Matheus Castanho Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Hi Adhemerval, sysvipc/test-sysvsem started failing on ppc64le on kernels older than 5.1 after: commit aaa12e9ff02b32d5fbb2f367d7d6b6985a2176d6 Author: Adhemerval Zanella Date: Fri Sep 25 15:04:34 2020 -0300 sysvipc: Fix semtimeop for !__ASSUME_DIRECT_SYSVIPC_SYSCALLS The __NR_ipc syscall does not support 64-bit time operations. It fixes 7c437d3778. Checked on i686-linux-gnu on a Linux 5.4. It fails with: FAIL: sysvipc/test-sysvsem original exit status 1 error: test-sysvsem.c:101: semop failed (errno=38) error: 1 test failures Looks like semtimedop was added on Linux 5.1, so it makes sense that older kernels will fail with ENOSYS when calling that. So in such cases should we also apply time convertion and fallback to semtimedop/ipc in __semtimedop64 as done when !__ASSUME_DIRECT_SYSVIPC_SYSCALLS? The patch below seems to solve the issue, at least on ppc64le. Suggestions? Thanks, Matheus Castanho --- 8< --- return r; Reviewed-by: Matheus Castanho diff --git a/sysdeps/unix/sysv/linux/semtimedop.c b/sysdeps/unix/sysv/linux/semtimedop.c index a9ad922ee2..510fea1852 100644 --- a/sysdeps/unix/sysv/linux/semtimedop.c +++ b/sysdeps/unix/sysv/linux/semtimedop.c @@ -32,7 +32,7 @@ __semtimedop64 (int semid, struct sembuf *sops, size_t nsops, int r = INLINE_SYSCALL_CALL (semtimedop_time64, semid, sops, nsops, timeout); -#ifndef __ASSUME_TIME64_SYSCALLS +#if !(defined __ASSUME_TIME64_SYSCALLS) || __LINUX_KERNEL_VERSION < 0x050100 if (r == 0 || errno != ENOSYS)