Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1719619pxj; Wed, 19 May 2021 12:16:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz35xBAT//bRdb5/CiDSLrg5ntqdzRuKq8jGzUaksVUx/6s691gLtnA62I9M2DPSFhNYVU5 X-Received: by 2002:a17:906:11d3:: with SMTP id o19mr652762eja.387.1621451772950; Wed, 19 May 2021 12:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621451772; cv=none; d=google.com; s=arc-20160816; b=z+kC2t/mBz3Z6RbZmsHZtVWbU78APdZlP+Yy7A0YKOwC5heKGFgnaUIejdGi7s0KeM wqjBFCPGnBjhrPxVtDjr+5kaTFGCEsMSInxkkOrbRRFkOKeLjcXd+a7i/f9cU7ITslI9 7yCxUVvN0T5+s9zPCZx89r0GchexxAwBAVS58Kawn4SLZZfXICSuW7vAOY5P449mThAT DRJPf4n/yi/lek0WqB9lUjOn9YxTQ9uPbn1J1735aJdfbvMdnn6MW13zbkKQoKgeH1kT sZlcKzdR5yL1lUxH7B2wO8rNPEZfqwNuqzlpBdMiPujhcEnxn0OfVxFCKvpWu9cZDqMY C7jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=nAKu+6MtH3s2XmeunaD2gUOZOf681k6swYOZ6Q7YH1o=; b=aoFU7mXsvHg3pJ8ev1avInmvRVZ265HHDp9C+Nl+NCzSorNgSwr8YQRaYyflGFpjPT +58oxzlbE1qwNedngaZBtvZvn2h92kA6HwmMrlcBaK+sg1nB1OsnyPgMMvKRpFhc8fJ/ GJoIJIBKXm+6fFPehYpdkspJ+0gVNOIZFvp8gKTRJHgOki+KSJUczR9RBbImkWv46315 WKxQ493JPzWB3mzgPa9euEMvgs6xT9XMjPGoDpQeJCrZAbi2TPvxfksIxCZvT6+rsEJS WvvxAE5M3HLiNpUQqExd9iV4pgqZcT04vjRtEiHgmhznYB/BCpcBPvDYWWL9+0hnEhlz RpXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dl0Y3OWK; 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 lv19si478063ejb.257.2021.05.19.12.15.48; Wed, 19 May 2021 12:16:12 -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=20161025 header.b=dl0Y3OWK; 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 S234820AbhESGBD (ORCPT + 99 others); Wed, 19 May 2021 02:01:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232157AbhESGBC (ORCPT ); Wed, 19 May 2021 02:01:02 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9889BC061760 for ; Tue, 18 May 2021 22:59:43 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id n6-20020a17090ac686b029015d2f7aeea8so2914832pjt.1 for ; Tue, 18 May 2021 22:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nAKu+6MtH3s2XmeunaD2gUOZOf681k6swYOZ6Q7YH1o=; b=dl0Y3OWKdChY8uN3dxtupVDMeHqtfCUT/EAQIz6Lpivm3M3ZO/XZgAyyl3WX31vTCN Rtg+MIpdW7PDIup9To1oMb47EX46dRVS742LoPE8/m7vI9WHK5SFYS2tGTZmG2b65ccb l7NcMMixEl8mqbvSlav9WTXVpquyh3bkSsWFPRArj8yhzxJypS5LSLZ8dWukRe3CXwnE xOjuBdJg41kO+t11XTe9j1WAt2/VZY8yUvdNJjhtLMg5OzybUdtAvqLE/a4OYdhLzP8z zJ2VzCXrHdfRzBRXZigvh8/8z8r7ObdtjCbCyN03G8LJQAVHRhBFDi6Wl++/j//elAix H4kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nAKu+6MtH3s2XmeunaD2gUOZOf681k6swYOZ6Q7YH1o=; b=euIdrXLuzAlzUcOqW/yaxd6RM8dLLl6E2hV2Eav2vwF2BDZQ5KSawoVFh7hkCWBCjs 04DLcEF1RD4pK4pbvK2yuVouXWgJUkyIHstuyakARMi1/84AzPzexHxwK1jgVBqxlcFk gLT4qfd9z3Dp9u0qbguzI9ZAWzzDL+n0Pw7ZLRSI5oyKT/yoXxDq2PhR/pyW6rEA6zuX 9YsoMqXs/fXWqT4T0jC7xKrppGNV8VWJOvnfnzMyzBIE+s7EmVoWnsrvWXFe0r/LJD7q C1zN5DQLaQDLbA+eNi8LAtJOKNc8r0xWs+jKeIfkXJHlimhbwsgypXVf3Z4ZlLl2Vvbh 8jxg== X-Gm-Message-State: AOAM530U1KPUA7MfbuI6eRGPCP3D5uDafDBM3QudwDE6S5Zp7pYHlAZv /ECAR/4N80Rw+f1177L0gZr+h+v8J0CK1gyVwI7F1w== X-Received: by 2002:a17:902:f20c:b029:f0:af3d:c5d8 with SMTP id m12-20020a170902f20cb02900f0af3dc5d8mr8859697plc.23.1621403983010; Tue, 18 May 2021 22:59:43 -0700 (PDT) MIME-Version: 1.0 References: <20210424004645.3950558-1-seanjc@google.com> <20210424004645.3950558-3-seanjc@google.com> In-Reply-To: <20210424004645.3950558-3-seanjc@google.com> From: Reiji Watanabe Date: Tue, 18 May 2021 22:59:27 -0700 Message-ID: Subject: Re: [PATCH 02/43] KVM: VMX: Set EDX at INIT with CPUID.0x1, Family-Model-Stepping To: Sean Christopherson Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -4504,7 +4505,11 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) > > vmx->msr_ia32_umwait_control = 0; > > - vmx->vcpu.arch.regs[VCPU_REGS_RDX] = get_rdx_init_val(); > + eax = 1; > + if (!kvm_cpuid(vcpu, &eax, &dummy, &dummy, &dummy, true)) > + eax = get_rdx_init_val(); > + kvm_rdx_write(vcpu, eax); Reviewed-by: Reiji Watanabe For RESET, I assume that rdx should be set by userspace when userspace changes CPUID.0x1.EAX. BTW, I would think having a default CPUID for CPUID.(EAX=0x1) would be better for consistency of a vCPU state for RESET. I would think it doesn't matter practically anyway though. Thanks, Reiji