From patchwork Thu Apr 11 06:24:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Righi X-Patchwork-Id: 1922385 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VFVFP2X0yz1yYQ for ; Thu, 11 Apr 2024 16:30:49 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1runxK-0001bh-86; Thu, 11 Apr 2024 06:30:42 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1runxE-0001Z4-Nq for kernel-team@lists.ubuntu.com; Thu, 11 Apr 2024 06:30:36 +0000 Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 832A83F188 for ; Thu, 11 Apr 2024 06:30:36 +0000 (UTC) Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-517866a127fso723611e87.1 for ; Wed, 10 Apr 2024 23:30:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712817036; x=1713421836; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dqq+xVDAVHr1dhDol82ZCHed/+y/d7oTJG/HGwdsBH4=; b=srNnCOyV5TW+xc6lK2dYX7mBy4xGi94LqCIsS/27doMhW7t2P6jSpUEx4MkcHHjAFx Yb5k9OeAC/vmY9FngvqWQH3irdxT6rWeEMEJSIbni0d6AAB197PitBUepOmBGie5Mnip e13In0Owjkvv9x2CYHngBsHFSNdcBkd07e0u1EOmlzEDlayuMnDyuHhcSXwEb7E/2O9P T9zHARny5943bh9XvWKDBKx++V+PfMEE0QDUCAYgjpatAcg6RWgrKCxsDPSRwmRUODAE GnJDfK5AC+GXYrWfKTEmmFbGYEWyvZQ1B8O+o3oz4vXWxxasEVb4is2f2U338SevA5HF qePA== X-Gm-Message-State: AOJu0YwEbymhBG4qP3JLJlLkAJvClCAjLBy57nuRoZyZ3RQ8wk+INMAJ JcqhRPAFCI5r6VZ0oNIxFDQkD818tB3Mr2vc3SSr8STcXXKTLF9ScLXEV85A4ZKst1fDqww9GIJ xNOQgPwYnShmYLzU0YTVFKZPOp7Gh21UXz9e8BzOBNxlcuvSfgRS2YHFnoZMBxuADTOmJ9G1p2S QraTUxrN3Aow== X-Received: by 2002:a19:9114:0:b0:516:a686:8ae1 with SMTP id t20-20020a199114000000b00516a6868ae1mr3339863lfd.62.1712817035835; Wed, 10 Apr 2024 23:30:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHb/8Btg3WqhIPouFsZUar7mMG50CGi2Kucg5KUpWBXjMRsoz2x31lqyG70bslEazY508/KpA== X-Received: by 2002:a19:9114:0:b0:516:a686:8ae1 with SMTP id t20-20020a199114000000b00516a6868ae1mr3339842lfd.62.1712817035169; Wed, 10 Apr 2024 23:30:35 -0700 (PDT) Received: from gpd.homenet.telecomitalia.it (host-82-49-69-7.retail.telecomitalia.it. [82.49.69.7]) by smtp.gmail.com with ESMTPSA id la23-20020a170906ad9700b00a5224d9a596sm148108ejb.11.2024.04.10.23.30.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 23:30:34 -0700 (PDT) From: Andrea Righi To: kernel-team@lists.ubuntu.com Subject: [N/U][PATCH 03/11] x86/bugs: Change commas to semicolons in 'spectre_v2' sysfs file Date: Thu, 11 Apr 2024 08:24:16 +0200 Message-ID: <20240411063027.493165-4-andrea.righi@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240411063027.493165-1-andrea.righi@canonical.com> References: <20240411063027.493165-1-andrea.righi@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Josh Poimboeuf BugLink: https://bugs.launchpad.net/bugs/2060909 Change the format of the 'spectre_v2' vulnerabilities sysfs file slightly by converting the commas to semicolons, so that mitigations for future variants can be grouped together and separated by commas. Signed-off-by: Josh Poimboeuf Signed-off-by: Daniel Sneddon Signed-off-by: Thomas Gleixner Signed-off-by: Andrea Righi --- arch/x86/kernel/cpu/bugs.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 01ac18f56147..119c24b47574 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -2694,15 +2694,15 @@ static char *stibp_state(void) switch (spectre_v2_user_stibp) { case SPECTRE_V2_USER_NONE: - return ", STIBP: disabled"; + return "; STIBP: disabled"; case SPECTRE_V2_USER_STRICT: - return ", STIBP: forced"; + return "; STIBP: forced"; case SPECTRE_V2_USER_STRICT_PREFERRED: - return ", STIBP: always-on"; + return "; STIBP: always-on"; case SPECTRE_V2_USER_PRCTL: case SPECTRE_V2_USER_SECCOMP: if (static_key_enabled(&switch_to_cond_stibp)) - return ", STIBP: conditional"; + return "; STIBP: conditional"; } return ""; } @@ -2711,10 +2711,10 @@ static char *ibpb_state(void) { if (boot_cpu_has(X86_FEATURE_IBPB)) { if (static_key_enabled(&switch_mm_always_ibpb)) - return ", IBPB: always-on"; + return "; IBPB: always-on"; if (static_key_enabled(&switch_mm_cond_ibpb)) - return ", IBPB: conditional"; - return ", IBPB: disabled"; + return "; IBPB: conditional"; + return "; IBPB: disabled"; } return ""; } @@ -2724,11 +2724,11 @@ static char *pbrsb_eibrs_state(void) if (boot_cpu_has_bug(X86_BUG_EIBRS_PBRSB)) { if (boot_cpu_has(X86_FEATURE_RSB_VMEXIT_LITE) || boot_cpu_has(X86_FEATURE_RSB_VMEXIT)) - return ", PBRSB-eIBRS: SW sequence"; + return "; PBRSB-eIBRS: SW sequence"; else - return ", PBRSB-eIBRS: Vulnerable"; + return "; PBRSB-eIBRS: Vulnerable"; } else { - return ", PBRSB-eIBRS: Not affected"; + return "; PBRSB-eIBRS: Not affected"; } } @@ -2747,9 +2747,9 @@ static ssize_t spectre_v2_show_state(char *buf) return sysfs_emit(buf, "%s%s%s%s%s%s%s\n", spectre_v2_strings[spectre_v2_enabled], ibpb_state(), - boot_cpu_has(X86_FEATURE_USE_IBRS_FW) ? ", IBRS_FW" : "", + boot_cpu_has(X86_FEATURE_USE_IBRS_FW) ? "; IBRS_FW" : "", stibp_state(), - boot_cpu_has(X86_FEATURE_RSB_CTXSW) ? ", RSB filling" : "", + boot_cpu_has(X86_FEATURE_RSB_CTXSW) ? "; RSB filling" : "", pbrsb_eibrs_state(), spectre_v2_module_string()); }