From: Suzuki.Poulose@arm•com (Suzuki K. Poulose)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v4 4/7] arm64: Handle early CPU boot failures
Date: Wed, 3 Feb 2016 17:23:33 +0000 [thread overview]
Message-ID: <56B23795.5090202@arm.com> (raw)
In-Reply-To: <20160203125735.GA26487@MBP.local>
Hi Catalin,
>> +/* Fatal system error detected by secondary CPU, crash the system */
>> +#define CPU_PANIC_KERNEL 3
>
> Please add braces around these numbers, just in case (I added them
> locally).
OK, I will base my changes on top of the corrections.
>
>> /*
>> + * The booting CPU updates the failed status, with MMU turned off,
>> + * below which lies in head.txt to make sure it doesn't share the same writeback
>> + * granule. So that we can invalidate it properly.
>
> I can't really parse this (it looks like punctuation in the wrong place;
> also "share the same..." with what?).
Sorry it doesn't parse :(. It should have been something like :
"The booting CPU updates the failed status @__early_cpu_boot_status (with
the MMU turned off). It is placed in head.txt to make sure it doesn't
share the same write back granule with anything else while the CPU updates
it."
>> + .macro update_early_cpu_boot_status tmp, status
>> + mov \tmp, lr
>> + adrp x0, __early_cpu_boot_status
>> + add x0, x0, #:lo12:__early_cpu_boot_status
>
> Nitpick: you could use the adr_l macro.
Yes, that looks much better, will keep in mind.
>> @@ -117,7 +131,35 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)
>> pr_err("CPU%u: failed to boot: %d\n", cpu, ret);
>> }
>>
>> + /* Make sure the update to status is visible */
>> + smp_rmb();
>
> Which status? In relation to what?
The secondary_data.status updated by the successful CPUs which have mmu turned on, and
updating the cpu_running. But as Mark pointed out, complete() implies a barrier, hence
won't need it.
>
>> secondary_data.stack = NULL;
>> + status = READ_ONCE(secondary_data.status);
>> + if (ret && status) {
>> +
>> + if (status == CPU_MMU_OFF)
>> + status = READ_ONCE(__early_cpu_boot_status);
>
> You need cache maintenance before reading this.
OK.
Thanks
Suzuki
next prev parent reply other threads:[~2016-02-03 17:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-25 18:06 [PATCH v4 0/7] arm64: Verify early CPU features Suzuki K Poulose
2016-01-25 18:06 ` [PATCH v4 1/7] arm64: Add a helper for parking CPUs in a loop Suzuki K Poulose
2016-01-25 18:07 ` [PATCH v4 2/7] arm64: Introduce cpu_die_early Suzuki K Poulose
2016-01-25 18:07 ` [PATCH v4 3/7] arm64: Move cpu_die_early to smp.c Suzuki K Poulose
2016-01-25 18:07 ` [PATCH v4 4/7] arm64: Handle early CPU boot failures Suzuki K Poulose
2016-02-03 12:57 ` Catalin Marinas
2016-02-03 16:46 ` Mark Rutland
2016-02-03 17:34 ` Catalin Marinas
2016-02-03 17:53 ` Mark Rutland
2016-02-03 18:12 ` Catalin Marinas
2016-02-03 19:31 ` Mark Rutland
2016-02-03 17:23 ` Suzuki K. Poulose [this message]
2016-02-03 17:01 ` Mark Rutland
2016-02-03 17:15 ` Catalin Marinas
2016-02-03 17:24 ` Suzuki K. Poulose
2016-02-03 17:35 ` Mark Rutland
2016-01-25 18:07 ` [PATCH v4 5/7] arm64: Enable CPU capability verification unconditionally Suzuki K Poulose
2016-01-25 18:07 ` [PATCH v4 6/7] arm64: Add helper for extracting ASIDBits Suzuki K Poulose
2016-01-25 18:07 ` [PATCH v4 7/7] arm64: Ensure the secondary CPUs have safe ASIDBits size Suzuki K Poulose
2016-02-09 17:20 ` [PATCH v4 0/7] arm64: Verify early CPU features Will Deacon
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=56B23795.5090202@arm.com \
--to=suzuki.poulose@arm$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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