Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp229208imj; Fri, 15 Feb 2019 22:27:43 -0800 (PST) X-Google-Smtp-Source: AHgI3IaZ8WCoVYNV2/O2TDpaecLrAxHmd8ZMu6Tf9Fkz3tFCtmMLkGByD2JcKkr3mhcZd2kK67DI X-Received: by 2002:a63:fb42:: with SMTP id w2mr8985555pgj.408.1550298463761; Fri, 15 Feb 2019 22:27:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550298463; cv=none; d=google.com; s=arc-20160816; b=uYpCN+89clX4uIQAfB+T73s8FW3Z/7H8aX6Ii16m+GIgqbPA5xxsVgUSpRd7MIJRLK efaiNXrDZHMPBp5ehlQkNEeqZupx9D7WSbIqqhk5ERZwmgvWPUrm/gJ7q0ew8EDs0svo 3opI0WA/mydj9a8QXS3sfyyPaueAi+0qQ5HAPfCH7tzPOjSVmuWA4z743flRhc4lT1pZ O+36d0xhgU+Z3UTdDoycHuoDYSCDa/karH2DSGOX7wmGc8EONiIuZYrmVNbEKBb35FDL A2fbQ94IrHY3dYQShtUdI6508i+trphyZyNUF+wT560REBXlJPrmp8+plZRzv7GueFcu WA1Q== 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:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=aS8qr1Sc+sG0AuI4vh9tC9pZWsX3QlmLIL8uKrqvxbk=; b=qeUrCP0g+Umdmr4DxS5WprD7welhst/j6CdUrVDOqwcM+Ul6Zpsy3AP7V1jZVFi+9Z TvUJBzJfzvlkTdB/B8aX8twZlddFNF0eOo94l44EYGReC4fYFHMspsbQLemwwM9cLgW/ o4NToPF9Nvk7/UAVu8v3oLlPWUr+XIWtzBD9FuQs+DDb2MGfUJiyuxCtBun/0KmXrvDi oQqK9RULWuMzQgvqdUNBBtGGKfbynuiHEbj3HFdj+Bx1yw7q9+kfz0QsFFsPNNV9uWEj 3ds4YG1bXshzSBLI5c60GUJCGqKdg5TzunzzP1JpIuKWaIY0I0UyFFqGE9VckuqWIsqh nqwA== 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 z9si7209369pgc.474.2019.02.15.22.27.27; Fri, 15 Feb 2019 22:27:43 -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 S2403806AbfBOSy3 (ORCPT + 99 others); Fri, 15 Feb 2019 13:54:29 -0500 Received: from foss.arm.com ([217.140.101.70]:37778 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727277AbfBOSy3 (ORCPT ); Fri, 15 Feb 2019 13:54:29 -0500 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 0F9C2A78; Fri, 15 Feb 2019 10:54:29 -0800 (PST) Received: from [192.168.100.241] (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1A7BD3F589; Fri, 15 Feb 2019 10:54:28 -0800 (PST) Subject: Re: [PATCH v4 03/12] arm64: Remove the ability to build a kernel without ssbd To: Catalin Marinas , Andre Przywara Cc: linux-arm-kernel@lists.infradead.org, stefan.wahren@i2se.com, mlangsdo@redhat.com, suzuki.poulose@arm.com, marc.zyngier@arm.com, julien.thierry@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, steven.price@arm.com, Christoffer Dall , kvmarm@lists.cs.columbia.edu, ykaukab@suse.de, dave.martin@arm.com, shankerd@codeaurora.org References: <20190125180711.1970973-1-jeremy.linton@arm.com> <20190125180711.1970973-4-jeremy.linton@arm.com> <20190130180415.0cab24e0@donnerap.cambridge.arm.com> <20190215182037.GI100037@arrakis.emea.arm.com> From: Jeremy Linton Message-ID: <7fa79e1a-3b35-520a-676b-031030108c50@arm.com> Date: Fri, 15 Feb 2019 12:54:22 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190215182037.GI100037@arrakis.emea.arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Thanks for taking a look at this: On 2/15/19 12:20 PM, Catalin Marinas wrote: > On Wed, Jan 30, 2019 at 06:04:15PM +0000, Andre Przywara wrote: >> On Fri, 25 Jan 2019 12:07:02 -0600 >> Jeremy Linton wrote: >>> Buried behind EXPERT is the ability to build a kernel without >>> SSBD, this needlessly clutters up the code as well as creates >>> the opportunity for bugs. It also removes the kernel's ability >>> to determine if the machine its running on is vulnerable. >> >> I don't know the original motivation for this config option, typically >> they are not around for no reason. >> I see the benefit of dropping those config options, but we want to make >> sure that people don't start hacking around to remove them again. >> >>> Since its also possible to disable it at boot time, lets remove >>> the config option. >> >> Given the level of optimisation a compiler can do with the state being >> known at compile time, I would imagine that it's not the same (though >> probably very close). >> >> But that's not my call, it would be good to hear some maintainer's >> opinion on this. > > Having spoken to Will, we'd rather keep the config options if possible. > Even if they are behind EXPERT and default y, they come in handy when > debugging. > > Can we still have the sysfs information regardless of whether the config > is enabled or not? IOW, move the #ifdefs around to always have the > detection while being able to disable the actual workarounds via config? Yes, that is possible, but the ifdef'ing gets even worse. (see v3). > Are the code paths between config and cmdline disabling identical? At a > quick look I got the impression they are not exactly the same. No, they do vary slightly. For debugging I would expect that the CONFIG disabled code paths to be the one that accumulates bugs over time. The command line options just force the runtime vulnerable/not-vulnerable decision, which should be the code paths in general use. For benchmark the run-time options are also a better choice because they don't have any 2nd order affects caused by code alignment/etc changes. Maybe your implying the CONFIG_ options should basically force the command line? That both reduces the code paths, and simplifies the ifdef'ing.