From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x2250wED4uRDSGIeJTgI3Ce5c9O1n3B9NuVYXtaQA5O3iE1xyazHVN7xry5unVebv1NfocCxf ARC-Seal: i=1; a=rsa-sha256; t=1517059123; cv=none; d=google.com; s=arc-20160816; b=TsXwzP+uxF6qIjsVNIn/ks0sTf4CiBaTXJL4zQ4jVRbOYy6ZenhhCxvvbyXKxOY0sr lgklFNNQQ8eXpkoxIup9kVk6ZrIULU1+Y45Ba2pIgChfsT/9/oELJx36EqMsfoA2kb7q zLNBxRpR/7fCzGSaxhgd/dWQ09Ewy3JMy3CF3kCA8ayb/ixU5FGovcb+Ji2f+UAE4AsZ WJf2+MSZ47r/Fk0Czf62OL/wgYBX7/Ihdi7krWs+wf5t1lXswWe45iBN0AiZbBETeDEW D/Kb68uYHEWhJqeEOM7wm5Ftmq6dtYxP13UfxJR9Eyjx30NHC1LtA0l92xhykoTfrDBe sA5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=mnWwjsZxv9Tll50fijhBOl0C9lRwoXyfzTimd3KD7cA=; b=uCO9dG3KEpMEPVnm3lO01qRy0o7F9QGEHSZG1uMY1pjsgwRq1rUQxGMKZwb2ZUn9jb 7xUI5exaMr4EQgIEGlUY2+eRTKuqlaXKmEFyldGVNd6sUJ4g/a0gnzqWgWVfG2znKs7R Kdy+IHfUyVNqpvBeRMsfN/Iq8JosYR/yGv2K6T6Mrw+MKBhnp9drLTzjxOZb3SXd9uv7 tmu2LFvUL1qBdozxfoM6kP8EcPSF8wFxvfSjhy05gyAkFZfquzEXrLgP89D/xWIk7tqb HNxCi6iGzn9pj0smnOnwogyncd4ahf1hTxrof7StscP4VH4kWqIBGtFIBN5h0/vSRXKV idFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of bp@alien8.de designates 5.9.137.197 as permitted sender) smtp.mailfrom=bp@alien8.de Authentication-Results: mx.google.com; spf=pass (google.com: domain of bp@alien8.de designates 5.9.137.197 as permitted sender) smtp.mailfrom=bp@alien8.de Date: Sat, 27 Jan 2018 14:18:29 +0100 From: Borislav Petkov To: David Woodhouse Cc: Tom Lendacky , x86-ml , linux-tip-commits@vger.kernel.org, hpa@zytor.com, gregkh@linuxfoundation.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org Subject: Re: [PATCH] x86/cpufeatures: Cleanup AMD speculation feature bits Message-ID: <20180127131829.4kbi5mbqiqbbhbdw@pd.tnic> References: <1516992318.30244.271.camel@infradead.org> <20180126184915.ioqewp56orj2qhrt@pd.tnic> <7094ed9b-40f7-ba2b-55a6-cc5ab0b06bb9@amd.com> <20180126215209.vqdxh5p672tcdst6@pd.tnic> <1517003984.30244.299.camel@infradead.org> <20180126221026.hc2hk23zsqbqhkif@pd.tnic> <2cea933f-7e06-26d5-95cf-41df8308a0f8@amd.com> <1517045268.30244.305.camel@infradead.org> <20180127093722.t6dn4sgocihjjq37@pd.tnic> <1517049146.6624.5.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1517049146.6624.5.camel@infradead.org> User-Agent: NeoMutt/20170609 (1.8.3) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590681520403481900?= X-GMAIL-MSGID: =?utf-8?q?1590751787058912454?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On Sat, Jan 27, 2018 at 10:32:26AM +0000, David Woodhouse wrote: > No because cpuinfo should be information about the CPU. That argument doesn't work in this case because we're already lying there. Otherwise we would've never had the synthetic features in the first place. If you *really* wanna know what the CPU has, you use CPUID. Which is also more or less a lie on virt, but that's a whole another story. > For details of what mitigations are *actually* in use on this kernel, > you want /sys/…/cpu/vulnerabilities, which might not even be > readable by a non- root user. > > That's why I've used the names that we want to see in cpuinfo, for the > basic CPU functionality. So the sysfs nodes are perhaps an exception in this already exceptional case due to the need to properly communicate mitigations. Which kinda is the reason for why I'm advocating for common names in /proc/cpuinfo and not having the hardware feature names which only confuse people. And we do synthetic bits anyway. X86_BUG_ included. > Does it exist, vs. whether the kernel is *using* it. You can use the sysfs node for the latter. Also, is it really using it doesn't always work: late microcode loading which enables a CPUID bit but alternatves don't run late. Which is the reason we said we won't do IBRS with late loading. > The latter being a little bit of a hack because alternatives > *only* let us do this stuff based on "CPU features", which is why > X86_FEATURE_PTI exists. > > That one probably shouldn't be user-visible in /proc/cpuinfo *either*, > should it? Why not? We have a lot of synthetic flags. > I think I covered this, but for clarity: No, because the *hardware* > feature is the one we want to be called just "ibpb" in /proc/cpuinfo. I still see it the opposite way here: I'd much prefer to have unified view in /proc/cpuinfo so that our communication outwards is absolutely clear and simple: three feature flags. Regardless of box. /sys/…/cpu/vulnerabilities being the additional thing for this exceptional situation. I don't really care about the actual feature bits. *Especially* since not everything supports CPUID faulting so we can't even hide CPUID from people on baremetal and they can find out what's really set there anyway. Btw, for example, ARM took "nopti" to be their chicken bit to disable the ARM PTI mitigation too. It is much simpler for users if you have the same names everywhere - so much so, that it even let's you get away with a small lie. Thx. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.