Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4798615rdh; Wed, 29 Nov 2023 10:56:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IE30kwxPR42rBgWy/SwecCTVcoabdJi5ee59l5sVIrkkMFdMn+oyP0AbIFReCGqd8H4mwzg X-Received: by 2002:a17:902:be08:b0:1cf:747e:89c6 with SMTP id r8-20020a170902be0800b001cf747e89c6mr18377859pls.26.1701284213316; Wed, 29 Nov 2023 10:56:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701284213; cv=none; d=google.com; s=arc-20160816; b=ngv2oRAemhf0pWaMg284GGnkowsCXuY0jUDHPfPFNz2lgKRF77cL1UJGJ0jTn8Q/sD nrtZZj6KGp8aTOa55W+HiN6IhAgVivvNL7fwGP0SsRpsS7yqb4Z/Re4Ri6XJ7BKDBPxL Gy95h3ow6mflV5cMUbrPReO10OOEAnR+dFX0GsbWLVYtsF4xnehXoupkbnthqdQa55li MSu8pdQjXUsBiH7kDp9fy2RWfw4KfI6UuhteGvbnqfsF8fMxTG1m5iMvFTZHqqgX+jQK yKr0p4phEh0vACaGqQPEEjn/mjpiazxmN3ezL5+AyTlqDvxRtdYJH0va6FtTAcUhOGsM 3dJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=mnqfuOINSRYoVqpQH4axM59kPcJff9hNQcJnzv6NSeU=; fh=aG3xVwEX9XJGCOXFeVjXHbAUhPpZRhr1T1pzt4tdUBY=; b=a+9pnAYng0YE92PQpw3CqwHnHe8Kjdz+gIImqBIan1uVxULmO/twz3mowsWVmGm5ag CHfY782VKXMNCMVwPiEeix587Lvm4dYGsmaqSPjPQm+DAByOs7s3o0NPvv2Om04NAEp/ tQwWGKz5ZbURMYkjYDdpPxHIkC89Y9KYXSB6B5CBzKe/6UBuTzsl9kpJM3QHCIdKJbSQ a0m7h9jdAqvB+vvTWG2LKhzrTMowTkToTTBt75dapUmkCnnoXbQ1kvZUT2U0TVX8j43U e1jpvVsfEBWiYcPBswhkNW2YN/wnHHteCBNw7UqTe8GpjDztm1CcTeDUSu+7v3lt4DN8 5D3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=i7fufibm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id 4-20020a170902c24400b001cfb5471961si9951591plg.274.2023.11.29.10.56.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 10:56:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=i7fufibm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id CDB7080473F7; Wed, 29 Nov 2023 10:56:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231304AbjK2S4e (ORCPT + 99 others); Wed, 29 Nov 2023 13:56:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbjK2S4c (ORCPT ); Wed, 29 Nov 2023 13:56:32 -0500 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BF5CA0 for ; Wed, 29 Nov 2023 10:56:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mnqfuOINSRYoVqpQH4axM59kPcJff9hNQcJnzv6NSeU=; b=i7fufibmigOcoWhN7fy+M4cMok ovLL2utU4+XRQMUMOt9pHaLzrEUC9uRpfMC8krU9gsUGJBMJzvwzV4GNhGRZF4GSC/xiIPDC3geKx OUSA2sH6VMTCYvEESkMu0DIL4mLherHnx4DDRK+devuRmy5yCKPNe9IFBIHwCPK808YhZ012kYtub Zms6l5rQsdcF5ba6NuqCqTM7Lp7wnDHerO4pyyRNIOKx7LrUyl1CdGTqDaP/7W53lrxQtkX+t21lM ssOuiuB2IYvOzhKgiI1jsDk8bAKXx5viRk49cklr8X3CpJAK1Lb9gpPx/TnmeA8w485ukopB4qMmF btvGy55w==; Received: from 189-69-166-209.dial-up.telesp.net.br ([189.69.166.209] helo=[192.168.1.111]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1r8PjN-008Wiw-BR; Wed, 29 Nov 2023 19:56:17 +0100 Message-ID: Date: Wed, 29 Nov 2023 15:56:12 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] futex: Add compat_sys_futex_waitv for 32bit compatibility To: Wei Gao Cc: tglx@linutronix.de, dvhart@infradead.org, linux-kernel@vger.kernel.org, dave@stgolabs.net, mingo@redhat.com, peterz@infradead.org, Arnd Bergmann References: <20231123053140.16062-1-wegao@suse.com> <189e733e-7056-45c4-a5c6-3371f8219b7e@igalia.com> Content-Language: en-US From: =?UTF-8?Q?Andr=C3=A9_Almeida?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 29 Nov 2023 10:56:50 -0800 (PST) Hi Wei, Em 27/11/2023 09:15, Wei Gao escreveu: > On Thu, Nov 23, 2023 at 01:09:55PM -0300, André Almeida wrote: >> [+CC Arnd] >> >> Hi Wei, >> >> Em 23/11/2023 02:31, Wei Gao escreveu: >>> From: wei gao >>> >>> Current implementation lead LTP test case futex_waitv failed when compiled with >>> -m32. This patch add new compat_sys_futex_waitv to handle m32 mode syscall. >>> >>> The failure reason is futex_waitv in m32 mode will deliver kernel with struct >>> old_timespec32 timeout, but this struct type can not directly used by current >>> sys_futex_waitv implementation. >>> >>> The new function copy main logic of current sys_futex_waitv, just update parameter >>> type from "struct __kernel_timespec __user *" to "struct old_timespec32 __user *," >>> and use get_old_timespec32 within the new function to get timeout value. >>> >> >> From, what I recall, we don't want to add new syscalls with old_timespec32, >> giving that they will have a limited lifetime. Instead, userspace should be >> able to come up with a 64-bit timespec implementation for -m32. >> >> Thanks, >> André > > Just a comment, I have checked the glibc latest code but do not see any implemention(*.c) on > futex_waitv syscall. So normally you have to do syscall directly with __NR_futex_waitv from > userspace. So i guess glibc-side can not covert this struct correctly currently. Correct me if > any misunderstanding. > futex() has no syscall wrappers in glibc. Userspace needs to figure out everything by themselves, including which struct they should use, and I don't think that glibc does any conversion. If you create manually a timespec64 that works in -m32, and pass this to sycall(__NR_futex_waitv, ..., &timeout, ...), it should work correctly. You can read more about how glibc is planning to deal with this at [1]. Please let me know if now it's more clear :) [1] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign > Thanks > Wei Gao