Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4554648rwb; Tue, 8 Nov 2022 19:44:15 -0800 (PST) X-Google-Smtp-Source: AMsMyM76fCXJ2WEyuNfF+AXY14PJrk70Pkzit7qEd10MNH1PlCHr70+WtUebFA5TjcmyyIMa0Cei X-Received: by 2002:a17:90b:4f45:b0:213:ccc6:87df with SMTP id pj5-20020a17090b4f4500b00213ccc687dfmr55060953pjb.227.1667965455562; Tue, 08 Nov 2022 19:44:15 -0800 (PST) Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 25-20020a631059000000b004532834e821si16555260pgq.598.2022.11.08.19.43.48; Tue, 08 Nov 2022 19:44:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KQpReCtm; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230142AbiKIDEF (ORCPT + 94 others); Tue, 8 Nov 2022 22:04:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbiKIDED (ORCPT ); Tue, 8 Nov 2022 22:04:03 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F075B10FD0; Tue, 8 Nov 2022 19:04:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667963042; x=1699499042; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=7Imrio/RVZAKxA5KJy5S+2AIyNHHZPv2uH+41zMrodc=; b=KQpReCtmJdsqxOMgOz81OapRULZ6dmdYYIeuOK6c/EVBQURmM5yMsqao Qy8wV9+SLMcQxN6MqjQVRo3+NpAC0LEmVUjTc+CKUFcJdedukEOuReeXy R9pP03+ou6/Y1/23na2kwOrb4+sDAqrnspdBraWkvxrtU3qOo42K3Ud/2 DQNVuBbrqe4gmasrn7LKNh7/0FjcJxxiWZGigMVEuZjDXZ+qerB/rXZvs e2VT73M7j+p/1O5kmR83MrapfJAXjIbCcArOZk9hoqd484woTlz4G7dsw NAPRJNH6gPZ51PZ+tosy97t9ANV2PxCzPLbNh0uYB2QGPLI8wpf55tqu1 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="312669235" X-IronPort-AV: E=Sophos;i="5.96,149,1665471600"; d="scan'208";a="312669235" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 19:04:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="614513929" X-IronPort-AV: E=Sophos;i="5.96,149,1665471600"; d="scan'208";a="614513929" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga006.jf.intel.com with ESMTP; 08 Nov 2022 19:04:01 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 8 Nov 2022 19:04:01 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) 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.2375.31; Tue, 8 Nov 2022 19:04:00 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 8 Nov 2022 19:04:00 -0800 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.47) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 8 Nov 2022 19:04:00 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iH0dj/wlkL9lcNwIAgsIgLVRMkE9wTuNVBCgbuBptBaQNQDeNLeFZHKUEVlKGyTSJEsT/M5dOUVLzJ5EwAlcEwxXFW7PQzAEf27Ho/GpPllcsZI+RIRbjuhEJkNS5GIgCmBJ3J/Km2DIDyg3XCchDtrOd+ghwj/fCWR5CmVjao0vcU4WuM1IumjPXgeK2pUp+dqw/zgHVsaNbM1UOqPqAO9QTVQ2FbH44j9CzozTYM+pceXeQGKPYqCBYdFAqSEz7dfmvIJvQ1yIQi85WQFQHfhZ1Ej2eYa3sGAQ4SbYgfKb3LfobIj3BqvjcCun3uU0nexE+AAe23C5cMw0v8opQA== 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=n1oqUvT3nsYc6RXEsN65IAs1+dPyPVKhODsLBwFIwO8=; b=Mo0m/vMnOg5IZYPClAxc/HQ8o2HeDWYEqSVsZWWIVwrS5LZpvEomTb2tk82Dwo8xuM/hRRSoyzus2V4OG0xjKNfjkiC9ETUtFLbln8E/oxxj4f8MWKB5mFg3AcmGEGSbYMWI/jgKSENUeewsT2R8g/DVnwMzj1iXdd8pFaF9B/vD6UI5+oeVrIQSUEmGqvrWVgMoVOZYVAVMedpH47aWkAzAHgjpnwrnTfm8VQQ7mPQMI2daXPmDZmHeqlv2JHhrme0EZH6e8lpsLkuBDZqEZX0sEoSbiahdqZyq87TCf0NpJQOITOYkQbXf2Cl17xWF8yu2aFJqSgoemVJk6NRYvA== 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 BYAPR11MB3320.namprd11.prod.outlook.com (2603:10b6:a03:18::25) by CO6PR11MB5665.namprd11.prod.outlook.com (2603:10b6:5:354::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.27; Wed, 9 Nov 2022 03:03:57 +0000 Received: from BYAPR11MB3320.namprd11.prod.outlook.com ([fe80::e475:190a:6680:232]) by BYAPR11MB3320.namprd11.prod.outlook.com ([fe80::e475:190a:6680:232%7]) with mapi id 15.20.5791.027; Wed, 9 Nov 2022 03:03:57 +0000 Message-ID: <86c46504-f769-1187-2aba-5b8b58654b33@intel.com> Date: Tue, 8 Nov 2022 19:03:54 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH v2 06/14] x86/microcode/intel: Expose microcode_sanity_check() Content-Language: en-US To: Jithu Joseph , , CC: , , , , , , , , , , , , , , References: <20221021203413.1220137-1-jithu.joseph@intel.com> <20221107225323.2733518-1-jithu.joseph@intel.com> <20221107225323.2733518-7-jithu.joseph@intel.com> From: Sohil Mehta In-Reply-To: <20221107225323.2733518-7-jithu.joseph@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR08CA0017.namprd08.prod.outlook.com (2603:10b6:a03:100::30) To BYAPR11MB3320.namprd11.prod.outlook.com (2603:10b6:a03:18::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR11MB3320:EE_|CO6PR11MB5665:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a706645-632f-489f-7502-08dac1ff0a84 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aRP/lZbrvOASghDkXMZhfnJqemXU+riYal0HA9vzwgaXR70241i71CAZ0WAgZ03OWRtaO/Xa9wRscswwj8j1oBLB50Nv2heZRo5npq33MhJbR6z2sKtT9szCBqi3DF10vh01kMqE6w9+ijJMko12R8XBJvcZX9EGncp+4o5tx984HVpyaz7fs7I4r6s7G8hYHn1ZgLNrVx7KYIKytIXMjTwwOOIXAIQEmWRvsFeFrSqvJ3EQvp0HVeKbZn7UKOpxQNNs+ZGOWr3JrRkrPDD59UAtqGxLn4xfhKGQsDJu/JsjNPEfWTjRVER0th7z8SK3YZkRmP+5yvITEdtuuwpF6sXnpAXF0p3b33a4IQKZjaaArsDRV7NCPjXUGaRbsUFDRESVdtdwbk+uRzwV7M5Q64Ha7Mme3lbWcdaL70tFSzSpxxbKWn2/wv2FiLn43C40oVSiQEflLRwgiwCZiAqg+wYfxlyAKh3BoCorhDgJv8su8GqjgxYZSPsjltbFhkUC2a5BE3DBXXe5/0ppg/Mxfwq7NEj/I5qGnjsX1pS+II9FVYO2Jb5VWvzNmPIaDG9XSig76t8e/NuC8CV+N/Cs4JFMwFge3nRtfo32leWWjiaZMLuHywyulRXjfTnkH58tGPCVTrVnfejkbjLMmW00H/gg7wqdexGQnssTbC+MaSq5SvJ/22HEUsVScASmrkrEhOGUT175CZ3IP3RQ/cI8//Dh0Kc52ePcgOkTV4vs1l6XVy2YSOqmQUYB5BeLIzzVyKoiK1mD5B5nVYBQ7Jj0HtKQkCV5DEvI2DctP/0uNLQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB3320.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(136003)(346002)(39860400002)(396003)(376002)(451199015)(478600001)(6486002)(44832011)(6512007)(2616005)(186003)(2906002)(83380400001)(82960400001)(6666004)(36756003)(26005)(6506007)(4326008)(38100700002)(53546011)(8676002)(31686004)(316002)(66556008)(66946007)(66476007)(86362001)(31696002)(41300700001)(5660300002)(7416002)(8936002)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TVRCUU1NeWZBbEQ2eENvZU05VWpHaEZGOUNzTGh2Z3JhbHZSQ1A2VHphRW8z?= =?utf-8?B?UFQzRzdnMDY3T3NhNm9LTkc0M3E3RjdWNUhlMzM4cEpVdUM2OGwvb2F0MUVj?= =?utf-8?B?ZTBIODdlTjJoYkt2MFhIM1dTWXF1K0Q4anFHdytoMGlIWWN3MGRLMEQ4dGZ0?= =?utf-8?B?SkZZbHJPeTdjQ2dCbW1ocGdHaEp0OThnOFJKL0x6MGhEeTh4elZQZEw1RnVR?= =?utf-8?B?Z0N2dGFmRkV6UmxNVTBKNm45ZTJFdkgrZTJKVUJ0RUtYQm9qczFKZzJNNGZq?= =?utf-8?B?Sm56UjVLOFR0a0h3RTFSaFdKb3RhWnpodFBJMnU3VlpRRXVCSWVmRFQ1NjlW?= =?utf-8?B?Y2FKcVM3OGp6NW5uV1N6ck9UU0JNeW1UK0NyKzRmQ1FBQ3g3UnNTYW9raWhj?= =?utf-8?B?NlFBWEdjc0FYWWhPZUxhMjJCMDVuNXB3d0pCNV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enant-AuthSource: BYAPR11MB3320.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2022 03:03:56.9401 (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: ezoXdG8qTPo/L1QANnmQmfjnRTDu5pRvh/PJ0FpxPPWil70EWjSizJSVk9V6paJzNlKolicOffPQoahrBZgGTw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR11MB5665 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 11/7/2022 2:53 PM, Jithu Joseph wrote: > IFS test image carries the same microcode header as regular Intel > microcode blobs. Microcode blobs use header version of 1, > whereas IFS test images will use header version of 2. > > microcode_sanity_check() can be used by IFS driver to perform > sanity check of the IFS test images too. > > Refactor header version as a parameter, move it to cpu/intel.c > and expose this function. Qualify the function name with intel. > > Reviewed-by: Tony Luck > Reviewed-by: Ashok Raj > Signed-off-by: Jithu Joseph ... > + if (data_size + MC_HEADER_SIZE > total_size) { > + if (print_err) > + pr_err("Error: invalid/unknown microcode update format.\n"); > + return -EINVAL; > + } > + The wording for the "bad file size" print seems to have changed during the move. Any specific reason for this? > - if (data_size + MC_HEADER_SIZE > total_size) { > - if (print_err) > - pr_err("Error: bad microcode data file size.\n"); > - return -EINVAL; > - } > - Other than that, Reviewed-by: Sohil Mehta