Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1000147rdb; Mon, 19 Feb 2024 00:18:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUeVNQK4i3r+Cl0UE2swi06z6deKv06R0T2HuVtwvmJ64fqOSwn/db4bVnM7YYKXY7bEWCvwAoNkcCVfLWmYPmuhUZwbjnGEXqtGL2gxQ== X-Google-Smtp-Source: AGHT+IH7774zsvB+2ek/WQbF8I1Tn4GlmvHjBF7OyTCuhpuqAWnRzNcl5GLakiMBol4buvDXtdGu X-Received: by 2002:a17:902:d503:b0:1db:e6f6:e28e with SMTP id b3-20020a170902d50300b001dbe6f6e28emr3198639plg.38.1708330680149; Mon, 19 Feb 2024 00:18:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708330680; cv=pass; d=google.com; s=arc-20160816; b=i/MBh0SZ1Eeils5jsAr0dRTHOMlO3HL6jXTIacAGuBLwphsBSGD7uFvDRPpQtdYGF7 9P5jMloIxjW5qAftb/+ocbcjcLa5kn1Hjqfwso15D0Vf3tfzNG1+kxVA4guNUAWkv6or c6Gvip1h8D7wurfNmBsZ+gsmDqhHVo90M1IN8uaPC1G4MQ9P64l/GKWbLDOcnwjNP+gm lc1K0HWosVJxZIQY4fLDn07EknFSJdsNsaOhEM+RXvlmQj3A3po7PCzl+Ka+ETcocZeB ebrZo3DG8tY+VFCypAuDJDBY41NyaNkD0LVsb5g/NB77mvA7NSy/FXJuI3OIW9GcEBwr NrvA== ARC-Message-Signature: i=2; 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=LF+R2ufZgUyCJvXqnj1dT61AxvaaLi9q1G7F23mtRdU=; fh=skyZE000dcLCVFoSgsJDXRLnsUO+30jdNxFOAXzLUMg=; b=VjOj7hcIpzfJhynrgGrZMaAszZ8JqoLMf6zEqXoEJtJAgSvKTyQVrhc84J7kwDN01O PA0UrRlGwUFquYs6j23X3opAXCcAszS22psog5lFTk5BGcH5sPZTAkWF6bUABMDuGjBC SJfIqpNGV9T8G6+mthOqj9YcoJwqYJwBP5QezTXGJDR7ZcMLAMCYbaVvqt6GY6t7IIHP lMvg+EOl7J7/2+eGW48avfOM++i8hxbn8oqagz/hm2aFPwdvV1rP8MVzsATR2hMUGuCO XHdxkvBw+6tM7WO5E0BLbQAoXwHOBIfVfkinl//riJ0NF9AWuDrNUSWjQGytZWMPZZvp 7/dA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b="iqHr9/Oe"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=RVELYMGV; 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-70901-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70901-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q7-20020a170902a3c700b001db730d3f1bsi4062224plb.610.2024.02.19.00.17.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 00:18:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70901-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b="iqHr9/Oe"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=RVELYMGV; 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-70901-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70901-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 80E88B2454A for ; Mon, 19 Feb 2024 08:02:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 78E1928DC1; Mon, 19 Feb 2024 07:57:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="iqHr9/Oe"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="RVELYMGV" Received: from fhigh3-smtp.messagingengine.com (fhigh3-smtp.messagingengine.com [103.168.172.154]) (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 329D928DA7; Mon, 19 Feb 2024 07:57:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.154 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708329443; cv=none; b=rhvg3bSzgznFnFKUJqmoZTQZ7g6xtnHJkBDPtTaeIwbkq5HEF4+zzkuwjZpzFeGPnzQqCRahxgxrEjAQ71TPGuxBsH3LqFb4SASGg23cUvmtZdXrP8Yvaus8iATNP8r+QSWUcdO6RxKUjS+/lmc+ZmFIpO3uOPRaCb1mgmmqKP4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708329443; c=relaxed/simple; bh=R351teBCaIZBraoQMQ7o6QtixbLRhIaIfdXsiDV0M1Q=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=XWReH2Kp3JGbo3YfN1gzVPVEnMq0wJV40BOewtYiZeyqcEGoP6t+bFuZntEHtPPkRRlB5DVUVsEXHS2jd5ueJhEpTJBQPo06pDnn2qNeF881m3NayGxhryx+t4qewtvixc6QqAf8G6jEChOdKCTXcVAZESNWeRbdjXHJ9119Zro= 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=iqHr9/Oe; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=RVELYMGV; arc=none smtp.client-ip=103.168.172.154 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 mailfhigh.nyi.internal (Postfix) with ESMTP id 2C00711400B4; Mon, 19 Feb 2024 02:57:20 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Mon, 19 Feb 2024 02:57:20 -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=fm3; t=1708329440; x=1708415840; bh=LF+R2ufZgU yCJvXqnj1dT61AxvaaLi9q1G7F23mtRdU=; b=iqHr9/OeA05YA0MFVi47yyPA4z p0Vnyq0ciQoKo7oktZlSJCfpWAS6mHsTgkeY9iVUDUDBFYcaSua/VYZc6nX17zLf pV3GrYWnM2YYmFhEHSqO1838Anp9937ReSQ+PEJPmuRBF0+CTIstqB17fJaoGdG6 lmMtSQGodLUeHOkKSabbe1q4IrNI4z2FVnpJIklZ8PmJNXre8VTLHb8HV+gUsW9E ML4wafDwv9V/j8uVT84rXf0zTdl6cUV4yc/TlXFpmCPMNkcJmUaNNbW/E+Y1V7/v VsG/PLPwI29LKArDc7es2MhEd/KWRyUNoGvTV5gFSZdRf58SUAf8xwin1G5A== 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= fm1; t=1708329440; x=1708415840; bh=LF+R2ufZgUyCJvXqnj1dT61Axvaa Li9q1G7F23mtRdU=; b=RVELYMGVXVqAaJ6dYSgGaFfVZP0hEp+uL+tqNWG4TOwf u9FkFMoaXR5isl3Bwgf3RYKoiA1Nb/XW9NtQ/wSd0xpBHq2WnZ56d6dw1QROIvE+ 75yBDh5cMDImicKx/BifTF9fiTRCC7gF+4V5aUg1hu/POsm1FLrGxDA5L+Zamn0/ 0wUC0nK4BbcXSWsMKmlLQmOSZYjuaKLheFd4/y2iukTZT6IUQF+NadD49WtxOXym LyW7cxMp8YLZ3E2Sy4au4sKnFszGCB7MKtm48wv1ZI6XPmlO5PdbOtqCYQm6JMUY 8kridWV23MBArHrDMcyQlnVfEiV253QchxycDfsuEw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdejgdduudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id B940AB6008D; Mon, 19 Feb 2024 02:57:19 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-144-ge5821d614e-fm-20240125.002-ge5821d61 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <4997c865-fc6f-4d8c-b73f-a649b6257ed0@app.fastmail.com> In-Reply-To: References: <431dd956-ad31-4da8-ad42-34f7380824bb@app.fastmail.com> Date: Mon, 19 Feb 2024 08:56:59 +0100 From: "Arnd Bergmann" To: "Kent Overstreet" Cc: "Calvin Owens" , "Russell King" , "Dave Martin" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "linux-bcachefs@vger.kernel.org" Subject: Re: [PATCH] arm: Silence gcc warnings about arch ABI drift Content-Type: text/plain On Mon, Feb 19, 2024, at 07:25, Kent Overstreet wrote: > On Mon, Feb 19, 2024 at 07:21:11AM +0100, Arnd Bergmann wrote: >> >> This is not something that should ever be passed by value >> into a function. > > Why? Mostly because of the size, as 8 registers (on 32-bit) or 4 registers (on 64 bit) mean that even in the best case passing these through argument registers is going to cause spills if anything else gets passed as well. Passing them through the stack in turn requires the same number of registers to get copied in and out for every call, which in turn can evict other registers that hold local variables. On top of that, you have all the complications that make passing them inconsistent and possibly worse depending on how exactly a particular ABI passes structures: - If each struct member is passed individually, you always need eight registers - bitfields tend to get the compiler into corner cases that are not as optimized - __u64 members tend to need even/odd register pairs on many 32-bit architectures. - on big-endian kernels, two __u64 members are misaligned, which causes them to be in two halves of separate registers if the struct gets passed as four 64-bit regs. I can't think of any platform where passing the structure through a const pointer ends up worse than passing by value. Arnd