[MODERATED] Re: [PATCH 1/2] v3 more sampling fun 1
Andrew Cooper <[email protected]> Wed, 11 Mar 2020 20:28:36 +0000
| Newsgroups | org.kernel.lore.historical-speck |
|---|---|
| Message-ID | <[email protected]> |
On 16/01/2020 22:16, speck for mark gross wrote:
> +static void __init srbds_select_mitigation(void)
> +{
> + u64 ia32_cap;
> +
> + if (!boot_cpu_has_bug(X86_BUG_SRBDS)) {
> + srbds_mitigation = SRBDS_NOT_AFFECTED;
> + return;
> + }
> +
> + if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
> + srbds_mitigation = SRBDS_HYPERVISOR;
> + return;
> + }
These two ought to be reversing (and with a suitable adjustment to the
docs in patch 2).
If you're running as a guest, you can't even trust the model number used
to divine X86_BUG_SRBDS in the first place.
~Andrew