From nobody Wed Mar 29 18:45:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PmwVW4jrrz42wB3; Wed, 29 Mar 2023 18:45:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PmwVW4Dytz3NZk; Wed, 29 Mar 2023 18:45:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680115555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4VC61rUGOQf6w4J/u2UJYsDhWdCQkmL4k99AY+YyWrU=; b=IlFNXA/s/AL47iyG9yX8W1+nprSC/+0AFbelMxtYjs1U4WW5MUp0IJd0q6SgDpojM/SNDt coOdOTG/uWAH+R0xxmND/Q0HPgDH9cX59flXEloJjWiy7pp3jMgOk85a6RncjiEdLPgKaq CgP8bdXJ11tFvnnnjoY95aLJ1jqNkkcdbku3cwKNAIg6z2KLSwFYe6iMPuHh4BV1kbAhIA u9LqRGMYE3CEyShxgIrHhIsfipWWveJ1MIGhnF+0WGwakSVpW2W8n8QBmklzbEqq00Jz5x xAlmfy/D0wFdQIw9it5DmOaFXNGO4999458bqaD+KvxNxhuOM/OfDiT0Yh3k6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680115555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4VC61rUGOQf6w4J/u2UJYsDhWdCQkmL4k99AY+YyWrU=; b=Gdnxk/z94zzcAgWMHth1jrOAOR+t+KDUlNDQM/QoCtppqfn1ti9pakvWk73qYVvOg7Qpz/ 6B6U+jplLmYl1VCv93Wg1TnHXRU8GCm2Gz4gW6g28Nq2gt6q8bzDqUNjKly39HOPEsIBSY ErR3OZCJGiga9iJoar3pjHPoum1KU+fVQ1Jj4NpteEOxpMJwYWfyJ1VAvr7UcTFAvCTJ9u r+1kq9dtUSSljKdwx28LI3CGOgGDxeGDZVMqxcHUwhcHle4+lMiyXve6t5YAqZvQZD4xFl i0k/GpvyiyTtRqMkbZQfX/elpZa0YjdVMkBhg3/Cm/YqBtxbSRWeaT/5RQjELA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1680115555; a=rsa-sha256; cv=none; b=mZ9wfS6M5Va8B97EVM6UIXoX3AfRtQliL2Ljkr+IrTO+dfkAm2kmptLaF9fQ4feQschNLu dIPoicWpFLMF9du7D4wF12+2IYpKUeySTWrwrR11kuEamZoYs97MGv3e/k8tBkmxgM3pFt +lXPtxiG3n2h6Jpr9ROUh0f2v6jd1Z8nl5dmxnOV3ri7Jb9MQ4R7nxxHwvrjcQnp9m3od6 vz5KyFs6yDbSGD9ySn8C2d2w1nyGnV2poIT9XrZD2LjQqX0RvoFbVxo8rsnNZ15yqyD6y1 vHmwBAJ78hcSrRWP09xgARG6L4KX+5T6l5ZYQzPeeS1rEHDIc1qb1hM+E2EyVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PmwVW3JTKzh0S; Wed, 29 Mar 2023 18:45:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32TIjtCG022132; Wed, 29 Mar 2023 18:45:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32TIjtNn022131; Wed, 29 Mar 2023 18:45:55 GMT (envelope-from git) Date: Wed, 29 Mar 2023 18:45:55 GMT Message-Id: <202303291845.32TIjtNn022131@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: cd137909c309 - main - amd64 wakeup: recalculate mitigations after APICs are woken List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd137909c3097fe223ce2b49075eed42a4933bb5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cd137909c3097fe223ce2b49075eed42a4933bb5 commit cd137909c3097fe223ce2b49075eed42a4933bb5 Author: Konstantin Belousov AuthorDate: 2023-03-28 23:51:44 +0000 Commit: Konstantin Belousov CommitDate: 2023-03-29 18:45:20 +0000 amd64 wakeup: recalculate mitigations after APICs are woken APICs are needed to broadcast IPIs for MSR writes. PR: 270489 Reviewed by: dchagin, emaste, jhb Tested by: dchagin, manu Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D39302 --- sys/amd64/acpica/acpi_wakeup.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/amd64/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c index 3df4457550d6..62e11f5797f6 100644 --- a/sys/amd64/acpica/acpi_wakeup.c +++ b/sys/amd64/acpica/acpi_wakeup.c @@ -294,19 +294,21 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, * in acpi_sleep_machdep(), after the microcode was * reloaded. Then recalculate the active mitigation * knobs that depend on the microcode and - * cpu_stdext_feature3. + * cpu_stdext_feature3. Do it after LAPICs are woken, + * so that IPIs work. */ identify_cpu_ext_features(); - hw_ibrs_recalculate(true); - hw_ssb_recalculate(true); - amd64_syscall_ret_flush_l1d_recalc(); - x86_rngds_mitg_recalculate(true); mca_resume(); if (vmm_resume_p != NULL) vmm_resume_p(); intr_resume(/*suspend_cancelled*/false); + hw_ibrs_recalculate(true); + amd64_syscall_ret_flush_l1d_recalc(); + hw_ssb_recalculate(true); + x86_rngds_mitg_recalculate(true); + AcpiSetFirmwareWakingVector(0, 0); } else { /* Wakeup MD procedures in interrupt enabled context */