Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5935890rwb; Wed, 21 Sep 2022 14:55:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM60blZ+wIVDw73qg4ec5zaYze5nsPRHZ3U02japOgZ42NXl91hvo6A5IanZuVxjMA1DqMWm X-Received: by 2002:a17:907:75ee:b0:77b:c559:2bcc with SMTP id jz14-20020a17090775ee00b0077bc5592bccmr242497ejc.537.1663797327768; Wed, 21 Sep 2022 14:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663797327; cv=none; d=google.com; s=arc-20160816; b=CoEbT7I0GMCSco9mHLCfGKBiRmTDFKlp24cOxzxy0/yU62lvmF30q7M/v1zHpkpy7q vEZsa54iCYRMaWIw/v1dAp/OWBwja1ECd44gi0la4ubOvGJ1qhIxEwISnkvokHWBnkZ9 GLJJFP/TiAXy8Mh2BztRwUOcqt+FX9TLdjyQ60Vsj+N8QvcCL2E3ILKwXUPmIHErohda xYzvuxpTH9AycAJ4zUzn8uTvxEBA3ye1mu28tDc/tyBxIENsYoEHsjqRlCn+13Ta2php oOBuHd7j074tzUVZWSoSzj8nCm9ZXA6CSt1x/klU8Qu4XZh0Zrx7m3uqoYVA8yr7gks+ QKqg== 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=F49n0GDWtFmpiEIHBxknxSVaGxbsGKILhJWwZ2t+BIY=; b=JL+dtzreKllcFijodHY/3Orlpu+I/1t8rWVYSB2IPD1ubiG5hPBpqGmtmSKbaiQZ9i tT+MqHmIAjDL52BdWpmRkO5BGN5KA8tPdINt0faI+TrTfXrMn8ypSYNFIChXkgtAYfjV AL/YdvmPIMz3F4kLZtjQvRdt7IwGAABN8FNJhhp+lhxQHmKN6WpEzgivte1J2DWB1Z8R uTPCxLrA/ojwT90VFUIaRPXMckWM9u7JjUHss6pjK9cQCy6lBKtIO1faG2E7QCKRJnLd RgFWnBDBUfw3BYMlSKJ0rUNbhTbSt/d3FKm/4AsBmdi3GyMWOV2sA77c8kr+Yir3eYiO ZgnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=mzGpGMY1; 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 t23-20020a1709066bd700b00780b95a07b4si3188621ejs.873.2022.09.21.14.55.02; Wed, 21 Sep 2022 14:55:27 -0700 (PDT) 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=mzGpGMY1; 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 S229785AbiIUVj1 (ORCPT + 99 others); Wed, 21 Sep 2022 17:39:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbiIUVjZ (ORCPT ); Wed, 21 Sep 2022 17:39:25 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC986A61E1 for ; Wed, 21 Sep 2022 14:39:24 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id iw17so7007739plb.0 for ; Wed, 21 Sep 2022 14:39:24 -0700 (PDT) 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; bh=F49n0GDWtFmpiEIHBxknxSVaGxbsGKILhJWwZ2t+BIY=; b=mzGpGMY16PyeLUqED5yAMlsEOv41nLTQbC2DGal+lSNtg3tgwepvtu6yZsVNbpKNIX mK2p8FC6zZ5wE+oCfqn4hWEbLAB1G2VmzL8RBQh8NVddTm6Xa9mdndwTGs79/rRWw9Yt qMmVix4ap0MkiOB8Ia78WnvYF84wdztZITWX7I3SV3fVRcaHfuvlBxQBJc3ZmmxNTH7D lArHiD0DxV21v5rJI7k0Do8lFAHbX0J6/bGD75AujWRJ1Km72dX5ofW2Z5pSbBm7ZouW D88MQLGmgGOHOvQ/0m5nqdkrlAYC5EI7ekuM4lx1nVCqxpxKeRdW+qYOwy1KzS9Ok0Up OSzA== 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; bh=F49n0GDWtFmpiEIHBxknxSVaGxbsGKILhJWwZ2t+BIY=; b=ylIvRdZrt1oR1+nITQaPl0jmWbUjR+YXx8lGsOj4QBkWlAmgy3cJg0l2oWIgQWfq+5 4B0mlLkVF2uEkx/rSUuxeiVcfS+8xpgDIfn1rI3fb8zFoZ0n8Ah2BuMVT7w33dNI6Fuw j6AFpkHMMYCgR+k2BmoQBovYUtiD02Yy5lh9wIkmtp2bHAtXF5mcvL9esc1v2mjGYmJJ n6mJHeXXH9q2nMHZ8picGmTgYHAcpMuEliM121gZtp8pFiiKj/vbDs9Y5nT2NMqdaX6r HJJmNxoIOZz/d27BzRPYzujN94mwT6Dio5muK3avnrZOSzbXpCIGtboseLsKGCv1AVDP Jn6A== X-Gm-Message-State: ACrzQf08eTEciPCvUBa709Bfca25l3GSmTUJtKzaUkgyMJdgU4d+tJyO BO8y+Ve6R7ayy5fkuH+cyLGM4g== X-Received: by 2002:a17:902:d70a:b0:178:5d52:9e41 with SMTP id w10-20020a170902d70a00b001785d529e41mr104932ply.0.1663796364312; Wed, 21 Sep 2022 14:39:24 -0700 (PDT) Received: from google.com (223.103.125.34.bc.googleusercontent.com. [34.125.103.223]) by smtp.gmail.com with ESMTPSA id bb11-20020a170902bc8b00b0016c57657977sm2511097plb.41.2022.09.21.14.39.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 14:39:23 -0700 (PDT) Date: Wed, 21 Sep 2022 14:39:19 -0700 From: David Matlack To: Vishal Annapurve Cc: x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, pbonzini@redhat.com, shuah@kernel.org, bgardon@google.com, seanjc@google.com, oupton@google.com, peterx@redhat.com, vkuznets@redhat.com Subject: Re: [V2 PATCH 4/8] KVM: selftests: x86: Precompute the result for is_{intel,amd}_cpu() Message-ID: References: <20220915000448.1674802-1-vannapurve@google.com> <20220915000448.1674802-5-vannapurve@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220915000448.1674802-5-vannapurve@google.com> 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=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 On Thu, Sep 15, 2022 at 12:04:44AM +0000, Vishal Annapurve wrote: > Cache the vendor CPU type in a global variable so that multiple calls > to is_intel_cpu() do not need to re-execute CPUID. > > Add cpu vendor check in kvm_hypercall() so that it executes correct > vmcall/vmmcall instruction when running on Intel/AMD hosts. This avoids > exit to KVM which anyway tries to patch the instruction according to > the cpu type. Out of curiousity, why do we want to avoid this exit?