Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1763077pxj; Wed, 19 May 2021 13:21:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnNdbywM8YOnqSTHcXBn4aJesxj38EHFzxFcWni4Fro67su93RsBOGkyUL054uBEXhS83s X-Received: by 2002:a05:6e02:1aa9:: with SMTP id l9mr989097ilv.24.1621455661810; Wed, 19 May 2021 13:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621455661; cv=none; d=google.com; s=arc-20160816; b=uMBRVR3H8uFTdOYFJna/D9xs1xtrDLXlBbmlB/hz/Iet3DjRNL/6T3u65D0Heh+pjS P3HCV3hv2bvSR4/imwouTO1xSHq0yxnN/5C7j65hc+84fvHrJ6jg2qmxmN7YqwKxJyrH brAIVJsGNVwux12kS2HtD+/oGakltljh+6h4nSRFUpx0UN95sJNYgJ63zN42uf3rjAod 7dEuUlzTfn3ltrwvpkEAwnpRFEEtBRbTI1JeeGrHi86n2GIjsX5v5iNdTrtpE8+ZTP/A 1aBxE6BbYIppOONYrqWwAd5E4E1ULTHUpra7FoMCq0CAwPx677tVJWOtDE1F94TnfinO m90g== 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=jsZ/ogGdK7ONzFDyLTBWnJutfIfdTiTEe+CqEIq+g4w=; b=uRQFnp7tgAQbuROBIKpcOt6mYHe7Hp5ieWSYhEy7dqiwYsEfp1fW4aX17KWgOvcYYh XBg0YbX8hdC+F5VrhbMs6N6dABjNTqrcLfqqNBjM+Kqs7Cor5cV076Ez0DJOT+dYc45+ 4qtInw3zp2RAgFG8+tJ7BheWCe4/NL4jSOcb9SeZ5zeeIn+m4B6xQMPeI68j8Ikg+66x obswVQeIaq+UH4wSESYcGSt5EsAxFp0HYqCn3YprP7nJO//d8il7WFjVEWUNLygrC/vD FKWqSDHZn3r70pNmu5M1Praw3tIOWW1N41enGNooU5JV0pOIRRTik34tyoa6OvhWi8wU 9ifA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=wUvDXi9V; 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 j18si345852jaq.76.2021.05.19.13.20.49; Wed, 19 May 2021 13:21:01 -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=wUvDXi9V; 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 S231749AbhESStM (ORCPT + 99 others); Wed, 19 May 2021 14:49:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231727AbhESStK (ORCPT ); Wed, 19 May 2021 14:49:10 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E8FCC061760 for ; Wed, 19 May 2021 11:47:51 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id l70so10106421pga.1 for ; Wed, 19 May 2021 11:47:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=jsZ/ogGdK7ONzFDyLTBWnJutfIfdTiTEe+CqEIq+g4w=; b=wUvDXi9VP0MO3xZHoCWYzzauHfGA9Pj8v++JGlseU33ryljXJRW2C6jM5nNgmYIVur WB3bkEN/yB/bHHzRoujUd5eYTV0ooyAexFSkoyO2WGopoPcnXYc7FwKXF+YRNKxkAK1e Y7IQhL0/NI/6l0AdDYkqYRX2wKurf3X/RMVL1KGMQ2kge9kvpqUvFKZ59GIxy4hfP8N+ 7i1JL8fG1cqh0pF2Fr+zmy5R3tqpkDjMyb/xCudbBnw9xpjvbvs6oSveeH/unNnIKwMh s4dlREP9cIp7iAFoGIbCVvDVsw3H9/V94yW90Mzjbx6S0Is0bdifq6nrLFqP6esy22eO PULg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jsZ/ogGdK7ONzFDyLTBWnJutfIfdTiTEe+CqEIq+g4w=; b=ajW6INL7Nsfwjzs/vhrljK7XTczQlF8W1jS2ew5iQ0vPlfcx11alusDTG+hLIbJhOD VTBrkk9EkjtPn5JjV0vV5EhT+84l16WIMzuiburtc5UpU6GBXAT1o+dMHM7P8N46vBE5 qnslmzwlcKqj/VdvYrgnhjbnHuz5R7/tcpTJrf5h/mM0/6flKRA86sNwhRYiA1SgwCGO FEvTM4FA98l/SoqWZ3QIN3N0eydztRp2OCLLv6IaUGv0BJSRPDT6AHvGk0g2DtHL/ccY Gk8hVKX1Fq1u5M8AZ8Or43QGqlc8uAft4Zhmm2OjuhKBuaY8DgL8jdRKRAORm9ba+w/G GI3g== X-Gm-Message-State: AOAM533mBV7YGiUP5iFrwYAl6wxOrjQpOAfsSyLYwFFZkjalzlkPpDCC YdWbgcFWTtuw7QwZaHo3wb9b8g== X-Received: by 2002:a05:6a00:22c1:b029:2dc:edbe:5e9 with SMTP id f1-20020a056a0022c1b02902dcedbe05e9mr438875pfj.51.1621450070464; Wed, 19 May 2021 11:47:50 -0700 (PDT) Received: from google.com (240.111.247.35.bc.googleusercontent.com. [35.247.111.240]) by smtp.gmail.com with ESMTPSA id n21sm130697pfu.99.2021.05.19.11.47.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 11:47:49 -0700 (PDT) Date: Wed, 19 May 2021 18:47:46 +0000 From: Sean Christopherson To: Reiji Watanabe Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 02/43] KVM: VMX: Set EDX at INIT with CPUID.0x1, Family-Model-Stepping Message-ID: References: <20210424004645.3950558-1-seanjc@google.com> <20210424004645.3950558-3-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 18, 2021, Reiji Watanabe wrote: > > @@ -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. Ya, although the ideal solution is to add a proper RESET ioctl() so userspace can configure the vCPU model and then pull RESET#. > 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. Probably, but that would require defining default values for all of CPUID.0x0 and CPUID.0x1, which is a can of worms I'd rather not open. E.g. vendor info, basic feature set, APIC ID, etc... would all need default values. On the other hand, the EDX value stuffing predates CPUID, so using 0x600 isn't provably wrong, just a bit anachronistic. :-)