From: Neeraj Upadhyay <neeraju@codeaurora.org>
To: Will Deacon <will@kernel.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
linux-arm-kernel@lists.infradead.org,
Anshuman Khandual <anshuman.khandual@arm.com>
Subject: Re: [PATCH v2] arm64: Force SSBS on context switch
Date: Mon, 22 Jul 2019 22:02:24 +0530 [thread overview]
Message-ID: <10931ace-f5fb-43cc-77cb-a27f1f3704fe@codeaurora.org> (raw)
In-Reply-To: <20190722160429.wasox4nfl6t5jrew@willie-the-truck>
Hi,
On 7/22/19 9:34 PM, Will Deacon wrote:
> On Mon, Jul 22, 2019 at 08:28:15PM +0530, Neeraj Upadhyay wrote:
>> On 7/22/19 7:23 PM, Marc Zyngier wrote:
>>> +static void ssbs_thread_switch(struct task_struct *next)
>>> +{
>>> + if (likely(!(next->flags & PF_KTHREAD)) &&
>>> + arm64_get_ssbd_state() != ARM64_SSBD_FORCE_ENABLE &&
>>> + !test_tsk_thread_flag(next, TIF_SSBD)) {
>>> + struct pt_regs *regs = task_pt_regs(next);
>>> +
>>> + if (compat_user_mode(regs))
>>> + set_compat_ssbs_bit(regs);
>>> + else if (user_mode(regs))
>>> + set_ssbs_bit(regs);
>>> + }
>>> +}
>>> +
>>> /*
>>> * We store our current task in sp_el0, which is clobbered by userspace. Keep a
>>> * shadow copy so that we can restore this upon entry from userspace.
>>> @@ -471,6 +485,7 @@ __notrace_funcgraph struct task_struct *__switch_to(struct task_struct *prev,
>>> entry_task_switch(next);
>>> uao_thread_switch(next);
>>> ptrauth_thread_switch(next);
>>> + ssbs_thread_switch(next);
>>> /*
>>> * Complete any pending TLB or cache maintenance on this CPU in case
>> Looks good to me.
> I inverted the logic in ssbs_thread_switch() so I could add some comments.
> Please double check:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/commit/?h=for-next/fixes&id=cbdf8a189a66001c36007bf0f5c975d0376c5c3a
>
> Will
Looks good
Thanks
Neeraj
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a
member of the Code Aurora Forum, hosted by The Linux Foundation
_______________________________________________
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:[~2019-07-22 16:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-22 13:53 [PATCH v2] arm64: Force SSBS on context switch Marc Zyngier
2019-07-22 14:58 ` Neeraj Upadhyay
2019-07-22 16:04 ` Will Deacon
2019-07-22 16:32 ` Neeraj Upadhyay [this message]
2019-07-22 16:41 ` Marc Zyngier
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=10931ace-f5fb-43cc-77cb-a27f1f3704fe@codeaurora.org \
--to=neeraju@codeaurora.org \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=marc.zyngier@arm.com \
--cc=mark.rutland@arm.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;
as well as URLs for NNTP newsgroup(s).