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 D8428E9271C for ; Thu, 5 Oct 2023 17:55:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230055AbjJERzg (ORCPT ); Thu, 5 Oct 2023 13:55:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231282AbjJERzL (ORCPT ); Thu, 5 Oct 2023 13:55:11 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5EA83C3F for ; Thu, 5 Oct 2023 09:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696524733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hfBa2PBztZPefecPJI7ke3UbcZNr/dJZxdjNyd6oBXc=; b=dr7dtT+XaZ1GUUCCB9ks+MMH4V+SSCfdswXfmbzA8abA0Pe2hgAFRZOwleEjc9EOO77Dv2 mU7J22iDc/BoUIzAIakM+viR1kjHUKjqKeFr47AQ+BFUVMJmbaCfVLLKBvvZ264EfqXvj9 vV2mkncMSgBH6WDk9v8PmGw0HQIlHGM= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-636-5crtaUypNbaoZEqs-Fu0xg-1; Thu, 05 Oct 2023 12:52:02 -0400 X-MC-Unique: 5crtaUypNbaoZEqs-Fu0xg-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-9ae0601d689so95212066b.0 for ; Thu, 05 Oct 2023 09:52:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696524721; x=1697129521; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hfBa2PBztZPefecPJI7ke3UbcZNr/dJZxdjNyd6oBXc=; b=sZl/FKhbbyg9Fbffh4ORvmW1Fae3PZEuvCvWCco6hKLggOdyLxhN58GQdF/30xs6aj 0tY91eWnIEnDyRPU5mQUobIQifALiLKqC1pCpuF30re997eIiVsJ8alQuH2Cqw9l2Vqg cngJXYTWL+4W7pBpExOvspzGv29UWkNbnReDUMGoRM1jmdrUW5PuOkonXSTwSn63AKvG CClDn6wZyudzXWQofVe92Xx+6C1EfRHOlm+tmj6zQe4uqUbD8zYhAn/fXJMRqo/AVZxr JV2tnOvJzc4bSG4LeOzVAs/beCPeXQUjLbrX0ylz9663HU8N+XbcfYausPFkpQfB0mWf pmLg== X-Gm-Message-State: AOJu0Yz+kg7wqHwzZuM/xGCfrQ/dWamXJtjzgZuXYG5caCMSO1HoAfKt impikg+RBNXTQsNuqe/EZFgs+D+0w7MQLOqZBZGsl2S2QaU3uNdmfa3GQGdouQHM1qTNFP/qI38 srzeFzpDqiWIjpyWT5CxAXt+F X-Received: by 2002:a17:907:271a:b0:9b9:ed52:8213 with SMTP id w26-20020a170907271a00b009b9ed528213mr2108071ejk.54.1696524720980; Thu, 05 Oct 2023 09:52:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgssYgHWHZZXyp1cFbR2loPbqq9hiLlw7Dc8A83s5u0YNtnV3XNQusYBiNSkut41GTr1E/UQ== X-Received: by 2002:a17:907:271a:b0:9b9:ed52:8213 with SMTP id w26-20020a170907271a00b009b9ed528213mr2108053ejk.54.1696524720646; Thu, 05 Oct 2023 09:52:00 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:9af8:e5f5:7516:fa89? ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.googlemail.com with ESMTPSA id j18-20020a170906411200b0099ccee57ac2sm1465845ejk.194.2023.10.05.09.51.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Oct 2023 09:51:59 -0700 (PDT) Message-ID: <4318facf-df2d-7658-39d2-d2dce1ec77d9@redhat.com> Date: Thu, 5 Oct 2023 18:51:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Content-Language: en-US To: Jim Mattson , Dave Hansen Cc: Borislav Petkov , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Pawan Gupta , Jiaxi Chen , Kim Phillips , Sean Christopherson , "H. Peter Anvin" , x86@kernel.org, Dave Hansen , Ingo Molnar , Thomas Gleixner References: <20231004002038.907778-1-jmattson@google.com> <01009a2a-929e-ce16-6f44-1d314e6bcba5@intel.com> <20231004075836.GBZR0bLC/Y09sSSYWw@fat_crate.local> From: Paolo Bonzini Subject: Re: [PATCH] x86: KVM: Add feature flag for AMD's FsGsKernelGsBaseNonSerializing In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/5/23 18:41, Jim Mattson wrote: >> I hope I'm not throwing stones from a glass house here... >> >> But I'm struggling to think of cases where Intel has read-only >> "defeature bits" like this one. There are certainly things like >> MSR_IA32_MISC_ENABLE_FAST_STRING that can be toggled, but read-only >> indicators of a departure from established architecture seems ... >> suboptimal. >> >> It's arguable that TDX changed a bunch of architecture like causing >> exceptions on CPUID and MSRs that never caused exceptions before and >> _that_ constitutes a defeature. But that's the least of the problems >> for a TDX VM. 😄 >> >> (Seriously, I'm not trying to shame Intel's x86 fellow travelers here, >> just trying to make sure I'm not missing something). > Intel's defeature bits that I know of are: > > CPUID.(EAX=7,ECX=0):EBX[bit 13] (Haswell) - "Deprecates FPU CS and FPU > DS values if 1." > CPUID.(EAX=7,ECX=0):EBX[bit 6] (Skylake) - "FDP_EXCPTN_ONLY. x87 FPU > Data Pointer updated only on x87 exceptions if 1." And for AMD, to get the full landscape: - CPUID(EAX=8000_0021h).EAX[0], "Processor ignores nested data breakpoints" - CPUID(EAX=8000_0021h).EAX[9], "SMM_CTL MSR is not present" (the MSR used to be always present if SVM is available) AMD had a few processors without X86_BUG_NULL_SEG that do not expose X86_FEATURE_NULL_SEL_CLR_BASE, but that's conservative so not a big deal. Paolo