From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by sourceware.org (Postfix) with ESMTPS id 942983858D26 for ; Tue, 8 Nov 2022 12:04:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 942983858D26 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x22e.google.com with SMTP id r76so15228567oie.13 for ; Tue, 08 Nov 2022 04:04:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=zT1AnBdqBcChvmg2Aox4K1182lDGp8YrfCBeB+K8a44=; b=FgbFzFz9CSSGUPxp99t4AauL00AU1eolHfMSB6lVZcRyXJRR5qCgCpcpZO6gI+T9pH 2M0O8Sv2agjeNAD5YTbqO5zYEhMj+hwlNOfsXGZTIGseV7PkmnQA/OGNuJuc69L+MnJc RwMI4qwWAdUnF1RgTD3ydvnqGYa62TRt5hERFJX+srp1f8bOnZgcrrN2AhiCa2objHij d5iSZijnTgcEmXrGrxZmZXC1JWZldx68jF19R0b46R2/lSxy1g683I5FgS4cmQ2mqa8E gZvxBZxYbQtLW9uqabCEidll/wJpWd1LOipNaz87zexDm2qv/33PLwgOUyABw9Ufuwo2 Zebg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zT1AnBdqBcChvmg2Aox4K1182lDGp8YrfCBeB+K8a44=; b=JyTVTz10tcS1dpQtsXz46jKy/9Q24rc7GbhPldDMmu1pdbfSDRVd1YMFu9m9Yz1ZjR y1jzw2EhH0/pZmjRK99buMmjyt5muI5uO/imvSyLEZHoNl4qXwrhlkYcrww2AxeSNWWu 8Nhk0aZkGuK101S/71RlVldlx+BgPoVoAzxOcxaOko7P2o3LXFsDd5fICPyppzcTawqa 9lMFlKcbz+pKctyiyBMcjV4TdXo2ykNoPKZYoMI1Yx5Rncg4iQwXt0aJ9QTg+M5m6j0K emD4KojVoGvpPp06k8/2PfZL6BxLtASj8JizzoLKGmftyKFpNmhWoBT7FVAD8/IETaLJ jkfg== X-Gm-Message-State: ACrzQf3kXGsOKBnO5NTvCNjUgmU93c/4H5q3TFKQmgxNhMWYb8tIi+64 vr/8AyW5aYKzJInDUxR2v4n4osd3tyJxqt7r X-Google-Smtp-Source: AMsMyM7DLq7iihJe6+DmVQDDZiytNjduM1hMWvwbAcI+OtU9gSmfgP2+g3sIfWn82SddI9MVuPWBww== X-Received: by 2002:a05:6808:2224:b0:35a:416a:97bd with SMTP id bd36-20020a056808222400b0035a416a97bdmr17918290oib.277.1667909067762; Tue, 08 Nov 2022 04:04:27 -0800 (PST) Received: from ?IPV6:2804:1b3:a7c0:a9f4:fc60:ae8f:c4b6:cf0a? ([2804:1b3:a7c0:a9f4:fc60:ae8f:c4b6:cf0a]) by smtp.gmail.com with ESMTPSA id x26-20020a056870a79a00b0012752d3212fsm4445931oao.53.2022.11.08.04.04.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Nov 2022 04:04:27 -0800 (PST) Message-ID: <9ccb6d5c-e054-29cd-06ce-04ef5ee312b8@linaro.org> Date: Tue, 8 Nov 2022 09:04:24 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH] Rename STAT_HAS_TIME32 to KERNEL_STAT64_HAS_TIME32 Content-Language: en-US To: Arnd Bergmann , YunQiang Su , Xi Ruoyao Cc: syq@debian.org, aurelien@aurel32.net, Jiaxun Yang , "Maciej W. Rozycki" References: <20221104015428.1545677-1-yunqiang.su@cipunited.com> <50e745fa-0508-43f1-bd0a-cfa789239f7e@app.fastmail.com> <6100f772-fab4-4e92-a6a9-cf882954df9d@app.fastmail.com> <8c9f4e1a-b77b-2257-7558-41b27dbe7344@linaro.org> <5ae33887-9a56-482f-b8b3-c223ad2959ee@app.fastmail.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <5ae33887-9a56-482f-b8b3-c223ad2959ee@app.fastmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 08/11/22 08:21, Arnd Bergmann wrote: > On Mon, Nov 7, 2022, at 19:45, Adhemerval Zanella Netto wrote: >> On 07/11/22 15:24, Arnd Bergmann wrote: > >>> What is the glibc behavior for i386 with 64-bit time_t on a >>> kernel without statx? Does that also intepret a time value >>> of -1u as a 2106 timestamp, or does it convert that into a >>> 1969 timestamp like the other (not mips/pa-risc) 64-bit >>> architectures do? >> >> The time_t for glibc is always signed and for legacy 32-bit ABIs >> it issues fstatat64 and assumes that kernel will handle potential >> overflow by returning a proper error (if syscall succeeds then the >> file times are within the signed 32 bit time_t range). >> >> My understanding is mips is the only outlier here with unsigned >> kernel stat times, which on glibc is handled with a special function >> that just that interprets the values as 2106 timestamp >> (__cp_kstat_stat64_t64). > > Ok, got it. In this case I guess we should probably follow the > same behavior in the kernel when we add the truncation and > use the 1902..2038 range for all 32-bit targets but use the > 1970..2106 range for mips64. Not sure what to do about > mips32 compat mode though. At the moment, the o32/n32 stat64 > is shared with the n64 stat ("newstat") variant, but if n64 > actually wants a different behavior, we may need to add custom > handlers for that. > > Arnd The mips64n32 uses the same code path as mips64, but mips32 assumes the same ABI for old legacy 32 bit architectures (fstatat64 syscall with signed time_t). So for compat mode mips32 is also handled as unsigned? Is it only for compat mode, and not for 32-bit kernel?