From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751570AbbKWXsQ (ORCPT ); Mon, 23 Nov 2015 18:48:16 -0500 Received: from eu-smtp-delivery-143.mimecast.com ([207.82.80.143]:23784 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750874AbbKWXsP convert rfc822-to-8bit (ORCPT ); Mon, 23 Nov 2015 18:48:15 -0500 Subject: Re: [PATCH 5/5] arm64: Ensure the secondary CPUs have safe ASIDBits size To: Will Deacon References: <1447866238-22970-1-git-send-email-suzuki.poulose@arm.com> <1447866540-23207-1-git-send-email-suzuki.poulose@arm.com> <1447866540-23207-5-git-send-email-suzuki.poulose@arm.com> <20151123172920.GB1702@arm.com> Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, mark.rutland@arm.com, ard.biesheuvel@linaro.org, linux-kernel@vger.kernel.org, takahiro.akashi@linaro.org From: "Suzuki K. Poulose" Message-ID: <5653A5BC.4020209@arm.com> Date: Mon, 23 Nov 2015 23:48:12 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20151123172920.GB1702@arm.com> X-OriginalArrivalTime: 23 Nov 2015 23:48:12.0810 (UTC) FILETIME=[6A491EA0:01D12649] X-MC-Unique: 017rYN2GTja-TYeVxTpi1Q-1 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/11/15 17:29, Will Deacon wrote: > On Wed, Nov 18, 2015 at 05:09:00PM +0000, Suzuki K. Poulose wrote: >> The ID_AA64MMFR0_EL1:ASIDBits determines the size of the mm context >> id and is used in the early boot to make decisions. The value is >> picked up from the Boot CPU and cannot be delayed until other CPUs >> are up. If a secondary CPU has a smaller size than that of the Boot >> CPU, things will break horribly and the usual SANITY check is not good >> enough to prevent the system from crashing. Prevent this by failing CPUs with >> ASID smaller than that of the boot CPU. ... >> + pr_crit("CPU%d: will not boot\n", cpu); > > This is less informative than the current message (whcih describes the > missing capability). The missing capability is printed by the caller (Patch 4/5) and see below for the new user. ID_AA64MMFR0_ASID_SHIFT); >> + if (asid_cur < asid_boot) { >> + pr_crit("CPU%d: has incompatible ASIDBits: %u vs Boot CPU:%u\n", >> + cpu, asid_cur, asid_boot); >> + fail_incapable_cpu(); >> + } > > Hmm. Whilst we want to ensure that secondary CPUs don't have a smaller > ASID size than the boot CPU, can we actually guarantee that a smaller > value for ID_AA64MMFR0.ASIDBits corresponds to fewer bits? We're > probably better off assuming 8-bit ASIDs unless ASIDBits == 2 (which is > what the ASID allocator does). Right, I already have a reworked version, which does the same and moves it back to verify_local_cpu_capabilities(). I will send it tomorrow. Cheers Suzuki