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 C72D6C77B75 for ; Fri, 19 May 2023 15:25:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232327AbjESPZs (ORCPT ); Fri, 19 May 2023 11:25:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230440AbjESPZr (ORCPT ); Fri, 19 May 2023 11:25:47 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16F6819B for ; Fri, 19 May 2023 08:25:45 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-ba83fed50a6so7903101276.0 for ; Fri, 19 May 2023 08:25:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684509944; x=1687101944; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=dbzcRfBB1+pEw+dXK/ywmbABJqPTnI7COLwP4+XGTiE=; b=M3gF+aFF+EuvIl3aiW4+m2GPqPGE/GKqEaqZyg7fetawJ1hsrC0xXhqTUTLId3n38j tV3MHoO6dEiDtpIcBg0Wes3VfAA6gyS0Ga/E11OcFfuqlIYVp1sr6JTuDc9vYOWQTlkG W0OtAlxTZk9pNDkf7sFhkyoq7EuT/wQtzIjrQoSiaO5UfKXQjqfHy2O0Zx8NfzDTqC5D uKcdHCtVZXrWBhBNvJBpZqG5c1TO+tBaNG7Zc9fo6yqOD36iFlWhPx6kFuTLJ6anm1Gw 4QvXmzXmhTr4wxsSVdeTVt5xyWWzXkcpgC0lHWZ2WB6yk/l6xeTrSqE0dKwrcEHpY1z9 2Sdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684509944; x=1687101944; 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=dbzcRfBB1+pEw+dXK/ywmbABJqPTnI7COLwP4+XGTiE=; b=f/ThJWcdkbH7HqkaqKEKE9TctrSLYRnqRcTqxE6McxNOaDK/ATNt+BGjdF+iflvjD5 seuHVlk3h8Z4ZVLumAk1HLkkAQnmBCXZ2AwSOvr8d945HTA5HzyMmUk/Eh0IGbM4mnzm BbRB2OgBfhDJw7xNJWudB7/58gimmiI4k2b15f9Jyk0KSGHRplhC71zV08/CCC9OYcwG DgsK+3kzXXjAScoxgELJGgSj9amfzlL5oYDj6+Clc/KncjWk65XoQHQmTkI+/D4NPJpL mxjIcuIxAaZa7Ly5j9OZm9A0BoMpNWgWoosJZxl9p72iam1Pr1NuMeLL+TGn7QMQ26f4 wu0w== X-Gm-Message-State: AC+VfDy+wQKYwMIFlYSV3z3VzNahdRthXWKFU6OweuiwYqC960iow/2S imIKzC4REVr15bRYGYaxV3/gokqoSVg= X-Google-Smtp-Source: ACHHUZ4sYH32KFSFG/TNGCwZDQnCcJdqVO78Ci8X3cPbl1fYiWlg5mUkIpbwy+R3E2qp/NvSRWE0KPQBolE= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:689:0:b0:ba8:3401:a466 with SMTP id 131-20020a250689000000b00ba83401a466mr890153ybg.6.1684509944314; Fri, 19 May 2023 08:25:44 -0700 (PDT) Date: Fri, 19 May 2023 08:25:42 -0700 In-Reply-To: Mime-Version: 1.0 References: <20230506030435.80262-1-chao.gao@intel.com> Message-ID: Subject: Re: [PATCH] KVM: x86: Track supported ARCH_CAPABILITIES in kvm_caps From: Sean Christopherson To: Chao Gao Cc: pawan.kumar.gupta@linux.intel.com, Xiaoyao Li , kvm@vger.kernel.org, Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, Jim Mattson Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 19, 2023, Chao Gao wrote: > +Pawan, could you share your thoughts on questions about FB_CLEAR? > > On Thu, May 18, 2023 at 10:33:15AM -0700, Sean Christopherson wrote: > >I do like snapshotting and then updating the value, even though there's likely no > >meaningful performance benefit, as that would provide a place to document that > >the "supported" value is dynamic. Though the fact that it's dynamic is arguably a bug > >in its own right, e.g. if userspace isn't careful, a VM can have vCPUs with different > >values for ARCH_CAPABILITIES. But fixing that is probably a fool's errand. So > > I am not sure if fixing it is fool. There would be some other problem: Heh, "fool's errand" is an idiom that means doing something has almost no chance of succeeding, not that doing something is foolish. I 100% agree that there's value in presenting a consistent model to the guest, but there are conflicting requirements in play. To present a consistent model, KVM essentially needs to disallow changing the module param after VMs/vCPUs have been created, but that would prevent userspace from toggling the param while VMs are running, e.g. in response to a new vulnerability. The only feasible idea I can think of is to disallow *disabling* the mitigation while VMs/vCPUs are active. But then that prevents turning the L1D flush mitigation back off if some other mitigation is deployed, e.g. via livepatch, policy update, etc. That's why I said trying to fix the knob is probably a fool's errand. AFAICT, there's no straightforward solution that makes everybody happy. :-/