Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1132896pxj; Fri, 4 Jun 2021 06:52:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZkzDGlcvYFMPqns0z61t1m0iLP2H4LABEKUIQ/JWaLCNKBhUY6sGiRjawHaI1MfIto3BQ X-Received: by 2002:a17:906:1815:: with SMTP id v21mr4317584eje.376.1622814736236; Fri, 04 Jun 2021 06:52:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622814736; cv=none; d=google.com; s=arc-20160816; b=Ww8lThqfsq7GmCFm2Kq7UqnCImwOSRpspd63C3uD1JD+8CelEj8snYJlylmN5m3Bv3 0E3WLu+IIxdDZ6pldOlT9E/hHI2JIXzYVmq40saABBjTgHtjE0DQfXkNxc66mUoFQvMh 0Q1PHtzjecZqKwUMHOTRe1ol4DcLRA2J0dygDU77DSypOLPlBX39B8r30Z7tFxrYM+rM UHYGFv19Fk72BP/jXnqMXZhnXeznWZqcuFoG1SjoJjTqUn8Ord2K5QVZESB2d8RDgKso SL0UVUkNh5Tgepib8cCVpbltvwCIquJFT4xbeSA9DwUL1OgO/8+/L4mvOIFPBiN2NoVy FLUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=65VZWlJExoUoFmP2KVbrzqoDEt4d9eCeysaOLYSj7Oo=; b=jhC4D1aZ0NKkxFsDQuTavCi5toXO0FwcfsqzxxxD6W4LsEli1jv6iixsv4cdUfZKs3 ukt+TkRFgSLZTwmy5hhl8MM9tuQbwHqmuJAhJAxm8Vv7cz8Ym2A9H1UvQpUQye2DXIJ8 Hap8EvTnwFFj81nUAwkKFY/7wF1TrZa71yaG8Xblpn+p/mz9SlZ5UD4xm5zytFCwzZsT xkewFl7x2y+H+MAS4FNq+cts5A0leg5HLLu8Y3I9o6oyRK9eXTAKpGlSZDklli004xjO Ei56z7ifNkXnUW7DpMVtUEsGB3SLGKAxQjtYTGDpAPnQnp0EXfWvNMyhTabJfwfqNhsg KBZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tuGi9PZa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v1si5608007ejd.643.2021.06.04.06.51.53; Fri, 04 Jun 2021 06:52:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tuGi9PZa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230281AbhFDNw1 (ORCPT + 99 others); Fri, 4 Jun 2021 09:52:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:33790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230124AbhFDNw0 (ORCPT ); Fri, 4 Jun 2021 09:52:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 32DF9613C9; Fri, 4 Jun 2021 13:50:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622814640; bh=K/GY5g+siZhU8v4b9BjhoSm+Dq5y6/LVafctSr5ng7M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tuGi9PZakCL+fNw4WVIFTAUpGmeNIybdPOKJFFJC5ku5rdXeW5h+ZX58GLu00B9OY i2NrTyCO0YUn2C6PUJ+Td35BwvFrRUm9PjzSK48kXJ29qsVs4fp1JDGeF5r6D1c4WI cbwEWgvAFyHboCzZIyKX08XxYOWRNy6PQN/ZGWVFcSe77GLdBQ5LW29xFevZodXr6L LHsaZ5JJXGqq/n7ygGIRolH2hOF4JjgRd+Vww5zMG0rAM1kngHUZI3RT2RpNpQX3kR T46/bL7CIVZDfkVWxXa3KObEC5CIEaX/6nY+7+VJttaovuoSFQuthSUupnhdppyly6 NrIFRbX8xMM8A== Date: Fri, 4 Jun 2021 14:50:33 +0100 From: Will Deacon To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Catalin Marinas , Marc Zyngier , Greg Kroah-Hartman , Peter Zijlstra , Morten Rasmussen , Qais Yousef , Suren Baghdasaryan , Quentin Perret , Tejun Heo , Johannes Weiner , Ingo Molnar , Juri Lelli , Vincent Guittot , "Rafael J. Wysocki" , Dietmar Eggemann , Daniel Bristot de Oliveira , Valentin Schneider , kernel-team@android.com Subject: Re: [PATCH v8 02/19] arm64: Allow mismatched 32-bit EL0 support Message-ID: <20210604135033.GB2793@willie-the-truck> References: <20210602164719.31777-1-will@kernel.org> <20210602164719.31777-3-will@kernel.org> <20210603123715.GA48596@C02TD0UTHF1T.local> <20210603174413.GC1170@willie-the-truck> <20210604093808.GA64162@C02TD0UTHF1T.local> <20210604110526.GF2318@willie-the-truck> <20210604120352.GA67240@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210604120352.GA67240@C02TD0UTHF1T.local> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 04, 2021 at 01:04:27PM +0100, Mark Rutland wrote: > On Fri, Jun 04, 2021 at 12:05:27PM +0100, Will Deacon wrote: > > On Fri, Jun 04, 2021 at 10:38:08AM +0100, Mark Rutland wrote: > > > On Thu, Jun 03, 2021 at 06:44:14PM +0100, Will Deacon wrote: > > > > On Thu, Jun 03, 2021 at 01:37:15PM +0100, Mark Rutland wrote: > > > > > On Wed, Jun 02, 2021 at 05:47:02PM +0100, Will Deacon wrote: > > > > > > diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h > > > > > > That said. I reckon this could be much cleaner if we maintained separate > > > > > caps: > > > > > > > > > > ARM64_ALL_CPUS_HAVE_32BIT_EL0 > > > > > ARM64_SOME_CPUS_HAVE_32BIT_EL0 > > > > > > > > > > ... and allow arm64_mismatched_32bit_el0 to be set dependent on > > > > > ARM64_SOME_CPUS_HAVE_32BIT_EL0. With that, this can be simplified to: > > > > > > > > > > static inline bool system_supports_32bit_el0(void) > > > > > { > > > > > return (cpus_have_const_cap(ARM64_ALL_CPUS_HAVE_32BIT_EL0)) || > > > > > static_branch_unlikely(&arm64_mismatched_32bit_el0)) > > > > > > > > Something similar was discussed in November last year but this falls > > > > apart with late onlining because its not generally possible to tell whether > > > > you've seen all the CPUs or not. > > > > > > Ah; is that for when your boot CPU set is all AArch32-capable, but a > > > late-onlined CPU is not? > > > > > > I assume that we require at least one of the set of boot CPUs to be > > > AArch32 cpable, and don't settle the compat hwcaps after userspace has > > > started. > > > > Heh, you assume wrong :) > > > > When we allow the mismatch, then we do actually defer initialisation of > > the compat hwcaps until we see a 32-bit CPU. That's fine, as they won't > > be visible to userspace until then anyway (PER_LINUX32 is unavailable). > > That sounds quite scary, to me, though I don't have a concrete problem > to hand. :/ > > Do we really need to support initializing that so late? For all other > caps we've settled things when the boot CPUs come up, and it's > unfortunate to have to treat this differently. I think it's the nature of the beast, unfortunately. Since we're talking about multiple generations of SoCs rather than just one oddball design, then placing artificial restrictions on the boot CPUs doesn't feel like it will last very long. > I'll go see if there's anything that's liable to break today. Please let me know if you find anything. Will