RE: [PATCH] x86/speculation: Check whether speculation is force disabled

From: Tada, Kenta (Sony)
Date: Tue Jun 16 2020 - 20:15:36 EST


I confirmed that this issue was fixed in the below new patch
https://lore.kernel.org/patchwork/patch/1253799/

Thanks.

-----Original Message-----
From: Tada, Kenta (Sony)
Sent: Friday, June 5, 2020 9:07 PM
To: Waiman Long <longman@xxxxxxxxxx>; x86@xxxxxxxxxx; tglx@xxxxxxxxxxxxx; mingo@xxxxxxxxxx; bp@xxxxxxxxx; hpa@xxxxxxxxx; jpoimboe@xxxxxxxxxx; peterz@xxxxxxxxxxxxx; tony.luck@xxxxxxxxx; pawan.kumar.gupta@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Subject: RE: [PATCH] x86/speculation: Check whether speculation is force disabled

I'm sorry but I could not find the reason of above comments.
I investigated the below log and I thought it was unintentional and the just bug at the moment.
https://lore.kernel.org/lkml/20181125185005.866780996@xxxxxxxxxxxxx/

#define PFA_SPEC_IB_FORCE_DISABLE 6 /* Indirect branch speculation permanently restricted */

But the comment of PFA_SPEC_IB_FORCE_DISABLE apparently explains the expected behavior.
And it is only natural that users can force disable the speculation because of security.

I'll investigate more to explain this patch is needed.
Thank you for the review.


-----Original Message-----
From: Waiman Long <longman@xxxxxxxxxx>
Sent: Friday, June 5, 2020 1:10 AM
To: Tada, Kenta (Sony) <Kenta.Tada@xxxxxxxx>; x86@xxxxxxxxxx; tglx@xxxxxxxxxxxxx; mingo@xxxxxxxxxx; bp@xxxxxxxxx; hpa@xxxxxxxxx; jpoimboe@xxxxxxxxxx; peterz@xxxxxxxxxxxxx; tony.luck@xxxxxxxxx; pawan.kumar.gupta@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: [PATCH] x86/speculation: Check whether speculation is force disabled

On 6/4/20 3:29 AM, Tada, Kenta (Sony) wrote:
>> It conflicts with your new code. We can have an argument on whether
>> IB should follow how SSB is being handled. Before that is settled,
> Thank you for the information.
> It conflicts but I think users who read the below document get confused.
> Documentation/userspace-api/spec_ctrl.rst.
>
> Especially, seccomp users must know the difference of this implicit
> specification because both IB and SSB are force disabled
> simultaneously when seccomp is enabled without SECCOMP_FILTER_FLAG_SPEC_ALLOW on x86.

What I am saying is that you have to make the argument why your patch is the right way to do thing and also make sure that the comment is consistent. Your current patch doesn't do that.

Cheers,
Longman