linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Suzuki.Poulose@arm.com (Suzuki K. Poulose)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] arm64: Ensure the secondary CPUs have safe ASIDBits size
Date: Mon, 23 Nov 2015 23:48:12 +0000	[thread overview]
Message-ID: <5653A5BC.4020209@arm.com> (raw)
In-Reply-To: <20151123172920.GB1702@arm.com>

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

  reply	other threads:[~2015-11-23 23:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-18 17:03 [PATCH 0/5] arm64: cpufeature: Fixes for 4.4-rc1 Suzuki K. Poulose
2015-11-18 17:08 ` [PATCH 1/5] arm64: cpufeature: Add helpers for extracting unsigned values Suzuki K. Poulose
2015-11-18 17:08   ` [PATCH 2/5] arm64: cpufeature: Track unsigned fields Suzuki K. Poulose
2015-11-19  4:57     ` AKASHI Takahiro
2015-11-19 10:03       ` Suzuki K. Poulose
2015-11-19 10:06         ` Suzuki K. Poulose
2015-11-19 18:45         ` Catalin Marinas
2015-11-20 13:37           ` Suzuki K. Poulose
2015-11-18 17:08   ` [PATCH 3/5] arm64: debug: Treat the BRPs/WRPs as unsigned Suzuki K. Poulose
2015-11-23 17:29     ` Will Deacon
2015-11-18 17:08   ` [PATCH 4/5] arm64: Make fail_incapable_cpu reusable Suzuki K. Poulose
2015-11-18 17:09   ` [PATCH 5/5] arm64: Ensure the secondary CPUs have safe ASIDBits size Suzuki K. Poulose
2015-11-23 17:29     ` Will Deacon
2015-11-23 23:48       ` Suzuki K. Poulose [this message]
2015-11-26 18:13 ` [PATCH 0/5] arm64: cpufeature: Fixes for 4.4-rc1 Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5653A5BC.4020209@arm.com \
    --to=suzuki.poulose@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).