Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp207958rdg; Tue, 10 Oct 2023 08:09:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGsr8hgxrvbuwotB2p4zKpC4sFaLFYjaA41B87gCyYf2hTgS9mrYEn96zYWTFKKCQhsA9wv X-Received: by 2002:a05:6a20:441e:b0:155:2359:2194 with SMTP id ce30-20020a056a20441e00b0015523592194mr24017048pzb.46.1696950569182; Tue, 10 Oct 2023 08:09:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696950569; cv=none; d=google.com; s=arc-20160816; b=Rcmn8IkC16wahr9eWad0Rgf+eV018CJV2+G2sGnxw2MwG45KJgmm+WPAX5bmd6NjHa X5il4oKFlxv+W7wyDXTZNEN6Xk1p2O70yoqAN02Swh0mFNoqdqroDpVzGOs8Mzk1JxO6 hLPBfNwzD21HEzJLVHqInHxg7GZlV/e3ikzh6RLVBmocs4TDzZrhttcr3kMHxA7TSVRd HETZdzJ88qmxQNTcMl6dBUkn3EDWwX1DNgjLTtvSk+AwT6GD6I/slwI7vFWA2FRRzyMl 1Cs7cdVa7HaiNOsPViNKxxTkrA4CyD6MJa3c+4gu6BwmSjncV4Sns/GdeotKg++wsu/c 7Eew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:subject:cc:to:from:dkim-signature :dkim-signature:message-id; bh=prHCTxNxZ5B1ZFd6qhXarZL1ID3t1WRHiphgWL880RQ=; fh=8iy+GLBXZdpcs/hIddJ7mbUapYjefwP9Gb111pAzFms=; b=ofI5pAKLSJxmn8ujWk18+rhv+YmVD80aiFgOqSxgq7AnlIDqnTQE3wwpuMTY2wamXv CvLuMPl7G+nkpouOhIuFs8lPecs0PgkdFVJptjVcBTlzv1OmCAenaj0DFBW3E5JqAw0V fIEAsfD6E8w4SUfOldbZ1hkhPJ1Te43taOGDohMeQZ+LQpt9fIj9F3NYMx6DCUYNbGaz aMyxcqwAtl7uwW0v1ZbkK5zAdz2+wyDxpNw7GYGz9grSLQruRP6QGEA+4DK6dhQQ5qyb wXro4WZ0qc/fMSIWbykdwdtUQ9kK0wI6ijAMHmo6qIELNSo230tHQhj3Td1iRW0d61d1 C38A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=YtTHQmcU; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id k14-20020a056a00168e00b0069343bdd500si9965905pfc.319.2023.10.10.08.09.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 08:09:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=YtTHQmcU; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 85ED18040EAF; Tue, 10 Oct 2023 08:09:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233252AbjJJPIu (ORCPT + 99 others); Tue, 10 Oct 2023 11:08:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231865AbjJJPIt (ORCPT ); Tue, 10 Oct 2023 11:08:49 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3593AC for ; Tue, 10 Oct 2023 08:08:43 -0700 (PDT) Message-ID: <20231010145130.987300357@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696950521; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=prHCTxNxZ5B1ZFd6qhXarZL1ID3t1WRHiphgWL880RQ=; b=YtTHQmcUbg8vMxIhnSh9eukJugWmXDm/8qz4rNPvPrV9zCKFMJMiVaRxnQFn/JQcxZF3M5 SFJsYjBgsB/kih0GtE2ZRXD+I7t3absx9HrLHgPxIVSKow32y4SbwDgiaJ7Hr6aNfrcv/F HFPF0ScbHfKczTNbY4GK1nZEHQ2BSJKeaH2qzfHjLiQ9ECxtKp3UCXh0Vy+leFEDHlFdmk ykLfUSRhzvNIlb/lahfHJ/DrpWwAmPbE2kvqQs0c7Bgkqvo1kbflBnCJQSS65woRutLGIB QCAgm/0cDZf7ubLMeyuUxqDGCE7keXa0/JtvtiWz9nZLOA7etHXwJZLierxtew== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696950521; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=prHCTxNxZ5B1ZFd6qhXarZL1ID3t1WRHiphgWL880RQ=; b=+GBzg72sZ+zLY/HxaPfUX616ePveXSjzQ5+IY3p4T1Ide3+YnRCWkrRyGje5Vvcs74wCVJ wgj/w/rGwyUwTECw== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Borislav Petkov Subject: [patch 0/5] x86/microcode/amd: Use cached microcode for early loading Date: Tue, 10 Oct 2023 17:08:40 +0200 (CEST) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 10 Oct 2023 08:09:03 -0700 (PDT) When Borislav applied the microcode overhaul series: https://lore.kernel.org/all/20231002115506.217091296@linutronix.de/ he partially reverted patch 15: https://lore.kernel.org/all/20231006132617.GOZSAK+YCEwVsEuUdr@fat_crate.local/ to keep AMD suspend/resume working. After looking at this in detail it turned out that AMD does not use the microcode cache for the early loading during AP bringup and tries to find the microcode in builtin/initrd. That in turn requires to have a CPU hotplug callback for late hotplug which ensures that the microcode is updated. That's actually too late as CPUID bits are evaluated already before that callback is invoked. The reason why this was done is the horrible 32bit hack which invoked the early loader before paging is enabled. That's gone now which in turn allows to remove all this by initializing the microcode cache before the APs are brought up and use the microcode cache for early loading on APs during boot, manual hotplug and resume. This gets finally rid of the hotplug callback and the ugly initrd_gone hackery which was required to make the post init AP loader work. The series applies on top of: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/microcode Thanks, tglx --- amd.c | 34 +++++++++++++++++++++------------- core.c | 44 +++----------------------------------------- internal.h | 4 ---- 3 files changed, 24 insertions(+), 58 deletions(-)