Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp370828pxm; Wed, 2 Mar 2022 17:36:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJxDZv06OTHixYjSmJAN7Qexj09x73vSIdWB36ke9RXmnhKey9ObvtMt3lsKUsOCkPsY9MgO X-Received: by 2002:a62:1d42:0:b0:4c7:f78d:6f62 with SMTP id d63-20020a621d42000000b004c7f78d6f62mr35416541pfd.33.1646271381223; Wed, 02 Mar 2022 17:36:21 -0800 (PST) Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 191-20020a6214c8000000b004f3c484d399si684371pfu.90.2022.03.02.17.36.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 17:36:21 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cw+DlhEn; arc=fail (signature failed); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A9ACA175806; Wed, 2 Mar 2022 17:34:28 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231339AbiCCBfK (ORCPT + 99 others); Wed, 2 Mar 2022 20:35:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231340AbiCCBfH (ORCPT ); Wed, 2 Mar 2022 20:35:07 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8B7B1405F4; Wed, 2 Mar 2022 17:34:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646271258; x=1677807258; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=yLlWbmfLT7YA/fc+PbRe67nnXapVtFHvs6H4uQnBnR8=; b=cw+DlhEn/DAidamer8q6QmGJTJG5Qw4B2e0aJ7T/9m/E9/o1tJtXXb9/ 1kobaYipKDmqQvwkNZ164+Lr58RR1wZJYibobRc7dWqTadTGcKUrbnVbu /bC6sT7T+ipTyxGOJkKJH1MO2M7Qg3qqQM0vwh04S4+I7UhK5414P2XBc H0obNbI2IeRFo4n7I2Lcr25ZlGvqgDMqoEbQ4xYz/1PGPjrlTSUP+B9D0 MxaDaaVPiodPoYKuP/bkIBBisv2CHKe6W5DOZZGU30Jmq7JB5inHmFcuk PZmgtEo3pKhb+R/rHoSJFAYZeImubhBFAPhDQ2v0UymfHLZJriRMvtQAd Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10274"; a="278226750" X-IronPort-AV: E=Sophos;i="5.90,150,1643702400"; d="scan'208";a="278226750" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 17:34:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,150,1643702400"; d="scan'208";a="508408426" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga002.jf.intel.com with ESMTP; 02 Mar 2022 17:34:18 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 2 Mar 2022 17:34:17 -0800 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 2 Mar 2022 17:34:17 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Wed, 2 Mar 2022 17:34:17 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.43) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Wed, 2 Mar 2022 17:34:17 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UlQSjBsuujoYjDkFgtZOZ125K019JH+fp3Dw1ia+GuPAzC1O7xE3IAyzfy1IXOU/+/nidHNLlt/dGjqJltJ0rHtS/sI0TfsGOt5Lqa7d1SwqyOYiZDITQbuTQEtZrVL3jTsGZ1D0fNTlBwwkD8Z9KICpihMaid5sS5EGcXiSw2L/vyFvYDR8PtEPc+dMtE8X0c5aFk4T6iLCwdNeQ1C9jqUT9eSihS+sjPY4euWP38N1Ly3wcvWqne94hL4Ticm+S5+wSXiLyE0CRbWH9vw55IW6Eg6M2RvnWVirTtzWM9jMEU2atrge/AZQkWE9g0KpMOdbsjT7iTwwlk5uED+3YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hN8PSwgTy3QkNDIyp+qSVU6qbrzQH4p9GpbHWmt3stg=; b=OuRtq59s5gVsl0wlxaBY6ND8YvBfA2dTrNdZLf++KWfyU+rbRCLDaI6/+sdD27RwqJlhOj2FJoswLuGOeZvvLKXpZBrT5AIRvNsWLvd5/hcMHMyNBUjYF+CRXUUJle9d5Ty+wRerNCK/mQ2kdkfGAVXrfxUcvp8wxZRUFMLyxtkedNSTc2/xWVzzJZJkkUwnWp8PCU11TZ4etHrJp4cFT0ItbDwdDuALdeCBOrLQ7bQAty0uZQux5etPz8t4n1FQ2AWoEsZgxn+CXCeM0y38jojyZQblMe8gTbZlnAcfbHiTNT7Ydd7zAVL7/3Yj4QLEd3bFUSB0MDK/EI874EppGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from BYAPR11MB3768.namprd11.prod.outlook.com (2603:10b6:a03:fa::20) by DM5PR1101MB2281.namprd11.prod.outlook.com (2603:10b6:4:5a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.26; Thu, 3 Mar 2022 01:34:14 +0000 Received: from BYAPR11MB3768.namprd11.prod.outlook.com ([fe80::dc03:366a:dae3:aee]) by BYAPR11MB3768.namprd11.prod.outlook.com ([fe80::dc03:366a:dae3:aee%4]) with mapi id 15.20.5038.014; Thu, 3 Mar 2022 01:34:14 +0000 Message-ID: <1db4686f-557c-6e24-f991-c59f337bd136@intel.com> Date: Wed, 2 Mar 2022 17:34:10 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [RFC 01/10] x86/microcode/intel: expose collect_cpu_info_early() for IFS Content-Language: en-US To: Borislav Petkov CC: , , , , , , , , , , , , , , , , , References: <20220301195457.21152-1-jithu.joseph@intel.com> <20220301195457.21152-2-jithu.joseph@intel.com> From: "Joseph, Jithu" In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MWHPR04CA0055.namprd04.prod.outlook.com (2603:10b6:300:6c::17) To BYAPR11MB3768.namprd11.prod.outlook.com (2603:10b6:a03:fa::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d1124b97-8a09-44de-9e5c-08d9fcb5ecdc X-MS-TrafficTypeDiagnostic: DM5PR1101MB2281:EE_ X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VdlvCzpItHIDW62j7MwNvJt1Yy7/Mn42V4Z89KF3oyvdPV9o+vi/6FRW4ThexwCerMWYP1q2CuSkGOBLgA4qs5ZNrqetiIFw9AUmKJaiNqGp5XAUsg9PKdyIQ+RUmiHk+VPlvLA43pvpaEZDA5ilDhh7k6TLWi7FST311kY2Pozr3FMfSATpAItNxYT9/0dgU95D38cubrdkqULF9mtURefX9+Bw76RYQfBJ3KDH9JrgJhn8FSNA6IdvGiI6jD3POVlHnzfI0sojAbmt09WrwzVAwzYXdzgQhQPKmtV6VIwPjkJDhMS3Z68QPcb82knuolofZaSTbXueaXbxO2h0Xau4ku+F1Krv3ljMigW//bIsCSl2HuPr81bHDDbQwuLL1KpJlsgp5ci87vJNVE8cnZKFdVR8tihR3Zbg4cqcnNf2cTd631P+j/UmE1ylMmbai/HaRqIk1LuxpUHmf4XyVa/MN0fVSJ54rCUV96dTdN6Qum7k9WAkSRVuVKUW2P1Eu/FiL/ACTn07CuGkBw8NRAZXHytgxaOaWv5JVvPECfulR+lGiesFIzj+b95UKFCKc3a1mrNxu3pecqUh2dt726diMtYK9H4rK6ezSaTkJA0TI6WWHEfEqm1dYEYvjvRSZBFZcMGDW7AfT6idGVHawnLQE3WQTDGUFp+RKlTeh6Hs1j/t7/x/icsSYsz7A6RLfxnhUndZbLFj456QHFbRLA5sOwfMDkArovhl9vLdQ0d6LWkx8cjI1uIND6vFhwxb X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB3768.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(6916009)(6486002)(26005)(186003)(2616005)(8936002)(6666004)(8676002)(4326008)(53546011)(66946007)(36756003)(66476007)(66556008)(2906002)(5660300002)(7416002)(508600001)(38100700002)(31686004)(316002)(6512007)(6506007)(86362001)(31696002)(82960400001)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Mmd0b0FxS3BFclNmS2VNQ2FZRFlCNGtLZmd3YWJRMjdvTHZBeGpUSE1KQVdv?= =?utf-8?B?MzAxRG1xWG5PUmRiT3FGMm5nMWhkTUc1Qm1acGZwd3VyM0VNbFNTMGpzVVVK?= =?utf-8?B?ekRieXNMQXA2RU93ZWx0WEJDZS9tMm1YcnlQTUVkN3V0WGVxRFBZVHg1bzIz?= =?utf-8?B?dUo0WWlEUDMwTktNNk5vSXkrcWhsQXEyZGlybTV3Tnh3NGVJNkp6MFVoWmc4?= =?utf-8?B?TjVnU25NSVl1QmFBNUdyUjZzU2Nvc3NLZUtTL1huYUN1VmluRm0ybEk1Skg1?= =?utf-8?B?Zm5vSFhXQUFxUW9Ld2piUmFPckZ3Y1Vvcy9RbHRYMmFGeGc1UlhyOGxRUVdV?= =?utf-8?B?Rm5BWmNsNjNKV3J3c2lqcytCMHB4bWNpcVVXSzhZaDZpVHU2Smp0N3dVSXI5?= =?utf-8?B?dmtVOHFtWUI1QnBBc0s4VHhvcUprZTFpNUh2RkdqY040V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5ecdc X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3768.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2022 01:34:14.4359 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bHrFixQwRq5Yhge4tRdQxVxykfp53LE4Wk2EBODhGhcVljyvJVdtEG0aa0K0M/tnKbeAqNP4wkkSPG0GbGJ5pA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2281 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/2/2022 2:30 AM, Borislav Petkov wrote: > On Tue, Mar 01, 2022 at 11:54:48AM -0800, Jithu Joseph wrote: >> @@ -58,6 +58,7 @@ static inline bool cpu_signatures_match(unsigned int s1, unsigned int p1, >> /* ... or they intersect. */ >> return p1 & p2; >> } >> +EXPORT_SYMBOL_GPL(cpu_signatures_match); ... > > Hell, even your function signatures don't match. > > And then, with that fixed it would build but then one would wonder a > long time why that ifs thing doesn't work. Well: > > # CONFIG_MICROCODE is not set Thanks for reviewing the patch and pointing out the mistakes of not setting the module build dependency(on CONFIG_MICROCODE) and that of signature mismatch > > So the proper thing to do is to extract the generic functionality for > comparing microcode patch signatures and for gathering the information > collect_cpu_info_early() collects, into intel-generic functions, like > I've done with intel_get_microcode_revision(), move that functionality > to arch/x86/kernel/cpu/intel.c and then use it *both* in the microcode > loader *and* your driver. > Will move these two function definitions from arch/x86/kernel/cpu/microcode/intel.c to arch/x86/kernel/cpu/intel.c in the next revision as you suggest above. Need to find an appropriate header for these moved functions too. Jithu