From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 27 Feb 2019 16:26:27 -0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1gz22L-0003rE-TK for speck@linutronix.de; Wed, 27 Feb 2019 17:26:26 +0100 Received: by mail-lj1-x22f.google.com with SMTP id v10so14540700lji.3 for ; Wed, 27 Feb 2019 08:26:25 -0800 (PST) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com. [209.85.167.43]) by smtp.gmail.com with ESMTPSA id b21sm3928804lfi.7.2019.02.27.08.26.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Feb 2019 08:26:19 -0800 (PST) Received: by mail-lf1-f43.google.com with SMTP id v185so1574971lfa.11 for ; Wed, 27 Feb 2019 08:26:18 -0800 (PST) MIME-Version: 1.0 References: <20190227150939.605235753@linutronix.de> In-Reply-To: <20190227150939.605235753@linutronix.de> From: Linus Torvalds Date: Wed, 27 Feb 2019 08:26:02 -0800 Message-ID: Subject: [MODERATED] Re: [patch V5 00/14] MDS basics 0 Content-Type: text/plain; charset="UTF-8" To: speck@linutronix.de List-ID: On Wed, Feb 27, 2019 at 7:37 AM speck for Thomas Gleixner wrote: > > - Consolidate whitelists before adding another one. So I know I suggested this, but the long lines end up bothering me. > +static const __initconst struct x86_cpu_id cpu_vuln_whitelist[] = { > + { X86_VENDOR_ANY, 4, X86_MODEL_ANY, X86_FEATURE_ANY, NO_SPECULATION }, > + { X86_VENDOR_CENTAUR, 5, X86_MODEL_ANY, X86_FEATURE_ANY, NO_SPECULATION }, This just gets quite hard to read, and the patch to then add new spec flags becomes a mess too. In that sense the old model was simpler. On the other hand I think the new consolidated list is better in the sense that it shows the commonalities much better, and you have everything in one place. I wonder if we could make it a bit saner with some macro magic. Doing #define VULN_WHITELIST(vendor, number, model, whitelist) \ { X86_VENDOR_##vendor, number, model, X86_FEATURE_ANY, whitelist) and then the lines are at least a bit shorter: VULN_WHITELIST(INTEL, 5, X86_MODEL_ANY, NO_SPECULATION), (or do we actually need the feature mask? None of the existing cases seem to have it?) I dunno. Maybe none of this matters. Linus