From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85F64E7F124 for ; Tue, 26 Sep 2023 20:27:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235391AbjIZU1i (ORCPT ); Tue, 26 Sep 2023 16:27:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229580AbjIZU1h (ORCPT ); Tue, 26 Sep 2023 16:27:37 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 106FA126 for ; Tue, 26 Sep 2023 13:27:31 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-59ee66806d7so181425047b3.0 for ; Tue, 26 Sep 2023 13:27:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1695760050; x=1696364850; 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=EdU4ik3Tu4D+QwzpIlWNvwrHhBoMHXPt/qFjpNSs+BU=; b=r5gZQuvgtOa92Je7jWNmHORi3S8iCWLY++wgRBSa6bMVvN7EQm0SaOkKP1oJNdwPf9 x2oVpkMEVwwA3PWN1LgVV7CPvGGl836kBmFrcX35i61LpE4n39PjiuaqTC0O1tt0kFu/ 0Ipp7EwvoykDpAX1FD7q7v4zRPer448+MxmTQBjq3cDvFRSwYzueZwDymtkW1lDkf9h5 CMLCD/9OYIQGG2/gtukKiNz4Q8o1+ZD5ZDl/+Cf/gazuCqO4D2hLm7PMTrI9vYaiYqTh Zc43oeS1DxuJ0Xji7zHGjSYL1Gl19Rc/cLLhhFojdDna5ajIdVYtudwXfI+D/6YJsnWY 8HVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695760050; x=1696364850; 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=EdU4ik3Tu4D+QwzpIlWNvwrHhBoMHXPt/qFjpNSs+BU=; b=O9vRqu39Ge8P7zL+scYFm/tS91FItd11UXM0XMqsdYgaEt3MRjjaihtvkHKGWa58eN YSWtLZwWOfNkTU86dkL/UbapOARAlNqdj2iZW+8NkR9J07tIawa9LLkAV24gz3YJHRPX pX6qWewx/OMnVCVa7ijj5lgj1qVVmO0nsRYNy5FQwFI+EVdJpAscxJWBtkdmCDBpE/FC fLPJHC+ts5+/kLzytHoq+J/7iMFm6EkN8IsnX4L0+9vVPw+TZOiBAXH6cz9ZD4CrnHMF jrtvccyRDfLDOy1OceX7+zFKiyHFaO6bU51YtTmY3fwN7ihch34UJnTxLLWXK96K5hjg CwEg== X-Gm-Message-State: AOJu0Yy1Tby7J+8UE1L5u42wRL9x+PFbq2jlgL/7GcnSuTwKKSoL45TY ystTmp4/im0yik09szeqy4fWev2Ybmo= X-Google-Smtp-Source: AGHT+IFPOQAdc8TRe/tImSYB9Fu0OTGHqt/zZjOX/Assxkqq9ECMf/QKfiMqacQf21wAW/sGgFNTh0KJYa8= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a81:e345:0:b0:59b:db15:498c with SMTP id w5-20020a81e345000000b0059bdb15498cmr572ywl.10.1695760050193; Tue, 26 Sep 2023 13:27:30 -0700 (PDT) Date: Tue, 26 Sep 2023 13:27:28 -0700 In-Reply-To: Mime-Version: 1.0 References: <93592292-ab7e-71ac-dd72-74cc76e97c74@oracle.com> Message-ID: Subject: Re: [PATCH] x86/kvm: Account for fpstate->user_xfeatures changes From: Sean Christopherson To: Tyler Stachecki Cc: Leonardo Bras , Dongli Zhang , kvm@vger.kernel.org, pbonzini@redhat.com, dgilbert@redhat.com, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, bp@alien8.de, Tyler Stachecki , stable@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Tue, Sep 26, 2023, Sean Christopherson wrote: > There's another related oddity that will be fixed by my approach, assuming the realloc > change is also reverted (I missed that in my pasted patch). Userspace *must* do > KVM_SET_CPUID{2} in order to load off-by-default state, whereas there is no such > requirement for on-by-default state. Scratch that, KVM explicitly requires KVM_SET_CPUID2 to grant the guest access to off-by-default features, e.g. so that the kernel/KVM doesn't need to context AMX state if it's not exposed to the guest. Thankfully, that has always been true for XFD-based features, i.e. AMX, so it's safe to keep that behavior even though it diverges from on-by-default features.