Re: [RFC PATCH v7 17/23] kernel/entry: Add support for core-wide protection of kernel-mode

From: Vineeth Pillai
Date: Thu Sep 03 2020 - 11:23:50 EST




On 9/3/20 12:34 AM, Joel Fernandes wrote:

Indeed! For at least two reasons, IMO:

1) what Thomas is saying already. I.e., even on a CPU which has HT but
is not affected by any of the (known!) speculation issues, one may want
to use Core Scheduling _as_a_feature_. For instance, for avoiding
threads from different processes, or vCPUs from different VMs, sharing
cores (e.g., for better managing their behavior/performance, or for
improved fairness of billing/accounting). And in this case, this
mechanism for protecting the kernel from the userspace on the other
thread may not be necessary or interesting;
Agreed. So then I should really make this configurable and behind a
sysctl then. I'll do that.
We already have the patch to wrap this feature in a build time and
boot time option:
https://lwn.net/ml/linux-kernel/9cd9abad06ad8c3f35228afd07c74c7d9533c412.1598643276.git.jdesfossez@xxxxxxxxxxxxxxxx/

I could not get to a safe way to make it a runtime tunable at the time
of posting this series, but I think it should also be possible.

Thanks,
Vineeth