From: Catalin Marinas <catalin.marinas@arm.com>
To: Marc Zyngier <maz@kernel.org>
Cc: swboyd@google.com,
Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
kernel-team@android.com, dianders@google.com,
Will Deacon <will@kernel.org>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2] arm64: Move handling of erratum 1418040 into C code
Date: Wed, 29 Jul 2020 18:12:04 +0100 [thread overview]
Message-ID: <20200729171203.GC24572@gaia> (raw)
In-Reply-To: <20200728092112.3865765-2-maz@kernel.org>
On Tue, Jul 28, 2020 at 10:21:11AM +0100, Marc Zyngier wrote:
> diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
> index 6089638c7d43..87c33f7c536b 100644
> --- a/arch/arm64/kernel/process.c
> +++ b/arch/arm64/kernel/process.c
> @@ -515,6 +515,34 @@ static void entry_task_switch(struct task_struct *next)
> __this_cpu_write(__entry_task, next);
> }
>
> +static void erratum_1418040_thread_switch(struct task_struct *prev,
> + struct task_struct *next)
> +{
> + bool prev32, next32;
> + u64 val;
> +
> + if (!(IS_ENABLED(CONFIG_ARM64_ERRATUM_1418040) &&
> + cpus_have_const_cap(ARM64_WORKAROUND_1418040)))
> + return;
> +
> + prev32 = (!(prev->flags & PF_KTHREAD) &&
> + is_compat_thread(task_thread_info(prev)));
> + next32 = (!(next->flags & PF_KTHREAD) &&
> + is_compat_thread(task_thread_info(next)));
I don't think we need to test PF_KTHREAD. is_compat_thread() checks for
TIF_32BIT and we never set this on kernel threads (they are cloned from
kthreadd).
--
Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-07-29 17:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-28 9:21 [PATCH 0/2] arm64: Allow erratum 1418040 for late CPUs Marc Zyngier
2020-07-28 9:21 ` [PATCH 1/2] arm64: Move handling of erratum 1418040 into C code Marc Zyngier
2020-07-28 11:04 ` Sai Prakash Ranjan
2020-07-28 20:04 ` Stephen Boyd
2020-07-29 9:00 ` Marc Zyngier
2020-07-29 17:12 ` Catalin Marinas [this message]
2020-07-28 9:21 ` [PATCH 2/2] arm64: Allow booting of late CPUs affected by erratum 1418040 Marc Zyngier
2020-07-28 11:05 ` Sai Prakash Ranjan
2020-07-28 20:04 ` Stephen Boyd
2020-07-29 9:34 ` Suzuki K Poulose
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=20200729171203.GC24572@gaia \
--to=catalin.marinas@arm.com \
--cc=dianders@google.com \
--cc=kernel-team@android.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.org \
--cc=saiprakash.ranjan@codeaurora.org \
--cc=suzuki.poulose@arm.com \
--cc=swboyd@google.com \
--cc=will@kernel.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