From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A065ECDB47E for ; Wed, 18 Oct 2023 12:43:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QHBRqIeWaiKbvnMH0P5rnbc2JtIBsaPqo5E3DR5XPEg=; b=qZxjI4or7vjrpX 1ph+dc8ZFQ3/KBVBHkEdWhRfs0YOr8GBo/Di4Zlr+Itl2KNLLkmsxkrM4imo2HRj47mOAFS0NugSg Qk08SKb6CXe7K4gehmD5NFdHrEG4TiQAxTA3HayjJUhVijX6Ls8CRXGCWtJkqbHkSxTLQgJLkvqip dm8+md1fVhs/hgX4Ugiyb8i7KsUWlSeoOjlczJ2VjEYAEBA6jSCfeFrpvlE/K7CZkBRuQ1L9Yt/tZ 1bwGLHYUS/Cg3G74NBNGInu5HKShCaHinIF7cJ3BGYLUq9Ix7stFYReS220nyEa//Q8WktDdkfovC DpaLhY3esNizK8l7MVhw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qt5td-00EhHK-1r; Wed, 18 Oct 2023 12:43:33 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qt5tb-00EhFn-1H for linux-arm-kernel@lists.infradead.org; Wed, 18 Oct 2023 12:43:32 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id A1D5E617A8; Wed, 18 Oct 2023 12:43:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48DC8C433C7; Wed, 18 Oct 2023 12:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697633010; bh=t6KGVhsRv9EQvvDPyF01PvPCYq3klVc6018BEpDuOZ8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uw3rGon9JgKQ3cXXw/3RwixN7hIdCbSg0K6EueSmE9uhZznP2zFMBVhyJkUHapJ0o sucwDynvUVy1xLKwRWv/c56ZwFSleoNYo0YczouQqbI26CROHSL4dIFjUkD7RZ5mh2 pX9wx8iRd6vvEe3izYgsdcab1bsV3/YLFM7ga9dEqCTcfIlvPck9FKjPeluSuUQLkg WECjs+L97m65RpSv2tqFGJU7oRaPRRXy4rlDthYmc+/m6hYEwjkw482Q2dlkowkQf0 cGntFmpSt6qmVC9UiLnBABhrlveGzDNei6VT6SMPwG+8kk0+/gfgWArCSl6r7CABIR lwV6vkA2RlVaA== 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.95) (envelope-from ) id 1qt5tX-005LrM-OB; Wed, 18 Oct 2023 13:43:28 +0100 Date: Wed, 18 Oct 2023 13:43:27 +0100 Message-ID: <86pm1cm780.wl-maz@kernel.org> From: Marc Zyngier To: Jeremy Linton Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, anshuman.khandual@arm.com, krisman@suse.de, broonie@kernel.org, james.morse@arm.com, ionela.voinescu@arm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] arm64: cpufeature: Change 32-bit EL0 to display enabled cores In-Reply-To: References: <20231017052322.1211099-1-jeremy.linton@arm.com> <20231017052322.1211099-4-jeremy.linton@arm.com> <86ttqpm8lg.wl-maz@kernel.org> 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/29.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: jeremy.linton@arm.com, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, anshuman.khandual@arm.com, krisman@suse.de, broonie@kernel.org, james.morse@arm.com, ionela.voinescu@arm.com, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231018_054331_527072_A6B0C124 X-CRM114-Status: GOOD ( 29.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 17 Oct 2023 20:15:43 +0100, Jeremy Linton wrote: > > Hi, > > On 10/17/23 13:01, Marc Zyngier wrote: > > On Tue, 17 Oct 2023 06:23:22 +0100, > > Jeremy Linton wrote: > >> > >> Now that we have the ability to display the list of cores > >> with a feature when it is selectivly enabled, lets display the > >> cores enabled for 32-bit use at EL0. > >> > >> Signed-off-by: Jeremy Linton > >> --- > >> arch/arm64/kernel/cpufeature.c | 15 +++++++++++++-- > >> 1 file changed, 13 insertions(+), 2 deletions(-) > >> > >> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > >> index b7b67bac0e60..512cbe446b41 100644 > >> --- a/arch/arm64/kernel/cpufeature.c > >> +++ b/arch/arm64/kernel/cpufeature.c > >> @@ -1533,8 +1533,17 @@ static bool has_32bit_el0(const struct arm64_cpu_capabilities *entry, int scope) > >> if (!has_cpuid_feature(entry, scope)) > >> return allow_mismatched_32bit_el0; > >> - if (scope == SCOPE_SYSTEM) > >> - pr_info("detected: 32-bit EL0 Support\n"); > >> + if (scope == SCOPE_SYSTEM) { > >> + struct arm64_cpu_capabilities *has_32bit; > >> + > >> + has_32bit = (struct arm64_cpu_capabilities *)entry; > >> + > >> + has_32bit->cpus = system_32bit_el0_cpumask(); > > > > This seems rather dodgy. 'entry' comes from a static const array which > > will, in all likelihood be mapped R/O pretty soon after the initial > > CPU bringup. Try offlining/onlining a CPU and you should see a > > firework similar to what I have below (I hacked the CnP property, but > > that's no different from what you are doing): > > Yes, dodgy is a good word. The other choices, maintain a mask just for > the print or dump the static key and always use the cpu_32bit_el0_mask > or some combination, weren't much better in the "ick" category. If > anyone sees a better way I'm open to suggestion, although simply > dropping this last patch is fine too. An obvious choice would be to replace the 'cpus' cpumask with a function that evaluates a cpumask stored separately. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel