Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3364691pxj; Mon, 24 May 2021 05:11:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAYvfD9bMY6XlSdtIT3FlFpNGrc2VBnj7nPQmYg0o8Mw/xcc21zLP4AbZYQH6REWe6DhsX X-Received: by 2002:a92:cb42:: with SMTP id f2mr15593318ilq.71.1621858266873; Mon, 24 May 2021 05:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621858266; cv=none; d=google.com; s=arc-20160816; b=FpIgM1SEpGMydJ93bT1FRr1tu2CF0vU+PD3h6MgjUqXzdN7nzwlJuPwK2fCuOsi23H XrdWcR4dKQqggIE5nqZxvuQfsTckBXZmQvsZS71zaaWRNmGaMqtTKxxBpktmMg7OEWbe QuksfyRfcY2qphgfI1M32DpWxsw6wV8Li9dsSIYDFr5LiRt/u2+1Pa1796W1HNLC99Ve M0vh8T9DNuY9cYs8v1whVsENPqjykZ7gyIYWzXfTgrWoMxaiq8KbMQA03G7TnBNRcPBP aWare3Xnv9vi98o4aK0QtaACLH4C9AWNeXSzPT9qWlhLpmbyawFyBty+oydoh6zTRa3M Dn0g== 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=4BQgs8KAgbghjATkfQme0+tm7MheFhb4fqva0AdyzgU=; b=tfDRJ6vnx55BR7bqtKRGfZUoJZty/mV4NxoDlorlxJZhcZucDnR2a8T3pI3ihbw20i y7Er95h1G7DhjlJ0j/x+DAvF7Uvq6IGlh6YWHSQofld9/dVR1B+CPh9DPPqwtKTQclOT 8H5ZF27TikLwmMpmQ/PJdvrXt07PJholKTkuuaLd8WkQeTrah1uQKYbKhQgTq7UhlGwR ZcakpS5nsCLcizIHdPIRAoRjdO2BYmR7AILgHEgzJXv26oysvJdH9ZJ54RwM6XRc1S8A t+x/k3IZua9ENzMQ/rvFI+f9p+KrAsNgbSvsspIOchCSNnGy4GrgOjy9WIYzLmnVgOso Yq9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vesc9sRD; 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 q7si13049673jaj.88.2021.05.24.05.10.52; Mon, 24 May 2021 05:11:06 -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=Vesc9sRD; 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 S232685AbhEXMLe (ORCPT + 99 others); Mon, 24 May 2021 08:11:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:52254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232662AbhEXMLe (ORCPT ); Mon, 24 May 2021 08:11:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 03CD9610A6; Mon, 24 May 2021 12:10:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621858206; bh=FKrYa9wRIMDhYZ616MV0mGehueLTvFDWOr+340TGuqA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Vesc9sRDCdI2+F9Nqo5LUge6k+kq8/zXd6yY2lML3vjNbzJqm5aFpnJmgKEJey4L7 oE58PDkTRRImcuawBLkvaCkK7YTyHhSWVSPkqxzlF6/XT7bPnxt7hwnCDhojSpT2G5 yDHYlBpl+Aktln9aiELBHf+khHFC5lrBXUuvSwaTI0FPYBMUnmv4/okfVaRnnLOAI2 GtI44mWwa4nA8YhrYOO+NYjPRZ9ocj8kBYAXfI0WSXsxSb5j+ezYKJgEvt1ECybPAC MBhHlBDHbpukX5ulb7lIawVxd8sNrM49Un9AZfxoKGeFMO1T2mvTyOfRzBwKIjvsc0 r/8mzil5vgiSg== Date: Mon, 24 May 2021 13:09:59 +0100 From: Will Deacon To: Catalin Marinas Cc: linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Marc Zyngier , Greg Kroah-Hartman , Peter Zijlstra , Morten Rasmussen , Qais Yousef , Suren Baghdasaryan , Quentin Perret , Tejun Heo , Li Zefan , Johannes Weiner , Ingo Molnar , Juri Lelli , Vincent Guittot , "Rafael J. Wysocki" , kernel-team@android.com Subject: Re: [PATCH v6 02/21] arm64: Allow mismatched 32-bit EL0 support Message-ID: <20210524120959.GB14913@willie-the-truck> References: <20210518094725.7701-1-will@kernel.org> <20210518094725.7701-3-will@kernel.org> <20210521104155.GC6675@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210521104155.GC6675@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 21, 2021 at 11:41:56AM +0100, Catalin Marinas wrote: > On Tue, May 18, 2021 at 10:47:06AM +0100, Will Deacon wrote: > > +static int enable_mismatched_32bit_el0(unsigned int cpu) > > +{ > > + struct cpuinfo_arm64 *info = &per_cpu(cpu_data, cpu); > > + bool cpu_32bit = id_aa64pfr0_32bit_el0(info->reg_id_aa64pfr0); > > + > > + if (cpu_32bit) { > > + cpumask_set_cpu(cpu, cpu_32bit_el0_mask); > > + static_branch_enable_cpuslocked(&arm64_mismatched_32bit_el0); > > It may be worth only calling static_branch_enable_cpuslocked() if not > already set, in case you try this on a system with lots of CPUs. static_key_enable_cpuslocked() already checks this early on, so I don't think we need another check here (note that we're not calling stop_machine() here _anyway_; the '_cpuslocked' suffix just says that we're already holding cpu_hotplug_lock via the notifier). Will