From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 ADA0C459AC4; Wed, 30 Sep 2026 07:55:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790754954; cv=none; b=P5ihpH/GE5ObpJGND37WioO64q52bdXQDfEMJsaB1S2AsM7UNTNRhnl1AHwBiWqiRyR6WvZXT3Bye+Jh+hqkvSNTNsYM3r95nrJ4StQfEwvNa3TpN1Nu6EPQw03VYO2k30g84JYrdIYR9VmrFRKcZIMpz494SdF8ZVR7ULgtn4g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790754954; c=relaxed/simple; bh=cwBMrbgvJXrU6jUHOIJVJAfxp+QQ8oRRQFz3Ew/7r2A=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=RKYdCOkf0lcN/FqHG5S2YU7zacC3YrwddvsAp5tSjzH82T5J88JyIVpzxqDxAzrUvgdYfXCRMYvsSw3ZB+Y7WWsAyGZi/QRH7uVG+2UVHGBbkrPmoSWarVP/5GsuBuSyWCSUvwqPSK3zL2B07GgA8Yrb3V01z1OjiEt3JDbHLfg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PEXWQbhT; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PEXWQbhT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 279831F000FF; Wed, 30 Sep 2026 07:55:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1790754952; bh=3A83WqLQprn5b6H5t3n4CWTPEwg+k48YSwSUTlBs4Ec=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=PEXWQbhT9MYlJFyvmHMFKYk2atOL8sNTEfJVIz2DUHK/o59vz9qV+cVeNPEyAr5jM sHK6QTFInakN3Kigofd7hCp9LtzUQxEIA4H3wpdQmb1jlIwRnH/c0PZenVCk8AZHYF 8IIaxypwOmLqaNQ0PZvNoGjVF53cxrXJgVpRz/zbEEc8B5vwallDuPUjvoQ6dI+/pa WmztZ4eprdfMWauBWD+BKP9vzZqOuRJW775RPtmNOHYRfpkK6AK1OJuj69SJvfiVvA VeCT//NBjj/ZzGvEyvF7cEMQtJZoE7+ruI2gEPwIlgcTGL//PanIV2uFjLoPuUQosn NWVeov1TIcMkw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xBpAL-0000000FCJl-38EW; Wed, 30 Sep 2026 07:55:49 +0000 Date: Wed, 30 Sep 2026 08:55:49 +0100 Message-ID: <865wzn41h6.wl-maz@kernel.org> From: Marc Zyngier To: Steffen Eiden Cc: Catalin Marinas , Andreas Grapentin , kvm@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Alexander Gordeev , Arnd Bergmann , Christian Borntraeger , Claudio Imbrenda , David Hildenbrand , Friedrich Welter , Fuad Tabba , Gautam Gala , Hariharan Mari , Heiko Carstens , Hendrik Brueckner , Ilya Leoshkevich , Janosch Frank , Joey Gouly , Nico Boehr , Nina Schoetterl-Glausch , Oliver Upton , Paolo Bonzini , Suzuki K Poulose , Sven Schnelle , Ulrich Weigand , Vasily Gorbik , Will Deacon , Zenghui Yu Subject: Re: [PATCH v8 16/29] arm64: Share arm64 headers with s390 In-Reply-To: <20260930072803.664031-A-seiden@linux.ibm.com> References: <20260918133107.1042730-1-seiden@linux.ibm.com> <20260918133107.1042730-17-seiden@linux.ibm.com> <20260928162345.428362-C-seiden@linux.ibm.com> <20260930072803.664031-A-seiden@linux.ibm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: seiden@linux.ibm.com, catalin.marinas@arm.com, gra@linux.ibm.com, kvm@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, agordeev@linux.ibm.com, arnd@arndb.de, borntraeger@linux.ibm.com, imbrenda@linux.ibm.com, david@kernel.org, fritz@linux.ibm.com, tabba@google.com, ggala@linux.ibm.com, hari55@linux.ibm.com, hca@linux.ibm.com, brueckner@linux.ibm.com, iii@linux.ibm.com, frankja@linux.ibm.com, joey.gouly@arm.com, nrb@linux.ibm.com, oss@nina.schoetterlglausch.eu, oupton@kernel.org, pbonzini@redhat.com, suzuki.poulose@arm.com, svens@linux.ibm.com, Ulrich.Weigand@de.ibm.com, gor@linux.ibm.com, will@kernel.org, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Wed, 30 Sep 2026 08:28:03 +0100, Steffen Eiden wrote: > > On Tue, Sep 29, 2026 at 06:00:12PM +0100, Catalin Marinas wrote: > > On Tue, Sep 29, 2026 at 06:19:20AM +0200, Andreas Grapentin wrote: > > > On Sep 28 26, Steffen Eiden wrote: > > > > On Mon, Sep 28, 2026 at 05:07:52PM +0100, Catalin Marinas wrote: > > > > > On Fri, Sep 18, 2026 at 03:30:53PM +0200, Steffen Eiden wrote: > > > > > > +# Enable all code shared to s390 > > > > > > +KBUILD_CFLAGS += -DARM64_S390_COMMON > > > > > > +KBUILD_AFLAGS += -DARM64_S390_COMMON > > > > > > +KBUILD_CPPFLAGS += -DARM64_S390_COMMON > > > > > > > > > > Do we actually need these defines? They seem only to be used as markers > > > > > for the awk scripts to extract the definitions. Why do we need the C > > > > > preprocessor involved at all? Could we not just have comment markers: > > > > > > > > > > /* ARM64_S390_COMMON_BEGIN */ > > > > > ... > > > > > /* ARM64_S390_COMMON_END */ > > > > > > > > > No technically we do not need those. They could be useful if we find out > > > > that AWK is the wrong tool and move to a C Preprocessor + diff based > > > > approach. > > > > > > > > if the ifdev is not closed the compiler will complain, but an 'arm did > > > > not destroy us' verifiaction tool ( I will send one soonish) could do > > > > the same. > > > > > > iirc the last time we discussed this we didn't think that load-bearing > > > comments were the right tool here. We also briefly floated the idea of > > > using a #pragma region based approach, but in the end we went with the > > > #ifdef preprocessor directives instead, as the least invasive > > > non-comment marker that was available. > > > > The downside is that the macro affects the preprocessed code. We need to > > ensure they don't leak in uapi headers for example. Not a fan of this > > approach but I don't have a better suggestion either. At least we could > > write them as: > > > > #if ARM64_S390_COMMON == 1 > > This is a great idea and an improvement. Thanks. > > @Marc: Shall I sent a v9 of this series or do you want to pick v8 and I > send this as an improvement once picked? Please send a v9. That's invasive enough that it warrants it. > > It would also be useful for the awk scripts look for the paired #endif > > rather than relying on the comment at the end of the line. Otherwise > > it's not really different from just sticking to comments. > > > > Are you suggesting that the AWK scripts should track the #if% and #endif > in the code and warn or reject if the marked endif for the shared code > does not match pairing with the starting #if? That makes sense yes. I'll > investigate and would add this as an improvement later on. I think the suggestion is to teach the script about the #if/#endif nesting, and therefore to not require the trailing comment on #endif (i.e. the script acts as a normal cpp). It should only be a matter of counting the #{if,ifdef}s and #endif past the ARM64_S390_COMMON guard. Thanks, M. -- Without deviation from the norm, progress is not possible.