Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0D1DC38142 for ; Tue, 31 Jan 2023 20:20:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230104AbjAaUUs (ORCPT ); Tue, 31 Jan 2023 15:20:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbjAaUUp (ORCPT ); Tue, 31 Jan 2023 15:20:45 -0500 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 734AA1969B for ; Tue, 31 Jan 2023 12:20:43 -0800 (PST) Received: from zn.tnic (p5de8e9fe.dip0.t-ipconnect.de [93.232.233.254]) (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 134301EC0682; Tue, 31 Jan 2023 21:20:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1675196442; 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=MfMP1AQjgJVYD/W9qVZ3W7rRxX1GjgBbbYC8SUbtKEc=; b=H43TWTH2Ru4Cr8AHXhIqXpIb+cnAYJ2HvliulGMEmjP1S5IMG7X0E97H+GQVxEcHu8Pn09 GeMe1Rv8ZbLt62TyjRB4+UUApoU+bOHTc0fRSa7b4sCnBfDI3HE4WWG4ktTTvbIQTc3PNe qp7SK1jYtsEa27aJRRJW4xGX8cFXDek= Date: Tue, 31 Jan 2023 21:20:37 +0100 From: Borislav Petkov To: Ashok Raj Cc: Thomas Gleixner , LKML , x86 , Ingo Molnar , Tony Luck , Dave Hansen , Alison Schofield , Reinette Chatre , Tom Lendacky , Stefan Talpalaru , David Woodhouse , Benjamin Herrenschmidt , Jonathan Corbet , "Rafael J . Wysocki" , Peter Zilstra , Andy Lutomirski , Andrew Cooper , Boris Ostrovsky , Martin Pohlack , "Li, Aubrey" Subject: Re: [Patch v3 Part2 1/9] x86/microcode: Taint kernel only if microcode loading was successful Message-ID: References: <20230130213955.6046-1-ashok.raj@intel.com> <20230130213955.6046-2-ashok.raj@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 31, 2023 at 08:51:25AM -0800, Ashok Raj wrote: > remove ret = 0 during initialization since its cleared right below. (tglx) Sure. > Need to set ret explicitly to either -EINVAL, or size. Otherwise it will be > endlessly waiting for write to complete. (As Aubrey pointed out) Then do: tmp_ret = microcode_ops->request_microcode_fw(bsp, µcode_pdev->dev); if (tmp_ret != UCODE_NEW) return size; to signal what it is. It certainly ain't an error if it doesn't find new microcode. > I think its safe to leave ret as is, since microcode_reload_late() only > returns -1, or 0. No it doesn't. Hint: stop_machine_cpuslocked(). > Pull this into the ret == 0, so taint only if the update was successful? Ok. > And add a message so its not silent? You'd add a printk for every possible operation, wouldn't you? See, the world doesn't revolve around microcode loading. If that thing fails, then someone has done a bad job at the CPU vendor testing, provided the code does the right thing. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette