Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp635015pxb; Thu, 30 Sep 2021 13:41:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJym2KhisJzEZK8t2nImO95q9qMae5LawGYqAOpwJk1nEeycIj5OWhn6GYl+WrtClfR+icQV X-Received: by 2002:aa7:d78e:: with SMTP id s14mr9329157edq.171.1633034463302; Thu, 30 Sep 2021 13:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633034463; cv=none; d=google.com; s=arc-20160816; b=UZ31cF11BGRvG3gMF4AcKoSKWECvW3/uHsgd4er+9U9FmJv5t/4r1JVjJJ2gwYaZB3 ELSd29ejIoTMA4/+qdxGUzaM583vzDMaS2ZeJr96O65+UwyRgZjuednmX03Da4ywwxkJ 07agFTg+9kZoTxkf4UL8liq826x8iNn5HwcIUgTwy05+RhR2GBIccrh1yxb129769g43 aB1FO8oC8XKqc1F6qB2VVLMH0zs9RpoHz7XS4/z6yevOnjQ6pVlmwlZOAXgpgeNa2IOM o+daFj2cuKP59F0K4FtYIA1js19grJTlPAOYqd4jkDO4+iNuVZW+FxwqDGl533nWLCBl o3ZA== 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=QMXkTSWKWE6IOTwgZL4qEhWkaG0vz1XKQFudBOV/uFM=; b=ATIrOVW+QN1P9TYNw4fOibBmlGQ18zzcsSA1tZWG9SOI0YMoIhHhrRJqFCOREH+n/n d7TW9YV0H8nDy2oCeOHCmAdacLdFOvb8JP/HR4UXfEJLBBjAbuo7AJalYQHWecRsxJhj Zmzj2ooqi527DR9elolKFJWTLd8RieWR8lthHjX0/XDRXjBHjDn0V7ILUk5x/4SVLRrY DicIFdMfDaJR1IFhvUo9lEUqxV00EEk3cgn39JNWAVx2EnIMhNH/UIgHrEFl2vRcgK47 QMQbv/bghaXIoZ5kQzb38zUBrfPd5jOWZpNJurYYqxjsiuJH4RvPhT7N1u2iPs/wBijz /jfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=DZam6ASZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb8si1967164edb.154.2021.09.30.13.40.38; Thu, 30 Sep 2021 13:41:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=DZam6ASZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S245350AbhI3PNa (ORCPT + 99 others); Thu, 30 Sep 2021 11:13:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245132AbhI3PNQ (ORCPT ); Thu, 30 Sep 2021 11:13:16 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1D01C06176A for ; Thu, 30 Sep 2021 08:11:31 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id d4-20020a17090ad98400b0019ece228690so6978410pjv.5 for ; Thu, 30 Sep 2021 08:11:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=QMXkTSWKWE6IOTwgZL4qEhWkaG0vz1XKQFudBOV/uFM=; b=DZam6ASZNWqT//2uufR62sif+1Las8Y6W53M/dKFeka+a6T8T/wMUkKq4LfWwXrDlS AKeBKhORnyrCWco1bRD79u/8tR+v1IoJ9YHG5NR4e5ZRNbA2UVO+wg4uvT4Ka9Sh0PaP +HqPeWNFp/fTDC+GcAOuLLiUhXggiGO/IBIWXpAoxkXNqnXphVqgalZ6GrigCzDxzdt8 bN6SzD7IPT2CiRE+IqRFb+xUtOI83CD09AKDCCbbBEnGtlK0AEuMqQpHM1oixXKfRGzn 6ESDHBGFAj5axFshHo9uhJGDzEpH1jq++TVtyAV2fcuDl+xxzsrPhrXGJCVJTHWe3SBA hUwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QMXkTSWKWE6IOTwgZL4qEhWkaG0vz1XKQFudBOV/uFM=; b=RWMKPifreIej8aKe8OFoahxgJrepSUb/dOVx8Re+mPg/XzbXlAGminql7qbNwWilqT WzZr8iRbXd3xHVC+pqdOqHacSSSSt3/7AGKNEe6cB7jORdymDjFO0xPwjSUmNchHhB8Q AycmIVF56h8vxoZgcUc/hAmcmpv0uAYOdx09VJPGaF4naIfY07fUpSBqNjN0ZrSsPm6g y19GHK+x8rCRoBd2vcjEHixfG4V3656XoOxQs9E0gfz8QjIp8J2Ms9TlZpaqzBfEYdOz CayqTqSMiddu7+ZkaC+euagb7uqYXbF32f+UfExd8cRS2vnY9kKW5ChGoaR9wLwwfmmJ Gx5Q== X-Gm-Message-State: AOAM533zwVxDWaA5eVAqK/M1unyaq0QpPeXzp20xZb7yJHVfaJ7hhGbb I44jRKDqjOL2sHd8FhulzG0LcQ== X-Received: by 2002:a17:90a:181:: with SMTP id 1mr7110103pjc.214.1633014691201; Thu, 30 Sep 2021 08:11:31 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id c4sm3380348pfd.80.2021.09.30.08.11.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 08:11:30 -0700 (PDT) Date: Thu, 30 Sep 2021 15:11:26 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+f3985126b746b3d59c9d@syzkaller.appspotmail.com, Alexander Potapenko Subject: Re: [PATCH 2/2] KVM: x86: Manually retrieve CPUID.0x1 when getting FMS for RESET/INIT Message-ID: References: <20210929222426.1855730-1-seanjc@google.com> <20210929222426.1855730-3-seanjc@google.com> <75632fa9-e813-266c-7b72-cf9d8142cebf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <75632fa9-e813-266c-7b72-cf9d8142cebf@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 30, 2021, Paolo Bonzini wrote: > On 30/09/21 00:24, Sean Christopherson wrote: > > * RESET since KVM emulates RESET before exposing the vCPU to userspace, > > * i.e. it'simpossible for kvm_cpuid() to find a valid entry on RESET. > > + * But, go through the motions in case that's ever remedied. Note, the > > + * index for CPUID.0x1 is not significant, arbitrarily specify '0'. > > Just one nit, this comment change is not really needed because almost all > callers are using '0' for the same reason. > > But, perhaps adding kvm_find_cpuid_entry_index and removing the last > parameter from kvm_find_cpuid_entry would be a good idea. I like this idea, but only if callers are forced to specify the index when the index is significant, e.g. add a magic CPUID_INDEX_DONT_CARE and WARN in cpuid_entry2_find() if index is significant and index == DONT_CARE. I'll fiddle with this, unless you want the honors? > Also, the kvm_cpuid() reference needs to be changed, which I did upon > commit. Doh, thanks!