Message ID | 20230821064728.38227-2-chengen.du@canonical.com |
---|---|
State | New |
Headers | show
Return-Path: <kernel-team-bounces@lists.ubuntu.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=RNQL5m58; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (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 4RTjj06MTfz1ybW for <incoming@patchwork.ozlabs.org>; Mon, 21 Aug 2023 16:47:47 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from <kernel-team-bounces@lists.ubuntu.com>) id 1qXyhO-0004Co-0T; Mon, 21 Aug 2023 06:47:38 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from <chengen.du@canonical.com>) id 1qXyhL-0004CM-LZ for kernel-team@lists.ubuntu.com; Mon, 21 Aug 2023 06:47:35 +0000 Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) (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 6509D3FAA1 for <kernel-team@lists.ubuntu.com>; Mon, 21 Aug 2023 06:47:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1692600455; bh=0PscXplakcoQa24slPc6I7rzTnE82nXtivVj9Hgvp4A=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RNQL5m587n1Y9D0x85y2eXvJHR1dABeggF2f/+N30O9NqBeJq3n149vWiRmxzMYan R+MXckPyLBNQyCRuupuZf60i3fAET2t507dGSGv+ovYPhnzW8FnEs2VI9iefhMoaOt 1qKj435HQko3rw5YOGOnSADemIus2i2bDwGqsp6Mbm8c9efbYWIybNjDcRHDNMpous sLz+jzZi0VyhAGOiosV7+4WttDkAH6+xeVVqnyHvpf2dAMgejPoJl/JPhA7jRytFnQ l+PImXup0uvto0HZFMqh0JMGS13HRbv1MMpfv50Mrgjo13NxPdnx0OuEZ5G4+WAE1M MHo8NNIXBkN8w== Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-26d52dc97e3so2507301a91.2 for <kernel-team@lists.ubuntu.com>; Sun, 20 Aug 2023 23:47:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692600453; x=1693205253; 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=0PscXplakcoQa24slPc6I7rzTnE82nXtivVj9Hgvp4A=; b=MsEKVQKQxKaBwjCUCKykr7DF3fpT0n2jDSxnzh6eSJFIbGBqC1U75mTfqpbhfFKJLn uqAduDgu5ydKJnbLrqLnoYLQb5sMrIHuJcPJHbslLr7FrkUc8gnW98uQl+0ydeeVvq6t 4DwiqFiHu9OlZhPWx4L3vRvvUEK/LMjxv8QJGbCcs5Dd0ckCaT6ZydBZOUaB3fJgFHi3 iUneH8bFgje0mNrHLn+dgTGYsQdaB0yriN2ZK8ZkUoqTIGxG9ZxntSxkNVk/e3usKIk7 bJRYRY12p+x9EWTg+PDa6byuCje/CyQuj5dsA8/lc169inBewvE82bXhFWT5ENDk3mbo fd4w== X-Gm-Message-State: AOJu0Yxn7uTbkJJ6vR49GpTbWO2plpT+GhDZoCEkRS0Lq4BwAQnu1/O7 YI1zGpKpZ7awiyAi5Ado/5FIFDeN3/ICoO9pFmxai7ar4bwkN8nFWzzEg7RwEfHIKlqZxBcBxOT xZi8KiDhF3LH621jpmvztGqBEsLn/ydk1GOz0DnYcyFSbhifRWQ== X-Received: by 2002:a17:90b:150:b0:26d:287f:a545 with SMTP id em16-20020a17090b015000b0026d287fa545mr2900798pjb.29.1692600453665; Sun, 20 Aug 2023 23:47:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGlI+mjDPhKbiNgyZ1Qh2qkqJo6b7FvTdkVA3C97MqKTvyzFBG3wO/Br2ySIr/FIw4mpmWvfg== X-Received: by 2002:a17:90b:150:b0:26d:287f:a545 with SMTP id em16-20020a17090b015000b0026d287fa545mr2900786pjb.29.1692600453205; Sun, 20 Aug 2023 23:47:33 -0700 (PDT) Received: from chengendu.. (111-248-116-169.dynamic-ip.hinet.net. [111.248.116.169]) by smtp.gmail.com with ESMTPSA id l11-20020a17090a598b00b00267b38f5e13sm5275515pji.2.2023.08.20.23.47.32 for <kernel-team@lists.ubuntu.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Aug 2023 23:47:32 -0700 (PDT) From: Chengen Du <chengen.du@canonical.com> To: kernel-team@lists.ubuntu.com Subject: [SRU][J][PATCH 1/2] x86/kvm/fpu: Limit guest user_xfeatures to supported bits of XCR0 Date: Mon, 21 Aug 2023 14:47:27 +0800 Message-Id: <20230821064728.38227-2-chengen.du@canonical.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821064728.38227-1-chengen.du@canonical.com> References: <20230821064728.38227-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 <kernel-team.lists.ubuntu.com> List-Unsubscribe: <https://lists.ubuntu.com/mailman/options/kernel-team>, <mailto:kernel-team-request@lists.ubuntu.com?subject=unsubscribe> List-Archive: <https://lists.ubuntu.com/archives/kernel-team> List-Post: <mailto:kernel-team@lists.ubuntu.com> List-Help: <mailto:kernel-team-request@lists.ubuntu.com?subject=help> List-Subscribe: <https://lists.ubuntu.com/mailman/listinfo/kernel-team>, <mailto:kernel-team-request@lists.ubuntu.com?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" <kernel-team-bounces@lists.ubuntu.com> |
Series |
A general-proteciton exception during guest migration to unsupported PKRU machine
|
expand
|
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 528437e3e2f3..8e24e2b22948 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -187,6 +187,8 @@ static void kvm_vcpu_after_set_cpuid(struct kvm_vcpu *vcpu) best->ecx |= XFEATURE_MASK_FPSSE; } + vcpu->arch.guest_fpu.fpstate->user_xfeatures = vcpu->arch.guest_supported_xcr0; + kvm_update_pv_runtime(vcpu); vcpu->arch.maxphyaddr = cpuid_query_maxphyaddr(vcpu);