Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2850092rdb; Wed, 4 Oct 2023 13:29:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFKhyzVcdl5VDJOZBLgzT2iDE3VdfZOqRfg9nkTRJZ4Lx2G6SqP2ay5m9v6C7kbfxtUCnrj X-Received: by 2002:a05:6a20:7f9b:b0:125:3445:8af0 with SMTP id d27-20020a056a207f9b00b0012534458af0mr1064553pzj.7.1696451378287; Wed, 04 Oct 2023 13:29:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696451378; cv=none; d=google.com; s=arc-20160816; b=z9AHZKVPyZM066+ULbVk7wv5voVx5vHSCN/hi5WG89Dflk1SiUkhqzZGYzNC5ax3gS 1bgyGb4ATpoOSXawRMNl60i2zYJ5jrt9mgBGoSlemqKDlQMJcf5x0QvyTHyivgJ0zV88 m16Q+tUgYj42IdXGsWnbiuA0LVdGCZso6izy+yAzN/zHaLTAVC7nz1xMEcOKpghFPb8m 3PD576VmOndfOuDnmATP0hIWSuY3lNV/q2VN6zeQbJVMH3MFV3vxdm7OUJE5uVa/+keX MWWAbVDUJ5Ur3sAzsMxNcTNN5+xm/TRJkskRQ3V/PcOIhqLjusbBtiq9LUD9HiETcb3l iKEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ULcbPeVXF1YZ+PSpdpBI4ln4bPTinWz7u+G6K/2zwK0=; fh=PIrHOtFYysmHMi70UY3qddnlyRzTG7C6tz82QsWVqEw=; b=AdZAt+64lEWgbsEqUkE73N6eR0MIpd8E+Y+PTen8XZhV5lEyXbdhrUhZh8Hfhz3dGN PLbUd8pzZ+SK25bF5KMQwiGk7+r9Y/OAqsDM3oXMcN1qj/aM06DP+yiI0hgrUDGB4iDm as+phhh0FGp4422VvX7j+CHhWm6k0Tuh74+8Bv9LFztCsgduKKlwCa5JIq48Gu+hrmyX TShEBdNTSsI5+0SfV8Ym2hMO+IyVH1s3RjxyOOPmgR05WxBCwzy+pueaC7wKf2QdfOuD MuskIof5f4TJMG9FfXAC2ZXVdup5ap1+SswsyRfRcEGZ14cks0cVLJbYjkF0fte2LkjC nLag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=26GqU3yt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id f8-20020a056a00228800b00690daa48517si4529713pfe.200.2023.10.04.13.29.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 13:29:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=26GqU3yt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 7F8E880FC729; Wed, 4 Oct 2023 13:29:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243769AbjJDU3g (ORCPT + 99 others); Wed, 4 Oct 2023 16:29:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233332AbjJDU3f (ORCPT ); Wed, 4 Oct 2023 16:29:35 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3481C93 for ; Wed, 4 Oct 2023 13:29:32 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-502f29ed596so1577e87.0 for ; Wed, 04 Oct 2023 13:29:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696451370; x=1697056170; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ULcbPeVXF1YZ+PSpdpBI4ln4bPTinWz7u+G6K/2zwK0=; b=26GqU3ytQmiEs5cmGlgk5+IGkzW5jTio9t5V3W2QwVWIL3wDelSHGnKAvus1APDTfw rv5CFTO7UDLd5umIndG7ATXGbKy/VVueysmZdjaOjfef/5smNCLUHJggzGNxjebg4vwE 2mYNXv3/pZtaIkU6QGXyQxdhjgVZkN+tOToWrOUHXSje24+KmiSiG/uYhggr17l/rGrz z1gYOmW+qsB9/y6E80jc+HMu/W3mCDm4G58hTp2h3jdtPJc5W22Q+l2nU9/LU9fdw0bC 4iNtnE42xCZoEtIHsT/JV8FTGM1tJaCKOfNnzdzSOhBz1OLQWicqM9YeKY6+sHJ7Q6BT EDlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696451370; x=1697056170; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ULcbPeVXF1YZ+PSpdpBI4ln4bPTinWz7u+G6K/2zwK0=; b=D4KQ9UD9pG6Yq2s4dzIvtpvNmqvZ5koYobTZpudC/bZjoHkHfkWeBxzSdL9gfzD7NM POKyj0+aNzkbu2BRl8uRy2RHsl3npKap0aElL2qGTd2EXeq2jc0Q+fSYAeR9n03cJcYo 3TpXdEH9Hnopm+Q1qXVYxxJtd1pTRrbaJPPHD2E1KaNyliNdXTf9iZU/V1ORSgmwLAyY MOTaVgYjfvbUIsTc8MiwGerJSqFTr/LHxLHN1OCbRZdoOqqcQY6E+DLVsFwS/KFjwfj+ loQW4qUhv5Fp5lahcoqqqqEpQyEnUU0qLd+XbNp97ukJlvIRuaOhdvBM1fG2GiV7Kzf2 6dvw== X-Gm-Message-State: AOJu0YwkfePk6o8nGACEhARf3lp+B9hZPK/OR2+uha61X9SyasUloenr Bx9ijdnAzu+RsTxUmg+Jq3hWxvfkvfkqRdPSajVk8klVSfmM0pnuME0= X-Received: by 2002:ac2:5142:0:b0:502:dc15:7fb with SMTP id q2-20020ac25142000000b00502dc1507fbmr100lfd.5.1696451369919; Wed, 04 Oct 2023 13:29:29 -0700 (PDT) MIME-Version: 1.0 References: <20231004002038.907778-1-jmattson@google.com> <01009a2a-929e-ce16-6f44-1d314e6bcba5@intel.com> <20231004075836.GBZR0bLC/Y09sSSYWw@fat_crate.local> In-Reply-To: <20231004075836.GBZR0bLC/Y09sSSYWw@fat_crate.local> From: Jim Mattson Date: Wed, 4 Oct 2023 13:29:15 -0700 Message-ID: Subject: Re: [PATCH] x86: KVM: Add feature flag for AMD's FsGsKernelGsBaseNonSerializing To: Borislav Petkov Cc: Dave Hansen , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Pawan Gupta , Jiaxi Chen , Kim Phillips , Paolo Bonzini , Sean Christopherson , "H. Peter Anvin" , x86@kernel.org, Dave Hansen , Ingo Molnar , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 13:29:37 -0700 (PDT) On Wed, Oct 4, 2023 at 12:59=E2=80=AFAM Borislav Petkov wrot= e: > > On Tue, Oct 03, 2023 at 07:44:51PM -0700, Jim Mattson wrote: > > The business of declaring breaking changes to the architectural > > specification in a CPUID bit has never made much sense to me. > > How else should they be expressed then? > > In some flaky PDF which changes URLs whenever the new corporate CMS gets > installed? > > Or we should do f/m/s matching which doesn't make any sense for VMs? > > When you think about it, CPUID is the best thing we have. > > > No one is likely to query CPUID.80000021H.EAX[bit 21] today, but if > > someone does query the bit in the future, they can reasonably expect > > that WRMSR({FS,GS,KERNELGS}_BASE) is a serializing operation whenever > > this bit is clear. Therefore, any hypervisor that doesn't pass the bit > > through is broken. Sadly, this also means that for a heterogenous > > migration pool, the hypervisor must set this bit in the guest CPUID if > > it is set on any host in the pool. Yes, that means that the legacy > > behavior may sometimes be present in a VM that enumerates the CPUID > > bit, but that's the best we can do. > > Yes, add this to your commit message. > > > I'm a little surprised at the pushback, TBH. Are you implying that > > there is some advantage to *not* passing this bit through? > > We don't add stuff which is not worth adding. There has to be *at* > *least* some justification for it. Let me propose the following axiom as justification: KVM_GET_SUPPORTED_CPUID must pass through any defeature bits that are set on the host, unless KVM is prepared to emulate the missing feature. Here, a defeature bit is any CPUID bit where a value of '1' indicates the absence of a feature. > Thx. > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette