Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp377765lqt; Thu, 6 Jun 2024 06:29:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU+lTJDoBnaKS2VcbCBAIsrMAGVif9LQQ+OqiHHYyTqy3msHZ4JD63W99nP001+5vZKT2N0tJt0SaHn2w0hahFHk5XqLwLv2P2Fwf+8tg== X-Google-Smtp-Source: AGHT+IHQgj8zluISQKABYc/LNsHnMCJi67P4nbzIKReW0XiZ9Lw8n+0GL8iSyUVPL8y3xRWG6fP+ X-Received: by 2002:a50:f60e:0:b0:57a:1dea:f077 with SMTP id 4fb4d7f45d1cf-57a8b6a55dcmr3432913a12.13.1717680565309; Thu, 06 Jun 2024 06:29:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717680565; cv=pass; d=google.com; s=arc-20160816; b=RK9pG/zw2LSTIO7GuBH9QblOoGiemHY7nkohea4IJlwi9swQthh+FzrB8OHW+v5Fka bA4qksxLRXf7wysrFJa/ND8/WHvS8+LNHAhnwxYVzIyjitrD9PCrFM7//5WGxjhm39hW nVKJ4S3g2EdNI04DATU4K/FWCmzki2y733OEJgOMOuL46TajT2nxW8hWmHc5lecDd5l4 q5DHbMDLyvEhHanVdWTHRj+TQIC1ap74mA4C6P5GFYvMDEzlydI4do3Rc2oDFNK8NIwy yGOwiEyvfzFUxM121qu0OHvU2ZK7He5GQTwTveMgTGmoh5pn3B74RjTE76W88riIvEJj 52Hg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject: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=6mFw9xg8rMa8PO3Sip3z29IbOqBV7T4dtI0N1CykVhs=; fh=dYorklXSbEqMVXt+PaLO1cHNeeRfDubjncCQPAXd4qY=; b=TgeD9DB4FWwOdPkcyrZuE9hIB187HH+wSmYJ7bl2ju1RWqRwpGOtXzS3KFI5HZ42iK unpdK22ilxl4XhVTyWI+7tQw3Y/IW3ZL5B2zYQbsVunAjZQr4XazBCpMn9CEgOE0B7Qe WWO7uXCVMqpK8kC0NFAO7tLFJZz3GOSkRoyEcaFBEGf5Fp8Bpbl6W2aKUzg7Jux26SnU ib0Je6yofezdLzjFF2j9XVBJe1rLH0cf3F0/7tjNaNa+u7yDKZ0QuS2h1ep0rcUI08Bv SNymEYrp9uxp5Sp+uDEwCnfTuoo1ZsFDkKCrAhV7kHwdvmHRvdfJQ0ZpOgnbFanH7yr/ aGQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=UbIj6muS; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="FB8M25H/"; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-204365-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204365-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae1fe044si729447a12.238.2024.06.06.06.29.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 06:29:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204365-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=UbIj6muS; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="FB8M25H/"; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-204365-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204365-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0EA111F21EA9 for ; Thu, 6 Jun 2024 13:29:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C379D195FDF; Thu, 6 Jun 2024 13:29:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="UbIj6muS"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="FB8M25H/" Received: from wfout3-smtp.messagingengine.com (wfout3-smtp.messagingengine.com [64.147.123.146]) (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 A8CA9195FD7 for ; Thu, 6 Jun 2024 13:29:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.146 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717680548; cv=none; b=NEc15EgkyKYctBAcw3lrNiyvB2JEstQYCMSv93H9lxbKqw2uEzoO4McHDXV/SxDo0MqIpcKovnT5J7x6Xs1PP90e4HPXDydNxxLOo68CVMfYn8wf9CkS8P8EMmVL7deP7Fq0CVbfJnslBpK8FHSMInhNCVYBRl2rRBn7IbBP/Ro= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717680548; c=relaxed/simple; bh=6mFw9xg8rMa8PO3Sip3z29IbOqBV7T4dtI0N1CykVhs=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To: Subject:Content-Type; b=hQ+Iya06wKYIitq+7zytPpDuI4HQV8egTglq0L86rHMRnjtpI3FbEZV16rq1IUid6yY8YAPSBFCQhC/GiHfFP6N6bIkVgyIDJDsS3Yc/fhEStWlU+CNrFFUugYq8PDnRTCSldBrYXjSrqp4sF4lzAVDJ+BVYodG58FkhLeUR2Kw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=UbIj6muS; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=FB8M25H/; arc=none smtp.client-ip=64.147.123.146 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 mailfout.west.internal (Postfix) with ESMTP id BB9C01C00158; Thu, 6 Jun 2024 09:29:05 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Thu, 06 Jun 2024 09:29:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=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=fm3; t=1717680545; x=1717766945; bh=6mFw9xg8rM a8PO3Sip3z29IbOqBV7T4dtI0N1CykVhs=; b=UbIj6muSiE3/OfHr5FZnb30ZtP 7tjF5JESPYkfPQChJrLYodHo5tRVAWnFFyS0tmHOuBRIoeVJisuJFA8roSGGe5BL FMgrzmZu4j9I2Ey2nwuzFVWWJomhe+yrHyQvtTe4w2F3pkQKN15XRlyxF12e7iaY tBS5F1allUbspA22+DVI2ria3PonOrDt38axYA83ht+oEZRhIuxBj/2i0herJTgS FUNSYBhcQxeFsLlSXi9Q7hcTCL8g5OGbBHMRWKZhRxM0RJyita7NRaLvDqEt0SW0 4YluxKajhwZ4oeii33h0NZhoFrU9IM8IS3GvPzknBb5YP1fuJIYMbNg4XHKQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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= fm1; t=1717680545; x=1717766945; bh=6mFw9xg8rMa8PO3Sip3z29IbOqBV 7T4dtI0N1CykVhs=; b=FB8M25H/2Zvc1KXuAUQqjQXCSnvt2G2AmfJhP2Jc+Od+ AkqDO508Q90dFkZD3wSu6auFVUe2N65mxWxBut8wkvmDTLpM/eAvV54vUyv/2qZ5 64QTjU3vkoYFZUyhN3NksTeBqrO/N7HhGKlYXiBsWdRMS0AJeNvxVl1/aHgHpKpI Aq+Y2c/n0V2A5vRL6y2IUiX2ueweYLQQ01TJHgZp8n/zQG9WG1w8BErJd3awJIs0 s3yAuSrWwHuNyTVUlOYkBQvA3ZwdiI3cmmqcstG9EcEFNNCKGyqkshKMV48STxCf M1wfD0U39aG955rl5Yh7cbM0MAUUsr3ZABbJMxYVKg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdelkedgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffgeffuddtvdehffefleethfejjeegvdelffejieegueetledvtedtudelgfdu gfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 022FEB6008D; Thu, 6 Jun 2024 09:29:04 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-497-g97f96844c-fm-20240526.001-g97f96844 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <74c2e8ee-d2fa-4312-86f5-46e5c6da4047@app.fastmail.com> In-Reply-To: <20240606123908.738733-1-zhe.he@windriver.com> References: <20240606123908.738733-1-zhe.he@windriver.com> Date: Thu, 06 Jun 2024 15:28:02 +0200 From: "Arnd Bergmann" To: "He Zhe" , "Clemens Ladisch" , "Greg Kroah-Hartman" , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] hpet: Support 32-bit userspace Content-Type: text/plain On Thu, Jun 6, 2024, at 14:39, He Zhe wrote: > hpet_compat_ioctl and read file operations failed to handle parameters from > 32-bit userspace and thus samples/timers/hpet_example.c fails as below. > > root@intel-x86-64:~# ./hpet_example-32.out poll /dev/hpet 1 2 > -hpet: executing poll > hpet_poll: HPET_IRQFREQ failed > > This patch fixes cmd and arg handling in hpet_compat_ioctl and adds compat > handling for 32-bit userspace in hpet_read. > > hpet_example now shows that it works for both 64-bit and 32-bit. > > root@intel-x86-64:~# ./hpet_example-32.out poll /dev/hpet 1 2 > -hpet: executing poll > hpet_poll: info.hi_flags 0x0 > hpet_poll: expired time = 0xf4298 > hpet_poll: revents = 0x1 > hpet_poll: data 0x1 > hpet_poll: expired time = 0xf4235 > hpet_poll: revents = 0x1 > hpet_poll: data 0x1 > root@intel-x86-64:~# ./hpet_example-64.out poll /dev/hpet 1 2 > -hpet: executing poll > hpet_poll: info.hi_flags 0x0 > hpet_poll: expired time = 0xf42a1 > hpet_poll: revents = 0x1 > hpet_poll: data 0x1 > hpet_poll: expired time = 0xf4232 > hpet_poll: revents = 0x1 > hpet_poll: data 0x1 > > Cc: stable@vger.kernel.org > Signed-off-by: He Zhe Fixes: 54066a57c584 ("hpet: kill BKL, add compat_ioctl") Reviewed-by: Arnd Bergmann