Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp506278pxh; Tue, 9 Nov 2021 14:22:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnDEublUXEtkwBTtx9JMPfkl0D/z/kRs2GYvmvz1L8R0qu4EfKRPLYZyK9RGb06o/9cjpt X-Received: by 2002:a50:e141:: with SMTP id i1mr14871817edl.157.1636496542709; Tue, 09 Nov 2021 14:22:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636496542; cv=none; d=google.com; s=arc-20160816; b=aGbzr7a/4/lRgBIUMUIV4tRrPLH/29uwdDFbYNU4kdJcmCGV6G7K+zwG/UythcAGPP aB7kcCdqhZIIX29PCGvv+CcTPejL1TgglSWksxJFVP5kOzPsbM4lNdr9151h2lY8Bxzw BnK2LUaBm5uzsVWJLZTv8dFgAk9FJ/L2+6LjDDN8xKpFl0K1RQgRjtKlCFzVDFTfyTY5 bd20VS4VL0AY4yQGbHd4oWlFctRV79JKvjHEOSQoW0poCEjA5yQC2Z08lYN/k0PoEhaj mjGg7sPABMgkblsbXyfdECO2P+qt+GoZMdB6jz1bwusHx88ElZHq8fZ2D9dLvk+Jw9Sq G2mg== 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 :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=hmOWuOkXs16JXf2U2KS96kfNUygWxTZSvVPyUDIUfLc=; b=ZROKPj3QsXH851koJJeSRssglTxbXcbZW+OlYo7zMByV9zp3Ko6MbCKZlRho6O4BmX +Nr+xJnfKEddqgPcagyrWUyuUbEE76rOfDoDTqlT2B561d85mEsSQujzndb0cxTVfLhv Atnx8H8JkKiih2b+ehNu4GWGhp3LUQZXik3QyPIuYb0Lyw/F9bCCiJADIkFBzp1vo0u1 QEY2vpWrFANLZtCP/PUKxglnbmYP4FlAg2UAZ5acFJ7AyITP9pOw/O5K4ztDnqZAt6ok Epm+XnXY17CBhcNw5QzmTGtcKmUHq2r1722D/f4Zrj8VaC1nGNP53OGy3h0PcUhy+/mV cRNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@collabora.com header.s=mail header.b=J01tLFph; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x16si10248294ejo.765.2021.11.09.14.21.58; Tue, 09 Nov 2021 14:22:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@collabora.com header.s=mail header.b=J01tLFph; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240044AbhKIM4U (ORCPT + 99 others); Tue, 9 Nov 2021 07:56:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242507AbhKIM4K (ORCPT ); Tue, 9 Nov 2021 07:56:10 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD202C06120A; Tue, 9 Nov 2021 04:53:08 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: tonyk) with ESMTPSA id C89B91F44B34 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=collabora.com; s=mail; t=1636462386; bh=6rhxitMRcNQgVh8jUZVAIrl39DOviTw78B3pgynzI/8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=J01tLFphErXVbo2Cz13hk0mouVzkea+XCNVKE14+gbDip1IiSyUUsitbUqq+SCcuE zw1jFtiTSzzO7AblKSF4eE+rks43ubJziZWgQpGANOR+VXZ/BtEwCp7cLJsMHkGvsB wsz8u4VZbs8JCbmxBcHpMUkah6xwEV7iOn8d9Xx58jrYZvwp0Syj8DM+Z2Gh+lyncu w+lbefh5remRkJnEFRZJbIXEaSf4oh1F7h/qdQLKN5MZgvS2bTK8l5BvK3XbW/LIbf 9x2cUpMufMZuVTMuL+GtkOJPH/1mI/0Ozvk9vvedn33C3pLkT4ZXrkRQvDTuAvYWlO L6GDS7m2WhC+g== Message-ID: <51bbfe74-33f6-bb92-3ce8-a22e4185820b@collabora.com> Date: Tue, 9 Nov 2021 09:52:58 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v2 20/22] selftests: futex: Test sys_futex_waitv() timeout Content-Language: en-US To: Vasily Gorbik Cc: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , linux-kernel@vger.kernel.org, Steven Rostedt , Sebastian Andrzej Siewior , kernel@collabora.com, krisman@collabora.com, linux-api@vger.kernel.org, libc-alpha@sourceware.org, mtk.manpages@gmail.com, Davidlohr Bueso , Arnd Bergmann References: <20210923171111.300673-1-andrealmeid@collabora.com> <20210923171111.300673-21-andrealmeid@collabora.com> From: =?UTF-8?Q?Andr=c3=a9_Almeida?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vasily, Às 08:18 de 09/11/21, Vasily Gorbik escreveu: > On Thu, Sep 23, 2021 at 02:11:09PM -0300, André Almeida wrote: >> Test if the futex_waitv timeout is working as expected, using the >> supported clockid options. > >> + /* futex_waitv with CLOCK_MONOTONIC */ >> + if (futex_get_abs_timeout(CLOCK_MONOTONIC, &to, timeout_ns)) >> + return RET_FAIL; >> + res = futex_waitv(&waitv, 1, 0, &to, CLOCK_MONOTONIC); >> + test_timeout(res, &ret, "futex_waitv monotonic", ETIMEDOUT); >> + >> + /* futex_waitv with CLOCK_REALTIME */ >> + if (futex_get_abs_timeout(CLOCK_REALTIME, &to, timeout_ns)) >> + return RET_FAIL; >> + res = futex_waitv(&waitv, 1, 0, &to, CLOCK_REALTIME); >> + test_timeout(res, &ret, "futex_waitv realtime", ETIMEDOUT); > > Hi André, > > when built with -m32 and run as compat this two futex_waitv calls hang > on x86 and s390 (noticed while wiring up futex_waitv). The rest of the > futex selftests pass. This suggests some common compat issue? Any ideas? The issue is that futex_waitv() only accepts struct timespec that uses 64bit members. When using -m32, glibc will give you a 32bit timespec, thus the timeout won't wort. Someday glibc will provide 64bit timespec to 32bit userspace, given that this is affected by y2038 bug. In previous submissions I added a workaround for that in the selftest[0]. Search for "Y2038 section for 32-bit applications" in that link. I'll submit something like that for futex_waitv() timeout test. [0] https://lore.kernel.org/lkml/20210709001328.329716-6-andrealmeid@collabora.com/