From: Suzuki K Poulose <Suzuki.Poulose@arm.com>
To: Christoffer Dall <christoffer.dall@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org, marc.zyngier@arm.com,
will.deacon@arm.com, catalin.marinas@arm.com,
linux-kernel@vger.kernel.org, mark.rutland@arm.com
Subject: Re: [PATCH 2/2] arm64: vhe: Verify CPU Exception Levels
Date: Wed, 13 Apr 2016 12:16:26 +0100 [thread overview]
Message-ID: <570E2A8A.5050504@arm.com> (raw)
In-Reply-To: <20160413111424.GA17696@cbox>
On 13/04/16 12:14, Christoffer Dall wrote:
> On Tue, Apr 12, 2016 at 03:46:01PM +0100, Suzuki K Poulose wrote:
>> With a VHE capable CPU, kernel can run at EL2 and is a decided at early
>> boot. If some of the CPUs didn't start it EL2 or doesn't have VHE, we
>> could have CPUs running at different exception levels, all in the same
>> kernel! This patch adds an early check for the secondary CPUs to detect
>> such situations.
>>
>> For each non-boot CPU add a sanity check to make sure we don't have
>> different run levels w.r.t the boot CPU. We save the information on
>> whether the boot CPU is running in hyp mode or not and ensure the
>> remaining CPUs match it.
>>
>> Applies on 4.6-rc3.
>> +#ifdef CONFIG_ARM64_VHE
>> +
>> +extern bool boot_cpu_hyp_mode;
>> +static inline bool is_boot_cpu_in_hyp_mode(void)
>> +{
>> + return boot_cpu_hyp_mode;
>> +}
>
> would it make sense to move this to smp.c to avoid exporting
> boot_cpu_hyp_mode?
Sure, we can.
>
> Note that boot_cpu_hyp_mode is never set without CONFIG_SMP, but that
> shouldn't matter I suppose.
Right. The check will be invoked only by the secondary CPUs. I will
respin it.
Cheers
Suzuki
next prev parent reply other threads:[~2016-04-13 11:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-12 14:46 [PATCH 1/2] arm64: Add cpu_panic_kernel helper Suzuki K Poulose
2016-04-12 14:46 ` [PATCH 2/2] arm64: vhe: Verify CPU Exception Levels Suzuki K Poulose
2016-04-13 11:14 ` Christoffer Dall
2016-04-13 11:16 ` Suzuki K Poulose [this message]
2016-04-13 13:41 ` [PATCH v2 " Suzuki K Poulose
2016-04-14 12:19 ` Christoffer Dall
2016-04-14 12:54 ` Suzuki K Poulose
2016-04-15 13:55 ` 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=570E2A8A.5050504@arm.com \
--to=suzuki.poulose@arm.com \
--cc=catalin.marinas@arm.com \
--cc=christoffer.dall@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=mark.rutland@arm.com \
--cc=will.deacon@arm.com \
/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