From patchwork Fri Sep 15 15:00:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13387135 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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E44F6EED602 for ; Fri, 15 Sep 2023 15:01:06 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.603205.940122 (Exim 4.92) (envelope-from ) id 1qhAJN-0004Uu-Tb; Fri, 15 Sep 2023 15:00:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 603205.940122; Fri, 15 Sep 2023 15:00:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qhAJN-0004Un-Q9; Fri, 15 Sep 2023 15:00:49 +0000 Received: by outflank-mailman (input) for mailman id 603205; Fri, 15 Sep 2023 15:00:48 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qhAJM-0004UV-A2 for xen-devel@lists.xenproject.org; Fri, 15 Sep 2023 15:00:48 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a47306e3-53d8-11ee-8788-cb3800f73035; Fri, 15 Sep 2023 17:00:45 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a47306e3-53d8-11ee-8788-cb3800f73035 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1694790045; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xCdonSEcxaU4vwlQq38DDIMhFTLSIUdrwIj+TgYH0mY=; b=J+gUtUO1Abd0hiHosLLr/FeGhBT39vYZRXG4fufJ9XKSSmuJTBuDHmWb zoELZZg3M2GfYpaqxM+1tM+CuG8jVoHduzeyKNXjknoEQKbUcM4Kifc5x srf7wzHwPZ9HLJdUokeju3D7mnzpRDwlb2wjVQWKCSi3zrUhx5GfN1Ukq w=; X-CSE-ConnectionGUID: X/kd13lbTuuvW1qLdo0dGQ== X-CSE-MsgGUID: qYqSKn0vRF+3Dh3Y+UsXew== Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 123201208 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED X-ThreatScanner-Verdict: Negative IronPort-Data: A9a23:+2eaAqLujdG83sdyFE+RG5UlxSXFcZb7ZxGr2PjKsXjdYENSgzMPz WNKDWCCb//ZN2H9LY8jPtmy8h5XuJHVnYM3TFdlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t ZV2hv3odp1coqr0/0/1WlTZhSAhk/nOHvylULKs1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws Jb5rta31GWNglaYCUpKrfrZwP9TlK6q4mhA7wVjPaojUGL2zBH5MrpOfcldEFOgKmVkNrbSb /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/ jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5HRmJCr KccIgwQcw683vuSzLXjRsZV05FLwMnDZOvzu1llxDDdS/0nXYrCU+PB4towMDUY354U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NRXCprfY= X-Talos-MUID: 9a23:sLimug4mqFX8qBCnJEKIsQ0txoxx0r2VK0ZVj68o+JKoNXdBeAqGvDmoF9o= X-IronPort-AV: E=Sophos;i="6.02,149,1688443200"; d="scan'208";a="123201208" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu , =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= , Jason Andryuk Subject: [PATCH 0/9] x86/spec-ctrl: AMD DIV fix, and VERW prerequisite bugfixes Date: Fri, 15 Sep 2023 16:00:29 +0100 Message-ID: <20230915150038.602577-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Patch 9 is the XSA-439 fix for the AMD DIV issue, disclosed insufficiently ahead of August 8th for us to prepare a fix for the embargo. Patches 1 thru 8 are prerequisites, identified while trying to write patch 9. All 9 patches are for all security trees. Andrew Cooper (9): x86/spec-ctrl: Fix confusion between SPEC_CTRL_EXIT_TO_XEN{,_IST} x86/spec-ctrl: Fold DO_SPEC_CTRL_EXIT_TO_XEN into it's single user x86/spec-ctrl: Turn the remaining SPEC_CTRL_{ENTRY,EXIT}_* into asm macros x86/spec-ctrl: Improve all SPEC_CTRL_{ENTER,EXIT}_* comments x86/entry: Adjust restore_all_xen to hold stack_end in %r14 x86/entry: Track the IST-ness of an entry for the exit paths x86/spec-ctrl: Issue VERW during IST exit to Xen x86/amd: Introduce is_zen{1,2}_uarch() predicates x86/spec-ctrl: Mitigate the Zen1 DIV leakge docs/misc/xen-command-line.pandoc | 6 +- xen/arch/x86/cpu/amd.c | 18 +-- xen/arch/x86/hvm/svm/entry.S | 1 + xen/arch/x86/include/asm/amd.h | 11 ++ xen/arch/x86/include/asm/cpufeatures.h | 2 +- xen/arch/x86/include/asm/spec_ctrl_asm.h | 152 ++++++++++++++++------- xen/arch/x86/spec_ctrl.c | 49 +++++++- xen/arch/x86/traps.c | 13 ++ xen/arch/x86/x86_64/compat/entry.S | 9 +- xen/arch/x86/x86_64/entry.S | 30 ++++- 10 files changed, 220 insertions(+), 71 deletions(-)