lkml.org 
[lkml]   [2022]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4.9 13/20] x86/speculation/mmio: Add mitigation for Processor MMIO Stale Data
Hi!


> +static int __init mmio_stale_data_parse_cmdline(char *str)
> +{
> + if (!boot_cpu_has_bug(X86_BUG_MMIO_STALE_DATA))
> + return 0;
> +
> + if (!str)
> + return -EINVAL;
> +
> + if (!strcmp(str, "off")) {
> + mmio_mitigation = MMIO_MITIGATION_OFF;
> + } else if (!strcmp(str, "full")) {
> + mmio_mitigation = MMIO_MITIGATION_VERW;
> + } else if (!strcmp(str, "full,nosmt")) {
> + mmio_mitigation = MMIO_MITIGATION_VERW;
> + mmio_nosmt = true;
> + }
> +
> + return 0;
> +}

This is wrong, AFAICT. Returning 0 will pollute init's environment;
Randy was cleaning those lately and we are even seeing them in
-stable. See for example b793a01000122d2bd133ba451a76cc135b5e162c.

The early return 0 should disappear, too; we should validate the
option even on non-buggy machines.

Best regards,
Pavel

--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-06-22 13:50    [W:0.276 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site