From patchwork Fri Sep 6 17:37:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bethany Jamison X-Patchwork-Id: 1981994 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X0k376cshz1y1L for ; Sat, 7 Sep 2024 03:38:11 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1smcuH-0004pp-4y; Fri, 06 Sep 2024 17:38:01 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1smcuF-0004p9-K2 for kernel-team@lists.ubuntu.com; Fri, 06 Sep 2024 17:37:59 +0000 Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 37B2B3F129 for ; Fri, 6 Sep 2024 17:37:59 +0000 (UTC) Received: by mail-io1-f71.google.com with SMTP id ca18e2360f4ac-82aa3ff05b9so129139f.3 for ; Fri, 06 Sep 2024 10:37:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725644278; x=1726249078; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QoAV18JZlaOn1pt27ilH3q1/X/vDcYL65xY3Qh17dRs=; b=Unp8xMNE+BUQvPqOdy29flXRQyt3AWyCyrCP3pVrFHmIevrD9G5TRgPtzftYb+wv1R 2nKlrTDbNNAOpY1gbuXVzGIIsosaFc8iAhie7j7KG8sE+xwK1Wo1hGh1/q2Rja7qx7GU pTXDNHHQMp0m/BQ2LM2oXvcI6/rkW7uZlvIRqBG4l09kBjq47Z8FMknrnONtWED5bEYg sUARcol6wenspetuYGPBEskMq/WdIi1gxjyMjJlY2rborLXDUAgQAV299Sg0JYHDl9gO woMq+0IVy9AkMdzq6HCPhFq8lZO+hgZUxisE9Ke8VQjVaCyslVflJBF2hU+oq65CcwB5 uCHw== X-Gm-Message-State: AOJu0YyXly0cY0Ip1z0+K8vss/XtMmJFjvhQlNIw2lzPDJ5Ho1HeFj8u woxmpbfpQHG20kVJWGUkNukJ/O/a4KY/HLdMP519KTRS7B6ZIefwcCpCjrhiAI4tE5P9Qc9hboE KwU3Qek2pzBTC+OhEhkyjcB2FYFUIHO+idojGbbwCDSL8lYPouCT41/+ySiLcSPJ26NAFJczB0U cpETakRZ2L6USY X-Received: by 2002:a6b:fc16:0:b0:81f:86e1:5a84 with SMTP id ca18e2360f4ac-82a9620e999mr196830139f.2.1725644277942; Fri, 06 Sep 2024 10:37:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdQ9dJgm6afYucgW+dwm4aXq5gdWE/+6Xjau8MUCDdJq+NF2MfMv854mEpYQicU2ufzhlPEA== X-Received: by 2002:a6b:fc16:0:b0:81f:86e1:5a84 with SMTP id ca18e2360f4ac-82a9620e999mr196829139f.2.1725644277537; Fri, 06 Sep 2024 10:37:57 -0700 (PDT) Received: from smtp.gmail.com (209-50-27-115.lnk02.ne.dynamic.allophone.net. [209.50.27.115]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2de7857sm4205704173.60.2024.09.06.10.37.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 10:37:57 -0700 (PDT) From: Bethany Jamison To: kernel-team@lists.ubuntu.com Subject: [SRU][N,J][PATCH v3 0/1] disable XSAVES workaround Date: Fri, 6 Sep 2024 12:37:07 -0500 Message-Id: <20240906173709.17861-1-bethany.jamison@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2077321 SRU Justification: [Impact] This patch fixes bug LP#2077321. An older commit (b056346) completely disables XSAVES instruction on all AMD ZEN1/2 hardware to avoid a bug within that instruction (utilizes XSAVEC instruction instead). This method of working around this issue is a bit too broad and causes an issue with migrating QEMU VMs from older kernels that use XSAVES to newer kernels with XSAVES disabled. This patch implements a commit (29ba89f) to improve the workaround. It disables XSAVES only on machines that lack a revised piece of microcode that addresses the XSAVES bug. [Fix] Above Commits: b056346 (x86/CPU/AMD: Disable XSAVES on AMD family 0x17) - https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy/commit/?id=b0563468eeac88ebc70559d52a0b66efc37e4e9d 29ba89f (x86/CPU/AMD: Improve the erratum 1386 workaround) - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=29ba89f1895285f06c333546882e0c5ae9a6df23 Commit 29ba89f was cleanly cherry-pick to Noble. I had to adjust the context for Jammy because J was missing the definition for 'fix_erratum_1386', but this should not affect the fix changes. [Test] Compile tested [Where problems could occur] This fix affects those who use x86 processors, an issue with this fix would be visible to the user via issues migrating QEMU VMs from older to newer kernels, or via XSAVEC being used instead of XSAVES in qualified machines. v2: adjusted to better match the stable patch format v3: submited v2 too soon, needed to add impact/fix/test/problems sections Borislav Petkov (AMD) (1): x86/CPU/AMD: Improve the erratum 1386 workaround arch/x86/include/asm/cpu_device_id.h | 8 ++++++++ arch/x86/kernel/cpu/amd.c | 12 ++++++++++++ 2 files changed, 20 insertions(+) Acked-by: Thibault Ferrante