Received: by 10.223.176.5 with SMTP id f5csp3846884wra; Mon, 29 Jan 2018 21:06:19 -0800 (PST) X-Google-Smtp-Source: AH8x224T5jhzwdY1+evf4QSNQV2+jBav5Dk+X+1Vs6RBI8r1yW16zvRcM/uJoSBdb8nxgMIEI0LU X-Received: by 10.99.163.96 with SMTP id v32mr22624458pgn.432.1517288779029; Mon, 29 Jan 2018 21:06:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517288778; cv=none; d=google.com; s=arc-20160816; b=x45ttE1BoGBlw3To+HCh8kVHyYmkLaX67K+sROzyuNaswOvSc7oyno6B6agPelG19X JO8B392G332tJI0rK0f8wEnbIEpxUE+JP+v2i+JZn4JJj6+sHHvofrimrs5KWOGGi7up a7G3xh4nAC6XE7itQHDNtqEkNFNsfkLpVQppL+h37oqweZ/VhNUn3+Yxg2x6r/IOJ6lM psdMsYkj6+IDFk0hmzRjjCaK9WPQlD0RVc4IvPXwHS6vFrwk1FlfYzvqCpirudgdpAtI WK5IxQG+5R4XzfETL8lGLA5+dAHhg139cDbhLH1OCfzS+gkEbVcHuesb83DPyJeSy6tp G5CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:cc:to:arc-authentication-results; bh=xiwYEj0hfEuad17RfOtZrnpH3sXvctCUe0UGWcdwV/4=; b=K+8Mx9LeH9kKx5TbW+krPwzhJ2zoVN7a1jIH5P5AXm5/MAHiJmu8sFwYBeYKDK56XJ FatKVFebj1vaYi+DZx0Z/5Ykw3nBeBrs4+O9mRzcbdzHYpn/TvbqcvtnHglmnO8RHjgv a0Ukp7fuYerptXnfFYVX28laCokOGOlDHg6RsPERihwH18IPcb+qJAHmn5KygcEasuo8 piUxzoqb2kMjZ9wDX/4qR+PDZYQ+uDw7MexOaBNrgLjZHc3eqmyZxEBo9Q8BvQPldtPp SR1CTHuUoUZEjIuH1slLcHSBOTla2WvTWxxAEPFJynFs9ycBYyvDHytSiLwDlqzDNIQt VJvA== 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 i128si8478337pgd.201.2018.01.29.21.05.53; Mon, 29 Jan 2018 21:06:18 -0800 (PST) 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 S1752603AbeA3FFT (ORCPT + 99 others); Tue, 30 Jan 2018 00:05:19 -0500 Received: from mgwym04.jp.fujitsu.com ([211.128.242.43]:49796 "EHLO mgwym04.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751672AbeA3FFS (ORCPT ); Tue, 30 Jan 2018 00:05:18 -0500 X-Greylist: delayed 674 seconds by postgrey-1.27 at vger.kernel.org; Tue, 30 Jan 2018 00:05:18 EST Received: from yt-mxoi2.gw.nic.fujitsu.com (unknown [192.168.229.69]) by mgwym04.jp.fujitsu.com with smtp id 1cb1_1d5b_7d6b3c5e_cc49_41ca_bbd6_a3bd41d994e0; Tue, 30 Jan 2018 13:53:58 +0900 Received: from g01jpfmpwyt01.exch.g01.fujitsu.local (g01jpfmpwyt01.exch.g01.fujitsu.local [10.128.193.38]) by yt-mxoi2.gw.nic.fujitsu.com (Postfix) with ESMTP id 7C9D3AC0075 for ; Tue, 30 Jan 2018 13:53:57 +0900 (JST) Received: from g01jpexchyt37.g01.fujitsu.local (unknown [10.128.193.4]) by g01jpfmpwyt01.exch.g01.fujitsu.local (Postfix) with ESMTP id CFA4D6D66CA for ; Tue, 30 Jan 2018 13:53:56 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v2.5.2 X-SHieldMailCheckerPolicyVersion: FJ-ISEC-20170217-enc X-SHieldMailCheckerMailID: fa0f78a204934e43881b21e338bc1bce To: CC: "Misono, Tomohiro" From: "Misono, Tomohiro" Subject: Question about dmesg/sysfs output when retpoline config is disabled Message-ID: <00bcb291-2b99-1122-9eb3-13c191fa3a5b@jp.fujitsu.com> Date: Tue, 30 Jan 2018 13:52:46 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-SecurityPolicyCheck-GC: OK by FENCE-Mail X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, I think dmesg/sysfs output messages are not suitable if retpoline config is off: I intentionally compiled the kernel 4.15.0 with CONFIG_RETPOLINE=n for test and boot it with the following kernel command line option to check dmesg/sysfs: (a) no command line option or "spectre_v2=on" or "spectre_v2=auto" $ dmesg | grep -i spectre [ 0.017714] Spectre V2 mitigation: Vulnerable: Minimal generic ASM retpoline $ cat /sys/devices/system/cpu/vulnerabilities/spectre_v2 Minimal generic ASM retpoline (b) "spectre_v2=off" $ dmesg | grep -i spectre [ 0.017002] Spectre V2 mitigation: disabled on command line. $ cat /sys/devices/system/cpu/vulnerabilities/spectre_v2 Vulnerable (c) "spectre_v2=retpoline" $ dmesg | grep -i spectre [ 0.018002] Spectre V2 mitigation: kernel not compiled with retpoline; no mitigation available! $ cat /sys/devices/system/cpu/vulnerabilities/spectre_v2 Vulnerable I think the output of (c) is correct for this case, or are these outputs actually right? Also, the output of (a) is the same with following condition: (1) CONFIG_RETPOLINE=n, and (2) CONFIG_RETPOLINE=y but the compiler did not support retpoline These cannot be distinguished unless option of (c) is explicitly used. Regards, Tomohiro Misono