Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1029095rdb; Mon, 19 Feb 2024 01:40:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXW0U24v8zHO60Ncv2lv5frnRbQe8GTYMGHl8FPreswy1BTmOgA9wSYVtg1lrVlQVlIT4xcZuMWLLojf3s1v3T8VY/J/YgfE3Mq20FhBQ== X-Google-Smtp-Source: AGHT+IFh1fsa31Oi7FyBtYWzZ8pvK76UolQfHA4vYrAtbDfWNTlH4+hycifGtqbHNmODbjTbJBI4 X-Received: by 2002:a05:6a20:d38f:b0:19e:a353:81b0 with SMTP id iq15-20020a056a20d38f00b0019ea35381b0mr11491719pzb.11.1708335619814; Mon, 19 Feb 2024 01:40:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708335619; cv=pass; d=google.com; s=arc-20160816; b=d+dm/R46ifTaVuQ8r2sthPHTFBnsHvLgXpJlcHrNAuoZYC4ijQOAdhc48iXf0MHoHX OqQ/lUY2/9hndnqRBb2LlQifov3IJBopyR4UgTqe/OSDfRs4RFzMyoz3QdJuZ2PgzX4g iCBpHPulniz0DjufxzfctqdoDHpiPpy8fd3BEq42LA34JJdsUq/IpQJCuZPYebGroW9S FYeBQaaoR7x5UgJ6miFczlsWV02ho3ZvaUVrr2SW4ZPw4BfTkYhdC1VXavEwV0txL9/k imX7kIutcLdKNKTxjX8f4nATByRjLjoF0R3rWRS40mvIsCc9amapGUnrvrB1mscLEVmt 7MhA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=ZSvzriXmD4pK+Pgn1DkXZoJ6hH/hBfzEAXXtTbSS1J4=; fh=IZHBYce64hH1mak/H4h3Z5r7a3slSuZk7Q8Sj2d6J2U=; b=ig+1a4A+NCm9vjRkb2GL0c5Kl80GoBunOpiexohF84si9c1OZbiqfqBZAcOw9BaLH3 CTIzDezD9bfrhM36gSYbD6wSGdA7PEN8ZZXUw7tQabmxAhIFwlCiHLx7pio2ViVL/koZ REBBJSumS8Z8/m/T0Rkumsb/JhXhNaNZ3CUvEUo3bJ/RUqfLwitdycMR459D25N5gHFS yLmD2QbdEZPdE4eUQcxM03PbORYgJtt7sVQwozmnZU9ClhmTBE5qsdmxxuwC7C4HBdvg rRBwvWGk+Uqr44vTHLIDWwbz99FXSWF4sbOAmC1oNpm9KyvVt0/Y3Z2XCDGmiRjEP7bJ d4Xw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=HXHbO1Ha; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-71048-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71048-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id om8-20020a17090b3a8800b00298d1d48328si4324429pjb.59.2024.02.19.01.40.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 01:40:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71048-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=HXHbO1Ha; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-71048-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71048-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 7F97C280C41 for ; Mon, 19 Feb 2024 09:40:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A86724B2C; Mon, 19 Feb 2024 09:40:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="HXHbO1Ha" Received: from out-176.mta0.migadu.com (out-176.mta0.migadu.com [91.218.175.176]) (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 4EC4D249E0 for ; Mon, 19 Feb 2024 09:40:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708335611; cv=none; b=uPR0V8RbaTNUxtjit83pVd9T3QVAxJKyb0KlFCnUmCVbsWzfYrToQOdYBHCVNJ6istAtq8ewoYQCBUdRefPckiPoHDYStpw+IkzSeVJCFX84EPBEyVq4tf2ipdH5QK74NyXkJL9AEuGfE9UlVA8yVBWPPw+1Nh4OmxeF1TirXYw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708335611; c=relaxed/simple; bh=iNShBvkReSuu3CObKikmHEsOyAXAVtv2YtxF61VShtk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gOYCpDgpN7hpOXKwOxKWrLRnYNJLz48ZJKMLSELmAItY969yN5JNIh8fsJWJwdcu7QsuVBKWjcsbcMnBJtkmXgbp4YVq9ci5hrFkqXgbTxBdMcVBtc+f99zzQnSb3UND8r3lXDlfFTPDGdfmEHNavl+pkfuiI92s/lVwepjqs/c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=HXHbO1Ha; arc=none smtp.client-ip=91.218.175.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Mon, 19 Feb 2024 04:40:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1708335607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZSvzriXmD4pK+Pgn1DkXZoJ6hH/hBfzEAXXtTbSS1J4=; b=HXHbO1HaXD3vfobQgbk+7mC2negYDTsMZEjy5mJ/qZMuSNKJjUvhQKC+EoIT+r75vI0ESD AxjQsKWW0H3YvwEu30cPRfi0az1/cD7aebrQOd/97d70JvCH9XylQFuCkCsxHTZ2sbaRsw BkEqvNHi97Y8p6skgyxGQVO7wPuByGY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: "Russell King (Oracle)" Cc: Arnd Bergmann , Calvin Owens , 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 Message-ID: References: <431dd956-ad31-4da8-ad42-34f7380824bb@app.fastmail.com> 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=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Mon, Feb 19, 2024 at 09:26:51AM +0000, Russell King (Oracle) wrote: > On Mon, Feb 19, 2024 at 07:21:11AM +0100, Arnd Bergmann wrote: > > I think these should be addressed in bcachefs instead. > > While it's not the fault of bcachefs that the calling > > convention changed between gcc versions, have a look at > > the actual structure layout: > > > > struct bch_val { > > __u64 __nothing[0]; > > }; > > struct bpos { > > /* > > * Word order matches machine byte order - btree code treats a bpos as a > > * single large integer, for search/comparison purposes > > * > > * Note that wherever a bpos is embedded in another on disk data > > * structure, it has to be byte swabbed when reading in metadata that > > * wasn't written in native endian order: > > */ > > #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ > > __u32 snapshot; > > __u64 offset; > > __u64 inode; > > #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ > > __u64 inode; > > __u64 offset; /* Points to end of extent - sectors */ > > __u32 snapshot; > > #else > > #error edit for your odd byteorder. > > #endif > > } __packed > > struct bch_backpointer { > > struct bch_val v; > > __u8 btree_id; > > __u8 level; > > __u8 data_type; > > __u64 bucket_offset:40; > > __u32 bucket_len; > > struct bpos pos; > > } __packed __aligned(8); > > > > This is not something that should ever be passed by value > > into a function. > > +1 - bcachefs definitely needs fixing. Passing all that as an argument > not only means that it has to be read into registers, but also when > accessing members, it has to be extracted from those registers as well. > > Passing that by argument is utterly insane. If the compiler people can't figure out a vaguely efficient way to pass a small struct by value, that's their problem - from the way you describe it, I have to wonder at what insanity is going on there.