From patchwork Sat Nov 19 16:24:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 23288 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp780202wrr; Sat, 19 Nov 2022 08:26:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf49aMPBYd5KWEWDZ/Y1wDWvlP1grkFcZxF5UrAWGv10270azm/oElXbrKpzp8nZMsH/YBOC X-Received: by 2002:a17:902:bd83:b0:180:87d7:9be8 with SMTP id q3-20020a170902bd8300b0018087d79be8mr4474486pls.85.1668875204074; Sat, 19 Nov 2022 08:26:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668875204; cv=none; d=google.com; s=arc-20160816; b=C1lsWRNPCpuKTkc4K8NJXeD48RemeGqIExWbPzyCJF5urkLhmvrl1mJFhoLZ5mtNho puAA9C++DzQ6LmpctNvv2ltSF4TSfXPp4M742X7IRqXGSaJG33qx8ISV5IQXwhSBU2Bq dxYo+z/vaNwvv0dVIaGGymjv4UFihWSi/jAnrhPc3hIPX1k7E7R+o94lxcdCmAICjzgb qZXx9kxSjFg7ItinVnwUOQIx0mStBpehwo5rGnlCF3inWJLHQFSY45oQDGr8hmc3jlLQ VtdmjQkI4Xhvvcjs6PZVuHXe5bNitScrhBVz1SshTZ/CKg881W9XqUAt3p4IFenJdTJb FGqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=JO9kPLYnuN9z55eNPJSY/THCRt4tVUPwIM1vs699eio=; b=FH2XFaZV3b2aCDzdzwsfEe3vCDej3EU0OJ+J+0x4MhA2UDopKRErH2dGlmK5kI4rfi TQqhzxyIp/Ekb4eT3ypiobzXsBW9z7yYq+OZ6YUr6mU/lGGQ+H79qAhInC08q+Bf6DZp ZLyaNcMiU7BzNE2i8lhbXSkXsshkh6qrUYOpAxM+2n+9DkCHNkuuEttu4S79/TtCf6W6 wINUo/DsWlFTJFN/SV/hG76aiAJd9i+/R8iZ5exMyu1hcrUKbZ99AaAEqGa5iD+VCNRn D4h7UPXqj4lNaSYRychBU4CeyT7G2wNJDLsLuBLygG5NWmL96yzv6UQ4jGBNfReFy9az mckg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=tcSBFRRT; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y10-20020a634b0a000000b00476f8b57e4asi6393135pga.475.2022.11.19.08.26.31; Sat, 19 Nov 2022 08:26:44 -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=@linutronix.de header.s=2020 header.b=tcSBFRRT; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231626AbiKSQYx (ORCPT + 99 others); Sat, 19 Nov 2022 11:24:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233955AbiKSQYM (ORCPT ); Sat, 19 Nov 2022 11:24:12 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B218443AF0; Sat, 19 Nov 2022 08:24:11 -0800 (PST) Date: Sat, 19 Nov 2022 16:24:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668875050; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JO9kPLYnuN9z55eNPJSY/THCRt4tVUPwIM1vs699eio=; b=tcSBFRRTTrOdRugBidxzcGBwVjZZES+A8xnkAXRZ2DTMfE+JASJKWI5wChmbfx9OJaP9Ya p0+4JxLRH1ZH719W7bIQhI3h6iTbmeTzqKFqYcPW+RxBwhesHmjL6Bp9TxvghU4UTpDS3J XqVuZBLfIE6w1Hk/R1NuLlxuDWndeLZ85pD6YbGyra2h+xmTqKC3SS+9aDWX0noCWx6p9X 2Mm7H0Jh3n1zrvLTb4aI5vSpbNugmELulqhAbVdEozTaSJUUW09WETvZaF3ZY0jxwdtldU lY+siMN4W5ojvrrF61q96QLV4sJsjzlCAM/a9IKdikBZx+an94ULid6fIa78Vg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668875050; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JO9kPLYnuN9z55eNPJSY/THCRt4tVUPwIM1vs699eio=; b=0oqKVBDAv9wwjFJGJiF0NZTYm4waOefFQUIZId2sFilbT2m3Afc/IoUqDpmyLjwADB5w+u 5XCGSEyzGFEKfUAA== From: "tip-bot2 for Jithu Joseph" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/microcode] x86/microcode/intel: Use appropriate type in microcode_sanity_check() Cc: Tony Luck , Jithu Joseph , Borislav Petkov , Ashok Raj , Sohil Mehta , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221117035935.4136738-7-jithu.joseph@intel.com> References: <20221117035935.4136738-7-jithu.joseph@intel.com> MIME-Version: 1.0 Message-ID: <166887504907.4906.8459321279475497881.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747331227274266058?= X-GMAIL-MSGID: =?utf-8?q?1749942485543539799?= The following commit has been merged into the x86/microcode branch of tip: Commit-ID: 2e13ab0158dd4a033d61a5baa8f9b5b7c9ea8431 Gitweb: https://git.kernel.org/tip/2e13ab0158dd4a033d61a5baa8f9b5b7c9ea8431 Author: Jithu Joseph AuthorDate: Wed, 16 Nov 2022 19:59:25 -08:00 Committer: Borislav Petkov CommitterDate: Fri, 18 Nov 2022 21:51:56 +01:00 x86/microcode/intel: Use appropriate type in microcode_sanity_check() The data type of the @print_err parameter used by microcode_sanity_check() is int. In preparation for exporting this function to be used by the IFS driver convert it to a more appropriate bool type for readability. No functional change intended. Suggested-by: Tony Luck Signed-off-by: Jithu Joseph Signed-off-by: Borislav Petkov Reviewed-by: Tony Luck Reviewed-by: Ashok Raj Reviewed-by: Sohil Mehta Link: https://lore.kernel.org/r/20221117035935.4136738-7-jithu.joseph@intel.com --- arch/x86/kernel/cpu/microcode/intel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c index c77ec1b..e48f05e 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c @@ -135,7 +135,7 @@ static void save_microcode_patch(struct ucode_cpu_info *uci, void *data, unsigne intel_ucode_patch = p->data; } -static int microcode_sanity_check(void *mc, int print_err) +static int microcode_sanity_check(void *mc, bool print_err) { unsigned long total_size, data_size, ext_table_size; struct microcode_header_intel *mc_header = mc; @@ -253,7 +253,7 @@ scan_microcode(void *data, size_t size, struct ucode_cpu_info *uci, bool save) mc_size = get_totalsize(mc_header); if (!mc_size || mc_size > size || - microcode_sanity_check(data, 0) < 0) + microcode_sanity_check(data, false) < 0) break; size -= mc_size; @@ -792,7 +792,7 @@ static enum ucode_state generic_load_microcode(int cpu, struct iov_iter *iter) memcpy(mc, &mc_header, sizeof(mc_header)); data = mc + sizeof(mc_header); if (!copy_from_iter_full(data, data_size, iter) || - microcode_sanity_check(mc, 1) < 0) { + microcode_sanity_check(mc, true) < 0) { break; }