From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751963AbdJDLKr (ORCPT ); Wed, 4 Oct 2017 07:10:47 -0400 Received: from foss.arm.com ([217.140.101.70]:59724 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751816AbdJDLKp (ORCPT ); Wed, 4 Oct 2017 07:10:45 -0400 Date: Wed, 4 Oct 2017 12:10:40 +0100 From: Catalin Marinas To: Mark Rutland Cc: Suzuki K Poulose , Will Deacon , linux-kernel@vger.kernel.org, stable@vger.kernel.org, matwey.kornilov@gmail.com, James Morse , Dave Martin , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm64: Enable MRS emulation early Message-ID: <20171004111040.vumbc3bk7sj2enc6@armageddon.cambridge.arm.com> References: <20171004094805.24009-1-suzuki.poulose@arm.com> <20171004101425.GB23092@leverpostej> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171004101425.GB23092@leverpostej> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 04, 2017 at 11:14:26AM +0100, Mark Rutland wrote: > On Wed, Oct 04, 2017 at 10:48:05AM +0100, Suzuki K Poulose wrote: > > Make sure the MRS emulation is enabled early enough, such that the > > early userspace applications (e.g, those run from initrd) could > > use the facility without crashing them. > > > > Fixes: commit 77c97b4ee2129 ("arm64: cpufeature: Expose CPUID registers by emulation") > > Reported-by: Matwey V. Kornilov > > Cc: James Morse > > Cc: Dave Martin > > Cc: Catalin Marinas > > Cc: Will Deacon > > Cc: stable@vger.kernel.org > > Cc: Mark Rutland > > Signed-off-by: Suzuki K Poulose > > This looks sensible, but shouldn't we do the same for other > late_inicalls can affect initrd userspace? > > e.g. armv8_deprecated_init, fpsimd_init, sys_reg_genericv8_init? I think we should, though not all of them are concerned with the user code. For example, fpsimd_init() takes care of the pm/hotplug aspect and nothing to do with user space. That said, making it core_initcall() is probably not a bad thing (just a statement that it is concerned with the core initialisation), as long as all the other infrastructure it registers with is up. For Suzuki's patch, I was thinking of enabling emulation before we register the HWCAP_CPUID bit (setup_elf_hwcaps). However, that means we have to bring it before smp_cpus_done(). It's not really worth it as we don't expect any user space at that point. -- Catalin