Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3715704pxb; Tue, 17 Nov 2020 01:20:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzW/OA7q0cphASdwtza5vnHvrM3pIQ/XHow9PFxl4YBswzxgkdt6TvZOeEXJMrGqihtNurx X-Received: by 2002:aa7:da0a:: with SMTP id r10mr20426440eds.102.1605604832693; Tue, 17 Nov 2020 01:20:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605604832; cv=none; d=google.com; s=arc-20160816; b=eCRCJnCX8B822q84pxwJL4K+AJkDclcifl0KrLz3M/dKIuZ/FMAy+Pln+ZFPLygDiS xSs+cPb/q376eKfIjaTNZAtoLDXmxa0KeJ3c+kKQpuZbv9z72Ezs7AAtHjtpAPxHrAVs scr2AJVJoBH24pukD+hPlPQgVvjU06z4KINsT6S/hh2QEhBRJzRK59HI8KnZIQrriWY8 x5P40tecZSXPDp/LZQOPf0mAUETUSnkBucVG+5b5EGqa+FlqUoDrQDCiSYrBKbJ0VXd6 IfsT6Hfa3S1+pjUT9mkAO0Fd3AySbCs7oOafEPUmuknWjnU3oXcewe4iRdnU2UNmNbva sBGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rbikV7BXkOw+k4+ExJQ238GNgrFHk9HjzHfX7ZZpv4U=; b=y3da1yVo9ruGLNdak6As64LdV4c2tUQzXMOUNWaO6sh/qP4DaWkhi3Z1973+NQTW3g 1DBMdEuJXfdKeZZxO2jQHqsdpNJHTHKZX/bSQQxcxukDYzee5lKceA+CpatiT762sSrj H96FkYrP0SMl/WmNtjbwUPMS85H65exW6+Do2gYWOp1PKe0EtSezH7fdf5xsPKigPDqZ /BRiYpaE3/unYJL764Q7mPI6EX6EWwqVpQioFl7FuqmzxkT8uvK+h5sVLDlu8hTn7cTq 7ZisGrHuHdPVwJpW7xStuoKBUXJLWPV/Nr2TtM9b3r9iKBvz4PXdz+qiwTZJrufW5eHF IqZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=qkU3HYeN; 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 q10si12795227ejb.236.2020.11.17.01.20.09; Tue, 17 Nov 2020 01:20:32 -0800 (PST) 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=qkU3HYeN; 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 S1726348AbgKQJSp (ORCPT + 99 others); Tue, 17 Nov 2020 04:18:45 -0500 Received: from mail.skyhub.de ([5.9.137.197]:45382 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726035AbgKQJSp (ORCPT ); Tue, 17 Nov 2020 04:18:45 -0500 Received: from zn.tnic (p200300ec2f1013008dee3addeed0ca22.dip0.t-ipconnect.de [IPv6:2003:ec:2f10:1300:8dee:3add:eed0:ca22]) (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 1D5C01EC03D5; Tue, 17 Nov 2020 10:18:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1605604724; 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=rbikV7BXkOw+k4+ExJQ238GNgrFHk9HjzHfX7ZZpv4U=; b=qkU3HYeNhT2a0N0WA4BP2rvjX8OoVJ9HcRc4S+/F4r9aF4g2AZUJvBxT+73uiaXlNHsz6B G8lg97nc847JuWrg6apInBM7UJjNRHI1lavgpU8HwYtgOK2aATntYlqAnBP4WOk/VEfsox WkrkWUOHYr/q1blerhad0xsNi9chnFc= Date: Tue, 17 Nov 2020 10:18:37 +0100 From: Borislav Petkov To: Chen Yu Cc: Andy Lutomirski , Ashok Raj , "Hansen, Dave" , Len Brown , "Rafael J. Wysocki" , Tony Luck , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][v2] x86/microcode/intel: check cpu stepping and processor flag before saving microcode Message-ID: <20201117091837.GA5719@zn.tnic> References: <20201113015923.13960-1-yu.c.chen@intel.com> <20201116122735.GA1131@zn.tnic> <20201117022518.GA17555@chenyu-office.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201117022518.GA17555@chenyu-office.sh.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 17, 2020 at 10:25:18AM +0800, Chen Yu wrote: > If I understand correctly, the only place that invokes > save_mc_for_early() is in generic_load_microcode(). While in > generic_load_microcode() only microcode has a newer version will be > saved by checking has_newer_microcode(), and this function leverages > find_matching_signature() to check if the candidate is of the same > signature. So when it comes to save_microcode_patch(), the signature > already matches. In case save_mc_for_early() will be invoked by other > function in the future, it is okay to add this check too. The important aspect is that you need to save in intel_ucode_patch the *exact* patch for the CPU you're running on. The code above that in save_microcode_patch() adds patches of the same family/model but *not* same stepping to the microcode cache in case we want to support mixed-stepping revisions. And those you don't need to check for exact match. What I'd like, however, is to get rid of that mixed-stepping support - which is total nonsense anyway, if you ask me - and that would simplify the code a *lot* more. Thx for testing. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette