Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3651797ybz; Mon, 4 May 2020 07:12:12 -0700 (PDT) X-Google-Smtp-Source: APiQypJZ0DDgdSBURv52+nB2FSL8AAyiAIhiehhsaRmxZSyJEEOBLg1KOhFHJgaAhdXGBNLsP5WU X-Received: by 2002:aa7:d0c2:: with SMTP id u2mr15269529edo.78.1588601531817; Mon, 04 May 2020 07:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588601531; cv=none; d=google.com; s=arc-20160816; b=P5Z0uOw/Ysqbrg3VGTHdL3nL+wFHRNmS5ykKZ4TPCIiIlc9sEGO/Y+3UzDIbZgrtk+ YkoPHDyvQdDR5st34ugCj9nO8st3X0otWqO1j69uOa+HCDkdhoIkhhvOONXvppZM7Z0I bTY0sZ9luRjWiKi9zTIJC5CnaOEIiU2J27qWd2p8IKcTH067WdwLImvqiuQhTgmkdvIM fwzIa9eVlxrpBZ0Xwelxw1j2BLho+6+daOgiiaTg+QNGJMQZHj1FuMkxPXoPKuAINSLZ QZkLWH4ZPJFmWKNUGaAqC7BUYig2ETaYV51VLXTg64eg9gpv5r/eQudDrjr4C1a4h9+Q ZH6A== 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:dkim-signature; bh=lZ4aqziNyvYw3GSKD0XU2YhwX5XuP4rjgq7LEC+3Iqg=; b=vHIJVFAxsRE424FRFAT1L+ffQh4/VSqnFR+1gOk8VRr+xB2MyPCOy6qn+aU3JgP6Zk dTB5Kv/B8fRhuZ+UATNAPAOW0Q1p9xa4YabR8ip9TjxwT3XEpRqp+Uz/bh5bKBslq3f3 UVGfYh1H/0u785mJ2ALZZHI/rg6y4Nt/5kUC1ZrDATvR8+FF763UtlVb0sRelBomI0aN v3Jw9H5kiVVJAu1JIESQveAU2WBTj7juFIbwqhRl8HoPQmVOG7WmZIjTJGH9IPH7edwv GUCaJYZU/Fm4PUKlO+G1bCVBxBcJcZnXLOZVI8MnesmCGFiHOdhtEGhXgyO1iM4jHFnr DsOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=CV2JK5Xt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si7225867edn.504.2020.05.04.07.11.48; Mon, 04 May 2020 07:12:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=CV2JK5Xt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728605AbgEDOJs (ORCPT + 99 others); Mon, 4 May 2020 10:09:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726404AbgEDOJs (ORCPT ); Mon, 4 May 2020 10:09:48 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4797C061A0E for ; Mon, 4 May 2020 07:09:47 -0700 (PDT) Received: from zn.tnic (p200300EC2F08AF0065867C3890225131.dip0.t-ipconnect.de [IPv6:2003:ec:2f08:af00:6586:7c38:9022:5131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 11AC31EC02D7; Mon, 4 May 2020 16:09:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1588601385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=lZ4aqziNyvYw3GSKD0XU2YhwX5XuP4rjgq7LEC+3Iqg=; b=CV2JK5XtORlHCkNTYou9kVw9zJqbNvImcy+Ef0Lg9WYr+0d/WUYKm7Q+v8dQkTqVWm5tOr jQLH0vU2yAhM8X+zNEiv85x88vP3kdT5T4p9oMaPu4Z5uuYILNoSMCZlIjeUu68p93DlJs ke4Z5HXJpAcd1VM5kSGynvIClmH/dpk= Date: Mon, 4 May 2020 16:09:40 +0200 From: Borislav Petkov To: Mihai Carabas Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , x86@kernel.org, "H. Peter Anvin" , Jonathan Corbet , linux-doc@vger.kernel.org Subject: Re: [PATCH RFC 3/3] Documentation: x86: microcode: add description for metadata file Message-ID: <20200504140940.GF15046@zn.tnic> References: <1587972479-10971-1-git-send-email-mihai.carabas@oracle.com> <1587972479-10971-4-git-send-email-mihai.carabas@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1587972479-10971-4-git-send-email-mihai.carabas@oracle.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 27, 2020 at 10:27:59AM +0300, Mihai Carabas wrote: > +Here is an example of content for the metadata file:: > + m + 0x00000122 > + m - 0x00000120 That's not enough. Imagine a blob adds the MSR and a subsequent blob adds *another* bit in that MSR. You need to be able express that. IOW, I think it would be easier if each line describes exactly *one* software-visible change brought by the microcode. Also, what is the use case to say that you're adding a new MSR? This would require to patch all the code that *potentially* might use that MSR, to be able to handle a *change* in that MSR or it appearing all of a sudden. Yuck. I mean, an easy way to handle it is to say, "Hmm, nope, won't load that ucode." > + c + 0x00000007 0x00 0x00000000 0x021cbfbb 0x00000000 0x00000000 > + c - 0x00000007 0x00 0x00000000 0x021cbfbb 0x00000000 0x00000000 I don't think this'll work with the vendors as depending on the configuration, CPUID on the different platforms could be different. And then you might gonna have to specify CPUID for this particular {family,model,stepping, ... } tuple which identifies the platform uniquely so the c-line is insufficient. IOW, I think it would be easier to be able to specify one CPUID bit per line of being added/removed so that the post-load callback can handle this properly. And this specification needs to be complete: i.e. "I'm adding this CPUID bit for this family,model,stepping configurations under this and that conditions". And that needs to be describable by the "language" of the metadata. So think of actual examples and then try to represent them with this format. But all of this is moot if you don't get a vendor buy-in into this. IOW, microcode vendors need to agree to this format and adhere to the format when allowing microcode to late-load. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette