Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3987686imm; Mon, 17 Sep 2018 06:31:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYlcAuv2bbS9/r+89/mieBfbcEfshLVLZTRfqdPEBqOGEPQcHF8pzMp4aJ8fPG4k4GTlIxM X-Received: by 2002:a63:fe4d:: with SMTP id x13-v6mr23489311pgj.152.1537191106656; Mon, 17 Sep 2018 06:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537191106; cv=none; d=google.com; s=arc-20160816; b=QGP2slPWZe0sgeFnpbyEBAhhJ98cVO1wtig7qT3HyBlfuct5Mtnuu4cOJ4ugeCo8mL T1G8iPPSQXk1vvg3vYFI8sSPqc/i9ulf/1cre52XqIdfCEaCgZM4HSq6eX/NemhgqcZM kyP1ZvCgJReK9EH6yCPj+cdOwXzyW32yWgSQq5z2peYMqEn6MLeJekkIJMypfVj2y14e fY3ic8ruaW3Qza1JXmf9n/ZuL3Ve8tPld03qhO3kouEBgG9rJHcuIPU7fSd3hrtdxVga QS0Bw8yuL7kpNoB5OQk20MQNoQD/03Ov7mCRM6nDcHH3KzBnlxZDMkN+Jzaey/r7rCaF G2tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=3hsU1dkNht9klYQkt9LlTCbQu3/CEdt5s5YUhaZCeMU=; b=aI7KoFt9h1mD+APaUGKiJ74Qzo2tu3oXs1VGZO/tSHgGe0ZEI70KBBmG445MXw6s+M MbY+N7Y8rC5958Frkk7pbxNpqU9dTEsKCJ/sbmU1Pk9WokBBnThcM1V/fArNTdQdDRPz qNH5L9orPIthHHY/t7vpp7jXDiC71nLdMvi55cTSn1CuEao0l7nRe4HFRsAaUAKFvcBr v+uVy+aSZEq94wGwCBrM4AHFM/OM8MtEZ6Mn01uNxv7lPU0WRdEQ347H0BMSkXE7eOKd 9GsoQLyj4P1ifP/klyqeAKBaPB8Bi2lGHYs8O7alSVzGWy93to0BryoX+zgImc0ZDr9n YeOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c17-v6si14877344pgg.628.2018.09.17.06.31.23; Mon, 17 Sep 2018 06:31:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728612AbeIQS5r (ORCPT + 99 others); Mon, 17 Sep 2018 14:57:47 -0400 Received: from foss.arm.com ([217.140.101.70]:59082 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728605AbeIQS5q (ORCPT ); Mon, 17 Sep 2018 14:57:46 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ED36915AD; Mon, 17 Sep 2018 06:30:25 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BF0393F557; Mon, 17 Sep 2018 06:30:25 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 591301AE3063; Mon, 17 Sep 2018 14:30:44 +0100 (BST) Date: Mon, 17 Sep 2018 14:30:44 +0100 From: Will Deacon To: Mian Yousaf Kaukab Cc: marc.zyngier@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robert.richter@cavium.com, cwu@amperecomputing.com Subject: Re: [PATCH RESEND 5/6] arm64: add sysfs vulnerability show for speculative store bypass Message-ID: <20180917133043.GD23040@arm.com> References: <20180827143310.641-1-ykaukab@suse.de> <20180827143310.641-6-ykaukab@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180827143310.641-6-ykaukab@suse.de> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 27, 2018 at 04:33:09PM +0200, Mian Yousaf Kaukab wrote: > Return status based no ssbd_state. Return string "Unknown" in case > CONFIG_ARM64_SSBD is disabled or arch workaround2 is not available > in the firmware. > > Signed-off-by: Mian Yousaf Kaukab > --- > arch/arm64/kernel/cpu_errata.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c > index 8469d3be7b15..8b60aa30a3fa 100644 > --- a/arch/arm64/kernel/cpu_errata.c > +++ b/arch/arm64/kernel/cpu_errata.c > @@ -744,4 +744,24 @@ ssize_t cpu_show_spectre_v2(struct device *dev, struct device_attribute *attr, > return sprintf(buf, "Not affected\n"); > } > > +ssize_t cpu_show_spec_store_bypass(struct device *dev, > + struct device_attribute *attr, char *buf) > +{ > + switch (arm64_get_ssbd_state()) { > + case ARM64_SSBD_MITIGATED: > + return sprintf(buf, "Not affected\n"); > + > + case ARM64_SSBD_KERNEL: > + case ARM64_SSBD_FORCE_ENABLE: > + return sprintf(buf, > + "Mitigation: Speculative Store Bypass disabled"); > + > + case ARM64_SSBD_FORCE_DISABLE: > + return sprintf(buf, "Vulnerable\n"); > + > + default: /* ARM64_SSBD_UNKNOWN*/ > + return sprintf(buf, "Unknown\n"); > + } > +} This probably wants extending for CPUs that support SSBS (see for-next/core). Will