Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1148844rwb; Wed, 16 Nov 2022 12:51:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf4lInJ+Ud76wy9HwvoZw78+2xiBWdQekrnf9QFKBnJPl/xr7IwQKGGolUJykiADpCnEVYGO X-Received: by 2002:a17:906:e0e:b0:78e:302f:41fb with SMTP id l14-20020a1709060e0e00b0078e302f41fbmr19569601eji.423.1668631901977; Wed, 16 Nov 2022 12:51:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668631901; cv=none; d=google.com; s=arc-20160816; b=SKeHx3TSJntjAWDNyamGKXzqtwpPSEOuPR4p83vuuLm4ZlUWGU6cuiBJJ0jmkS4RL2 HQDNQuhCKie2IGeNE/hWfSbMriwXfhV3iSFCB4vEfWwI3l2hzuheAdvCdo83a9oHhalj IpG1KvPBqHzBoYd1Ni1gQd9PFVpvH6RPN0RRyu92KQ2QdoKT58NBZeU+1a71oVDMMYih Hyc9yTgX98Rxr7/k9HlZQmc/K6XxTU+kBu3HEnLjpTAJP4UVWmINVvCZ0G5eN7VWhRJ5 NhDD4ldcTp3tFgnSU5KqOvnHwFhWcTZeJplC8J3SEpfWdu3doyqZvWCZp/Tptqbl6c8Z qShg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4LYQkdPPYclVVL0mv9lfUFrLftkqNX02YsTqGcI/i4s=; b=qDNwkI5hTnKqbrZx0/Cjo7HdLhFlQZtblCZKfrEwsBtZfZTnexag73sgy+US5hnImJ MSXHFETjtvFgmPjhug0dHRv7MpomARkjwQibTXBsleiV/m4TxFzbtbO2X7LB0FkbbzXY 1me1C5QOGgw5ZrhFGnwBliIg1Kcue8K+Tuu7yoHEXmfCqXK6BaQuOis9zH6Z3dNBZwm5 Ijae47NKDamO/qMswWVHw1An7ilZubWXlyC7AHcTF/vyy1OjXPPUGhYjUn/z9f8AgUc7 rXe1fWM1NbuKayHLRM9tkx1bvp+GuoJH/1VMC3gqk/yhYmA35u0ZG5xf/p623k1cUhJF wOHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="mYpsnOr/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u1-20020a1709064ac100b0078b0865d468si11027760ejt.549.2022.11.16.12.51.21; Wed, 16 Nov 2022 12:51:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="mYpsnOr/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233885AbiKPUWb (ORCPT + 90 others); Wed, 16 Nov 2022 15:22:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233773AbiKPUW3 (ORCPT ); Wed, 16 Nov 2022 15:22:29 -0500 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0746363166 for ; Wed, 16 Nov 2022 12:22:28 -0800 (PST) Received: by mail-pg1-x52e.google.com with SMTP id b62so17828869pgc.0 for ; Wed, 16 Nov 2022 12:22:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=4LYQkdPPYclVVL0mv9lfUFrLftkqNX02YsTqGcI/i4s=; b=mYpsnOr/EviedU0QTHToHpyNTjNV1Hk2bgkyfpy6F919jZVMSEj1B4cRKwO2wmMRsh Fdh18hNmFxnTbS+JnTnC8Ct+VkUqUM3I2j1fI7z6TSvYH01xVLlx0hrxNIl78cuQP2DX sylayksZBCUnCz2qIq/zHfOETtZJBJDbuVop8oqEGhCXw43cgTQRhGHPBce/pPn2sK7n t5RBFy7D2XvHiBjPXe9Jx02ItOLbmQkZzTtts8g6xfBr4XqCPv/82c290UXH2xB1bm2U fb6wnJXEVbOqPawzL4YaWJ61x3M5r2EB9MtOEnjxUx8JGjAtUp4oawTZh4jIrQKW0U0p 8FuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4LYQkdPPYclVVL0mv9lfUFrLftkqNX02YsTqGcI/i4s=; b=GDM9m+7SNibAD7j8rhxATrwPm0kXC/Ra1ASLv4UfArcXMIOGQWHOEcTp6nV2C6Yww5 NIaGX25m6GxgL0zsz3ovq2q1pUWX6kxYOl/8Zn34dq8WOcHIaVlVeu08pIskbzHi9606 hOwGOW2UeB7c3qTVi6r/bF7bVXBtoX9aPUcPrJS7tYlClMVVoWX1HITPK3pVPH+DqhAi 1GypvCBjA4Tgo3ZC3PvbW7dkOQUNqfXjFCpM34zolCuCIh2R9dpnlSfn5ALM9KAj7AiR SK1UGCpc+Rw+NwUnh+UPhtxorMbpY3oO6pkk4/hjWQWoacSKhp8YhJDzKxH8MBUZSSeb nS2A== X-Gm-Message-State: ANoB5pkj62e4W0IDoUlFxfpmMAMkTOph5akuKiqVuP2VuufaiNJXZXf5 RcyjH8qL2k5ZVfxQ8argv+K1PA== X-Received: by 2002:a63:f80b:0:b0:476:f69c:2304 with SMTP id n11-20020a63f80b000000b00476f69c2304mr2175184pgh.77.1668630147417; Wed, 16 Nov 2022 12:22:27 -0800 (PST) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id w193-20020a627bca000000b00571bdf45888sm10255955pfc.154.2022.11.16.12.22.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 12:22:26 -0800 (PST) Date: Wed, 16 Nov 2022 20:22:23 +0000 From: Sean Christopherson To: Borislav Petkov Cc: Kim Phillips , x86@kernel.org, Boris Ostrovsky , Dave Hansen , "H. Peter Anvin" , Ingo Molnar , Joao Martins , Jonathan Corbet , Konrad Rzeszutek Wilk , Paolo Bonzini , Thomas Gleixner , David Woodhouse , Greg Kroah-Hartman , Juergen Gross , Peter Zijlstra , Tony Luck , Babu Moger , Tom Lendacky , kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] x86/cpufeatures: Add support for cpuid leaf 80000021/EAX (FeatureExt2Eax) Message-ID: References: <20221104213651.141057-1-kim.phillips@amd.com> <20221104213651.141057-2-kim.phillips@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 On Wed, Nov 16, 2022, Borislav Petkov wrote: > On Tue, Nov 15, 2022 at 05:10:50PM -0600, Kim Phillips wrote: > > When trying to wire up a scattered host AUTOIBRS version up to > > kvm, I couldn't get past all the reverse_cpuid_check() > > BUILD_BUGs demanding exclusivity between h/w and "Linux" > > (s/w) FEATUREs. FWIW, it's not exclusivity per se, it's to ensure that any CPUID bits KVM wants to advertise to userspace uses the architectural definition and not the kernel's software defined info. This allows KVM to do things like if (guest_cpuid_has(X86_FEATURE_AUTOIBRS)) and guarantee that the lookup on guest CPUID, which follows the architectural layout, will look at the correct leaf+subleaf+reg+bit. > I guess something like below. > > Sean, can you pls check the KVM bits whether I've done them all right? Looks correct.