From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38F4D1F12F3 for ; Mon, 20 Jan 2025 22:30:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737412217; cv=none; b=GfR2LfjW6ZD+qgdOyjnS5+TWdUcKb3ruAAl4u6r9Y4O3ogYflusRZ/CmrgPSen0gfaKBhZxWrJI745CrogodHzS0PuPunWYm+zJJpQdoQtwdXDExX+vK0e335bmf3TeoKgelkPwapq4E8nCjkWc/1/ihqOI4a5QfczCFzZWxOZ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737412217; c=relaxed/simple; bh=Calbk1oTJhFp6Ps5dLCza1GMY/hydnauuBLB47iVF7A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TyUF1t26nALFKWe08fVhLi2q8MceIysEy1s3IDAq1A8clo+rgmr5p89G4cKWIH8hCLiCWZjUOJClepKGK6A6nPhv7PhxfeaxxsLXNHkTtZl0qLiHR4vxomy3/vxjAwEwuDd1jDjERc0O2MPzl1WO4Q/GK2LuDUrOHMlnt4SInFc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nmKt80w0; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nmKt80w0" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-437a92d7b96so49230255e9.2 for ; Mon, 20 Jan 2025 14:30:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737412213; x=1738017013; darn=vger.kernel.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=B7Jiuwucb2nqU/EXa6A0j9Z+ycFZ6LcsF7tZ7LK/Gug=; b=nmKt80w03Zb+aqcUrYxzKcYeJFwjK9aD+w6hnfQfMqJ6vnbKBZKFIbEPyp4Gj6EK29 NQpTh/HWvbd2dE07DRC+Mgirmr/zB3sWtrD3uPRcq1ghYtht2J9+JBedFArNhnRKcZ7E QbeUbaW8m68+VBWeRahIa7l5xyEUsGW7gKsIheWu6IqSJq5prGNFsYgP4TuMDP4YFnCl wVsPLSQfUxw2K1fTI6VeRgW9DrVh4mSYXVfF19Yx2qnNwHyZdqPBkmPI9AnaUxN6C+Ts bizaeY+CUksq5WjwIPYJcbkF/iyjvg0V4duccyYg+h78dlxpXLgrHwd2BnLf/86kIuWM kPNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737412213; x=1738017013; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=B7Jiuwucb2nqU/EXa6A0j9Z+ycFZ6LcsF7tZ7LK/Gug=; b=lzfiEKSqbycuolEvaeIULcc7lEgslHUlIQ5hYtEajES91w0fHzH8CDHUoVe8GGVKIJ 9aIBxDbVPLETOJLRuys/tAbqcQHEOBJP2D+0yD+l/neCl5ZaMfSw1QJDqqV7viSQZ82l BWO8VQPnQcdzZDU/aHvoMFCwKoQCoOBM/Y5MVnYZlAqILTOPkJ/hn7IG48vLcibb9Lan uqbb1uP4jT0/c8Ug7RdnjBZww46dmCAwuQVdms/ucYmCOvujynmXY34rxJfDMdVSTspf ApeD4Z1ePK5do1Uozp4x26bcR2dGKSI6o7E3iF1P8/rliFlSoEVWwnZ4aJsNbCgubv0S SDkQ== X-Gm-Message-State: AOJu0Yzc/TAz9/GYUhtS/jHoTvj1vz9S4nMMwXYTJ2L6lTbhZur6Ng28 0vnRLC8R5XhgktZ7caaaXtTL5XVf3g+4LCDYNq4u5FoYkw7p4jJC X-Gm-Gg: ASbGncu3t6ifSGILeFi1gkt4u7eyfMoWwVTi+U2tVJxt7H93H2B2CKIPbLZI9Kxwejl oxooURPKqIFHYUkiWRpTG7OyjAHk467+G47dnFMLNyNof4ykkRCSjz2fxnmdlILSgouGXQOBU6r CoW+jSJT/wm/rGtAHvwZwhj6dQHV9lO70SKDMY8ND6jlSC4m3oq50DSF7Y90TmtuaZH4CcPLZzU MlymmqSH8YNNQRxTTk8xXKIhU3PtyRiuyUdIn/LPYXwgVXiupKIWXQwAmIIjjtNjrPvNex6 X-Google-Smtp-Source: AGHT+IEz02UWsMxYPDa1EXn4WgBvgYU5FUwraPxmJnFp0U+ctZurcPKjMyEj74qNg2W3FIV5+UCnjw== X-Received: by 2002:a05:6000:c50:b0:385:f16d:48b4 with SMTP id ffacd0b85a97d-38bf58e813fmr11811429f8f.40.1737412213288; Mon, 20 Jan 2025 14:30:13 -0800 (PST) Received: from grain.localdomain ([5.18.253.97]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf322aa0asm11774771f8f.50.2025.01.20.14.30.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 14:30:12 -0800 (PST) Received: by grain.localdomain (Postfix, from userid 1000) id BA1095A003F; Tue, 21 Jan 2025 01:30:11 +0300 (MSK) Date: Tue, 21 Jan 2025 01:30:11 +0300 From: Cyrill Gorcunov To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: LKML , Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner Subject: Re: [PATCH] posix-clock: drop code duplication using compat_ptr_ioctl Message-ID: References: <4229b992-77ef-404d-b045-8f1ccad1035a@t-8ch.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4229b992-77ef-404d-b045-8f1ccad1035a@t-8ch.de> User-Agent: Mutt/2.2.13 (2024-03-09) On Mon, Jan 20, 2025 at 11:22:52PM +0100, Thomas Weißschuh wrote: ... > > -#ifdef CONFIG_COMPAT > > - .compat_ioctl = posix_clock_compat_ioctl, > > -#endif > > + .compat_ioctl = compat_ptr_ioctl, > > This is not correct on s390. (It wasn't before either, though) > The improved patch below is in my personal queue, but I didn't get > around to actually testing and submitting it yet. Hi, Thomas! Thanks for looking into the patch! I somehow miss why it won't work 'cause compat_ptr_ioctl already does the same conversion as in your code below, no? I miss something obvious? ``` long compat_ptr_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { if (!file->f_op->unlocked_ioctl) return -ENOIOCTLCMD; return file->f_op->unlocked_ioctl(file, cmd, (unsigned long)compat_ptr(arg)); } EXPORT_SYMBOL(compat_ptr_ioctl); ``` > +#ifdef CONFIG_COMPAT > +long ptp_compat_ioctl(struct posix_clock_context *pccontext, unsigned int cmd, > + unsigned long arg) > +{ > + switch (cmd) { > + case PTP_ENABLE_PPS: > + case PTP_ENABLE_PPS2: > + /* These take in scalar arg, do not convert */ > + break; > + default: > + arg = (unsigned long)compat_ptr(arg); Here^^^ > + } > + > + return ptp_ioctl(pccontext, cmd, arg); > +} > +#endif