Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3247783rdh; Mon, 27 Nov 2023 09:24:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IHeaXFyCCdgkjBgGUTYrDuAET3Zh+qjwfyxL80Rbc7LX5EfLcSi9TQcBiGuDNqYAo6q6nnk X-Received: by 2002:a17:902:da8a:b0:1cf:c901:5458 with SMTP id j10-20020a170902da8a00b001cfc9015458mr3799661plx.17.1701105861921; Mon, 27 Nov 2023 09:24:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701105861; cv=none; d=google.com; s=arc-20160816; b=x9hb1YS4ddwjZHj8iVhGwN2tV0LQQhYNZqVl5um+WUUg5zSu+xsDqs2q9mOicD4RoP vvzX5V6/+Jvm9zrp38sc+0BlqXCx7f7I83Bot88v1wqZ/OthxEVSFXLW/uGic21/Sg+j qEFffUS57Sn6x63l9UNqRMTwTO8QW92btS+4wN2qXVQ9r1+BOENpdYomKyQLiwldXGXV IFCg49wrVV2EECAjvwspSA2ug2UFq78VlUzAGZajs3pHSzajvJkRoPeiSFbM8Zth6yqE sVN+KUHuMLnMzWlyFJosOXS6oa6dpWwPey2jujxWNX4FhAsCqiyU9G0PaZIRN36olDkb pWrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=rL9LfDvcE9DBnUyEpS1p+L6oMlIKUpS9e4ZuAaaj8xo=; fh=F9gYGd5j+DD5Qna5n6U0l9ESiSIxt5M+4dR8qvvJfHU=; b=mYxtBLYkFelcZRXmQoeb/rUMohLw3HIwxYeB5n8lguWvzz1Ce4z//3hD4Nc0SNl0ZO QiUHjjF6wTlmA0zYzxpOFtfe/5tItnFPM53nn7Xc3Z4LGOryjbkTGZYwMbTTdABuAJkX 5Q7mzW6v5y6cRLaXk4sUpzpKF/PSlL/TBnld+a6MVS0zVTA+0bdpY46/f0n64pDZFlmO hAOvhtn/7kxZcxzrjBx9A0aFgRLDD/AGb+wYIAO9cssmV3/Dxlo9UhrvyoSFtRM1YfEW PMaHK0sF/fk23CiDuBdv2fB0Aerj7ZPEKzCSEfLD0bmToFC26l/ol2o+5ObSGFZbHXln pClw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=dDeDJeVQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id jj14-20020a170903048e00b001bf1d1d99b0si9994005plb.568.2023.11.27.09.24.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 09:24:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=dDeDJeVQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 6AE1F80740ED; Mon, 27 Nov 2023 09:24:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230029AbjK0RYG (ORCPT + 99 others); Mon, 27 Nov 2023 12:24:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229761AbjK0RYF (ORCPT ); Mon, 27 Nov 2023 12:24:05 -0500 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF3EBA5 for ; Mon, 27 Nov 2023 09:24:11 -0800 (PST) Received: by mail-pj1-x104a.google.com with SMTP id 98e67ed59e1d1-285d0ef1056so1649830a91.1 for ; Mon, 27 Nov 2023 09:24:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701105851; x=1701710651; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=rL9LfDvcE9DBnUyEpS1p+L6oMlIKUpS9e4ZuAaaj8xo=; b=dDeDJeVQHlQ994p98Okkt8Fi8rO1ymAvpvZY+lNMB0xLQP3k3YRPwn9ZU9FM10XfYP MpWA0na4iyrnNjsT1acdT0xPP8jDcuoea7DyqVPE2BudYQTvoI4nvsdOXtnIxvyqE9m1 fqNWvqdHvZVzjONjkZAQVCua/7BOXMe1xSrmLKgk9Ac2Vs5kx8zUcTeWZoqNhqVerl1K dpBkNjWJrHd8C8c+ubG39GQute/aj+q7GVgozK+sqjlEpTI17g3cIPVDJbYny4+OwWI5 7P464B7FJqQt+9EbtT/IrxqNel4bMvdakiNUUYr6hzJ69vYfrNJu+6r1HE2cXoZGrqjJ VqKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701105851; x=1701710651; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rL9LfDvcE9DBnUyEpS1p+L6oMlIKUpS9e4ZuAaaj8xo=; b=cmmx7/H37I3dGCGqRSk9j92g4ou/BzyvNxiiG/EUVr/5xtJ93tzHaLNAp7G8a4c4aW yxzTqpRd9QvN9O3u3D7PMf5TJUh3giLhz6GeW0gi53DnpbQH7IEBu+DubBJFmng8Q0fM tghMag65ET9G9Xc0FxUwDp9sfbOixPbaAFcXpHVt3c7Pf5pnYh+7fBwaQQv6RofjJ9k4 NkzAEZYgBkRIqOoPOEAuHOmprA/DOZ4TRoWUVvgX3L9OSrx9XJVz5IPbHHNxBLFmj0w5 X7ohs8+Dp1mUMg0jx9s/pLE/sPu0DFvYCCJXnMbodPuYzI97R6S0U0Q9S06jTCUitbwW ihkA== X-Gm-Message-State: AOJu0YzcBYQC4r8BAfuYt3QRqCXI0dYKGTM1pRUHmSUGVTxEvcMn0RjL BnBLHtkQTfZT5nBcaHFRjgncVBTyQvM= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:90b:e8e:b0:285:b86b:6412 with SMTP id fv14-20020a17090b0e8e00b00285b86b6412mr1194032pjb.4.1701105850944; Mon, 27 Nov 2023 09:24:10 -0800 (PST) Date: Mon, 27 Nov 2023 09:24:09 -0800 In-Reply-To: Mime-Version: 1.0 References: Message-ID: Subject: Re: [PATCH] KVM: x86: Allow XSAVES on CPUs where host doesn't use it due to an errata From: Sean Christopherson To: "Maciej S. Szmigiero" Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 27 Nov 2023 09:24:19 -0800 (PST) On Thu, Nov 23, 2023, Maciej S. Szmigiero wrote: > From: "Maciej S. Szmigiero" > > Since commit b0563468eeac ("x86/CPU/AMD: Disable XSAVES on AMD family 0x17") > kernel unconditionally clears the XSAVES CPU feature bit on Zen1/2 CPUs. > > Since KVM CPU caps are initialized from the kernel boot CPU features this > makes the XSAVES feature also unavailable for KVM guests in this case, even > though they might want to decide on their own whether they are affected by > this errata. > > Allow KVM guests to make such decision by setting the XSAVES KVM CPU > capability bit based on the actual CPU capability This is not generally safe, as the guest can make such a decision if and only if the Family/Model/Stepping information is reasonably accurate. > This fixes booting Hyper-V enabled Windows Server 2016 VMs with more than > one vCPU on Zen1/2 CPUs. How/why does lack of XSAVES break a multi-vCPU setup? Is Windows blindly doing XSAVES based on FMS?