Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp509722rdh; Tue, 19 Dec 2023 05:53:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IELt1FzTz1Abh10s2nSVu15SaDYXgYRI73tKoARxo5EhkdfUuZMwcnr/9i616WINWsvWzQ4 X-Received: by 2002:a05:622a:30a:b0:425:4043:41a1 with SMTP id q10-20020a05622a030a00b00425404341a1mr30248871qtw.77.1702994018003; Tue, 19 Dec 2023 05:53:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702994017; cv=none; d=google.com; s=arc-20160816; b=Ic4I4hQqCNgc+vZgnTMxc1C0EYk94wkNXBxNBWzpbZF+DTbfSLe/mAF8YQleUu0njd mpQHG6M4hYgbmhLWdlVYvRWPqV8zrQBz0ntyG8tpSKcsA+X5X4dIbGGyZG9smqkpXx9d hfKu9xzUL8c65WsHKY+f5+d5OdKJqYHkMhGRBmwBEDas4LvoftdtiS97Uqi30+9aTUfA gz47SLpErs9PHqZuwZFUlHyFj4h+NiLhkv1g4Xm+OeusqLaDfgmHAOeUgxAwnYj0jigG 8ZwLSKenecqfhbusRrhjEK6H+Q0IvfWsCLVJLADUolqdzE3G2PbGE87/IunotjeT1+4c VkTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=GrP0mRtGJrzfoHpL2Av5Ll+A0UZ1SBEllqzx1qntSPk=; fh=pOkawu51yRUx+S9vtAugusWALznFBdYTXPat8LKd2JA=; b=ARE2z6CSQAXjb6pEIPfJcmvBiN4+UTPabfRnPnbf2JTkdYlG59UkvW30LoEhIwP6Ay FsMs/N5oHE41uXI7gMDqwjF4/hyWtbbYYTlS+p+KRTmt/h+rL5VE7HEfmH1+D5Ium1gQ B3g0nPNTPH7VTP88+g84dYJOpn0CmEKjjFynW1wzxFlz9a+q1v9xPnYviJV2GZKUFLj6 jt4qD+X3L8B6BEnXXL5hKIQD7LrstrgOpK7oiNrO72SEaMZkznTUTww7eHTB1FJEJ3sY 6rOPgsOfftd4eEAYZ47AakYIHyvjIYk4gvnsXlb39J5JzHuLYMVfRa2Gn/iv8XFyEUpV axQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=PjEiICY9; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="C5/p7dm1"; spf=pass (google.com: domain of linux-kernel+bounces-5289-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5289-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d4-20020ac85ac4000000b004277ab64ef1si962504qtd.536.2023.12.19.05.53.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 05:53:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5289-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=PjEiICY9; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="C5/p7dm1"; spf=pass (google.com: domain of linux-kernel+bounces-5289-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5289-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C0A5F1C23EB8 for ; Tue, 19 Dec 2023 13:53:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EA6551BDD5; Tue, 19 Dec 2023 13:53:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="PjEiICY9"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="C5/p7dm1" X-Original-To: linux-kernel@vger.kernel.org Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1E911BDC5; Tue, 19 Dec 2023 13:53:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id F278B3200A1A; Tue, 19 Dec 2023 08:53:25 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Tue, 19 Dec 2023 08:53:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1702994005; x=1703080405; bh=GrP0mRtGJr zfoHpL2Av5Ll+A0UZ1SBEllqzx1qntSPk=; b=PjEiICY96bMM67IaxgvmSGHBTZ UBnpc4zom9Mmbjvi5lbNj9dBIP6Gg+m2202t3kToxaf6GF24E6kg95p52IplWw32 JdRL5XH9Xni2vam5oJC9Si6EbYlJWDiiBMvgMtRJI5i97gqFe/wF2CX31hJN5KpF sxeJSSxhLODSVtil/EzB/DsM8AFy/S6wOiHLNsOzzajm/j6sw6sFrcIXDIlm/1/e 98wHECCXm48UJantn3PV1SB/yE51MOjBBMA8Ofyv86MCogzNt1lRTTUtHA++xFvH 6WRtEwiBEdPK5AvJFfSaBIJlxKJ8xupkxflBLDOMohL5/8GIZ6QH+zLf5zYA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1702994005; x=1703080405; bh=GrP0mRtGJrzfoHpL2Av5Ll+A0UZ1 SBEllqzx1qntSPk=; b=C5/p7dm1NSW/24hewx6c+w703Qb1zJkHDw6e/IpXGlv6 rRKQuem/OnyebipspdjmJG/JDLhD8isUi3WJ97IClY18ShCc2v79tHNIYagzo5G2 FAmfx171ZlKeAqjOAAKaYC1dSkdNMq7TAj7AcJsDGE1eI7t6OYxXEJXZhmzW66aY pEaFROgJSj111G2H7DX0WpxyXZKjwa/+e/b2AHBC8UfPNkhN3ZONS964TVoaPHAo O6xO8xuIjsw5iUCwpyWsWjo+XJG6zQBBiHpYoKVBkyqtrTQslNek39RiD4j9ATqc CcG6fqcFxUMbiIQahOPJh5cypTok+5QfywU3PlTAmg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvddutddgheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepkedugfegvdfggefffeefvdfflefgleduhfeufeejieevkedtveefheejffek heevnecuffhomhgrihhnpehfrhgvvgguvghskhhtohhprdhorhhgnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghrnhgusegrrhhnuggsrdgu vg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 0A481B6008F; Tue, 19 Dec 2023 08:53:25 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1350-g1d0a93a8fb-fm-20231218.001-g1d0a93a8 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <9e97eb50-f9a6-4655-9422-fa1106fff97a@app.fastmail.com> In-Reply-To: References: Date: Tue, 19 Dec 2023 13:53:07 +0000 From: "Arnd Bergmann" To: "Dmitry Torokhov" , "Antonios Salios" , "Deepa Dinamani" Cc: rydberg@bitmath.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, "Jan Henrik Weinstock" , =?UTF-8?Q?Lukas_J=C3=BCnger?= Subject: Re: element sizes in input_event struct on riscv32 Content-Type: text/plain On Tue, Dec 19, 2023, at 02:50, Dmitry Torokhov wrote: > Hi Antonious, > > On Thu, Dec 14, 2023 at 11:11:18AM +0100, Antonios Salios wrote: >> Hi all. >> >> I'm having trouble getting evdev to run in a simulated Buildroot >> environment on riscv32. Evtest (and the x11 driver) seems to be >> receiving garbage data from input devices. >> >> Analyzing the input_event struct shows that the kernel uses 32-bit (aka >> __kernel_ulong_t) values for __sec & __usec. >> Evtest on the other hand interprets these variables as 64-bit time_t >> values in a timeval struct, resulting in a mismatch between the kernel >> and userspace. >> >> What would be the correct size for these values on a 32-bit >> architecture that uses 64-bit time_t values? > > I think there is misunderstanding - we do not have *2* 64-bit values on > 32-but architectures. Here is what was done: > > Input: extend usable life of event timestamps to 2106 on 32 bit systems Thanks for forwarding this to me. You are definitely right that the user-space structure is intended to use a pair of __kernel_ulong_t for the timestamp. Usually if an application gets this wrong, it is the result of having copied old kernel headers the source directory that need to be updated. For evtest in particular, I don't see how that is possible, the source code at [1] shows that it just includes the global linux/input.h, which on riscv32 would have to be at least from linux-5.6 anyway because older versions are too old to build a time64 glibc. Antonios, can you check which header was used to build your copy of evtest, and in case this came from /usr/include/linux, which version it corresponds to? Arnd [1] https://gitlab.freedesktop.org/libevdev/evtest/-/blob/master/evtest.c?ref_type=heads