From patchwork Wed Sep 20 02:22:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengen Du X-Patchwork-Id: 1836926 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 4Rr2Pn2R2dz1ynx for ; Wed, 20 Sep 2023 12:23:08 +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 1qimrb-0003Ed-WC; Wed, 20 Sep 2023 02:22:52 +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 1qimrS-0003Dx-N5 for kernel-team@lists.ubuntu.com; Wed, 20 Sep 2023 02:22:43 +0000 Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) (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 625143F179 for ; Wed, 20 Sep 2023 02:22:42 +0000 (UTC) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-1c43cd8b6cbso36376455ad.0 for ; Tue, 19 Sep 2023 19:22:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695176560; x=1695781360; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kLnoLK/I5mwoVqznolmGqFrlYrOO/1XJR64Thwhwx/c=; b=d6KZz6x42ZTgosrxukx+z9M0sPWUp9sOga4U5YzQyktW8IBPqbvJA3rqZXUPyLaMRr qGvqh+d3/M48dbnbfMCdHCuX1r+aKrASxaczWyGhCZb6pie8Ijoa/bAqm1/qZtlDoOfP dZL6c6qj3ymzeqSnD+TVuNg88eaI7pQoq+3E5mpkHjFJ55GLfcgqTeV/Lj7wm6rfljtM ybF0DCRi8X3vBxHY3NkK80lHpDXQ/26szyoREBib6HDEziGxKQqtmcQIf5gSKOkSdbQs Vln8/th9TrQ0SGw5ilduP4NU9pP6NWqDJKzeXUy6NhYfl8P03tFonIjEccvK/wtSN04E skKg== X-Gm-Message-State: AOJu0YxZPhm+mtCJJiMBhaV7JVPEFbn7Zp9qTY8kAFfNQ9aLcELa6A0h aRYpjtCuv9fX740NF7YL5bSXAVMrHZwKrfGJzI2S6klSOzmbqpaSakegVlidtMlVHiz+5o7ZpFy 4n6+MtYB4fPu/GoADHHu0/5GtFREoE4KomvNCiGS4pNjjCxPriwkdKUY= X-Received: by 2002:a17:902:d509:b0:1c3:6e38:3943 with SMTP id b9-20020a170902d50900b001c36e383943mr1331692plg.56.1695176560463; Tue, 19 Sep 2023 19:22:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8+SydXgvg6CS/JePZANEEK3YH/gqqNPnXdyzp6tOSzp84xPY08qSQU+2gZb+XqHlV1pQ6ag== X-Received: by 2002:a17:902:d509:b0:1c3:6e38:3943 with SMTP id b9-20020a170902d50900b001c36e383943mr1331680plg.56.1695176560111; Tue, 19 Sep 2023 19:22:40 -0700 (PDT) Received: from chengendu.. (111-248-178-97.dynamic-ip.hinet.net. [111.248.178.97]) by smtp.gmail.com with ESMTPSA id u5-20020a170902b28500b001c07110f3ccsm10626614plr.247.2023.09.19.19.22.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 19:22:39 -0700 (PDT) From: Chengen Du To: kernel-team@lists.ubuntu.com Subject: [SRU][J][PATCH 1/2] Revert "KVM: x86: Always enable legacy FP/SSE in allowed user XFEATURES" Date: Wed, 20 Sep 2023 10:22:34 +0800 Message-Id: <20230920022235.111762-2-chengen.du@canonical.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230920022235.111762-1-chengen.du@canonical.com> References: <20230920022235.111762-1-chengen.du@canonical.com> 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/2036675 commit a1020a25e69755a8a1a37735d674b91d6f02939f upstream. This reverts commit fa9225d64f215e8109de10f6b6c7a08f033d0ec0. Signed-off-by: Chengen Du --- arch/x86/kvm/cpuid.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 5f83b3f2680e..89c1b78057e9 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -187,13 +187,7 @@ static void kvm_vcpu_after_set_cpuid(struct kvm_vcpu *vcpu) best->ecx |= XFEATURE_MASK_FPSSE; } - /* - * FP+SSE can always be saved/restored via KVM_{G,S}ET_XSAVE, even if - * XSAVE/XCRO are not exposed to the guest, and even if XSAVE isn't - * supported by the host. - */ - vcpu->arch.guest_fpu.fpstate->user_xfeatures = vcpu->arch.guest_supported_xcr0 | - XFEATURE_MASK_FPSSE; + vcpu->arch.guest_fpu.fpstate->user_xfeatures = vcpu->arch.guest_supported_xcr0; kvm_update_pv_runtime(vcpu);