Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3096880pxj; Sun, 23 May 2021 21:32:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyM63rccWiIigD40iGlZ7J8Dd1D7VCetBH7ky4BlKOn9iKyjBzIboNp49DAqYHMZa5omQTa X-Received: by 2002:a92:b111:: with SMTP id t17mr13664442ilh.208.1621830768120; Sun, 23 May 2021 21:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621830768; cv=none; d=google.com; s=arc-20160816; b=M2HdhuwFKEjE7qphI4PoDe4XPVu6jbHrOllY00ZkI1Jx4cj3CWqu+TweF3cJB76oup sADGq8qmlLXMc0p6MqbaQv9atLsiXk1wo/NNJiQAZPkaCy6t/EimakCj6UgA1fBX5Yre MPcp4/vVGLNI7wiXIa3iODu7fdnWPPsp+eUbatjAnA62rUiTE5hUHUTGfuhrOZEG6KTT cnyglNmHbuUgJufDoLlPO4NyG+Lmart9wgLWcWSVOE/1un+nYPsNgtrgttkGWeKVkiUJ yje+WOhU0OcfUQj8DSLANl0/Z3bE/dQHNEs1QoYffTmNrV3c1gUvrFzVapFokKrZg2og U3fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=gKlhqQXM4UBJP6nopL7HhB9INiyQffua7cr3HwkBZ3Y=; b=K0fg0cnx4H0wc2D2zLi4SeTowfXMqBfa2jfaGT8DYya1djuAloM77lDD2OvCTN4hl8 qsX8ZHeq4bud2HUwOX1GpYjvLJuqTZfp6E+IjSzYu3p9dfnHQhigxrIc7+PXeje6eW4P GyFU/2FkszyWNA19V55pxHAWMDiMRVrq171vyo+9j/d/74eKHFwx4RXPWSo9TTM0FsPO 0Zx+kpSwL4BaNVpsMuLYhJI0S+iUKsTEnuCwEzeqp98Uskf2IalqpwW39QhtwBHVm2uK j7/NAvIPJ3OhrT/xGsBOAiMerRTU4E4uszGzBUlcz0839T1vhT9qgBkuYkHE7P7VD7m7 ybHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YIz1361H; 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 y9si13234189ilp.9.2021.05.23.21.32.34; Sun, 23 May 2021 21:32:48 -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=YIz1361H; 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 S229733AbhEXEbc (ORCPT + 99 others); Mon, 24 May 2021 00:31:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229564AbhEXEba (ORCPT ); Mon, 24 May 2021 00:31:30 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C5CCC061756 for ; Sun, 23 May 2021 21:30:02 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id pi6-20020a17090b1e46b029015cec51d7cdso10391186pjb.5 for ; Sun, 23 May 2021 21:30:02 -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:content-transfer-encoding; bh=gKlhqQXM4UBJP6nopL7HhB9INiyQffua7cr3HwkBZ3Y=; b=YIz1361Haj6fycLVqZNIpw9DVTZefr/Q0N9dFydkS+BcaySvcHUBsAxRb99Ra8r8X2 Z2hSQOJwy1CLpffwFcDKg2Ybi2ZXkYC3oahSiJZt2x6I4Ah2vq0Kho7ENY1iz4z6dXX/ jzd8k9zDZZVXESgmnbPqsTX5kTfu6U+hSPwTG0b3thkA/VPjoTvndHO45r/LGEAO+U4E GnD0jmeY+cbeV0G04z08HaOP93bU5isTzdtY7uBWfudreyIomSbBM2bpJvJ9Zrhh98we HMy2mVoBmlCZqmbkP1o+daVVJPgGog2789RAaD4VOTWvKpgNCcZRSe82UpuMSPmpDd/x 4gAQ== 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:content-transfer-encoding; bh=gKlhqQXM4UBJP6nopL7HhB9INiyQffua7cr3HwkBZ3Y=; b=VfXd4Op74Z5mLnXfZK7Jq0JeUmYrnYnYoBNyoCmSYf86GsMB8AdMieEMPojnZfT+vw mjgytUy/KcXExImgt6AqZTKZxIbo4yDTjq8wB3G73vFefULwzf36IdhsjGON0lECShGv qtq9tMKqiyMqY7qKCGI+GKdxZF09VeZm6t/mrZBVDwsH+68rNBRU06AEwdys0oZ4TiVN 1Y9aYV0aaVgrgdF5qF7aTEXvO6M6g9/OxY4qk6Q+/ab3KgMNNLNVRJMYJX0yMQAp6RVP twH/wC2wBzukgRmqA7if9SK4N+MKcoziNxZLsNKxVmskDBapGR5RgwwaxHPCG8GVb4ZZ Munw== X-Gm-Message-State: AOAM5331GtY+qirPf5z/0bnnCt29yDIuc4lIe/evwMmvdVptUicSRrDB 1t6Bq8/hZqlwN2dyfCVRSsZBjA6WmqPtfySTmTU2DA== X-Received: by 2002:a17:902:f20c:b029:f0:af3d:c5d8 with SMTP id m12-20020a170902f20cb02900f0af3dc5d8mr23344483plc.23.1621830601820; Sun, 23 May 2021 21:30:01 -0700 (PDT) MIME-Version: 1.0 References: <20210424004645.3950558-1-seanjc@google.com> <20210424004645.3950558-3-seanjc@google.com> In-Reply-To: From: Reiji Watanabe Date: Sun, 23 May 2021 21:29:46 -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" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > On Tue, May 18, 2021, Reiji Watanabe wrote: > > > > BTW, I would think having a default CPUID for CPUID.(EAX=3D0x1) wou= ld 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 C= PUID.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 o= ther hand, > > > the EDX value stuffing predates CPUID, so using 0x600 isn't provably = wrong, just > > > a bit anachronistic. :-) > > > > I see... Then I don't think it's worth doing... > > Just out of curiosity, can't we simply use a vcpu_id for the APIC ID ? > > That would mostly work, but theoretically we could overflow the 8 bit fie= ld > because max vCPUs is 288. Thanks Larrabee. > > commit 682f732ecf7396e9d6fe24d44738966699fae6c0 > Author: Radim Kr=C4=8Dm=C3=A1=C5=99 > Date: Tue Jul 12 22:09:29 2016 +0200 > > KVM: x86: bump MAX_VCPUS to 288 > > 288 is in high demand because of Knights Landing CPU. > We cannot set the limit to 640k, because that would be wasting space. > > > Also, can't we simply use the same values that KVM_GET_SUPPORTED_CPUID > > provides for other CPUID fields ? > > Yes, that would mostly work. It's certainly possible to have a moderatel= y sane > default, but there's essentially zero benefit in doing so since practical= ly > speaking all userspace VMMs will override CPUID anyways. KVM could compl= etely > default to the host CPUID, but again, it wouldn't provide any meaningful = benefit, > while doing so would step on userspace's toes since KVM's approach is tha= t KVM is > "just" an accelerator, while userspace defines the CPU model, devices, et= c... > And it would also mean KVM has to start worrying about silly corner cases= like > the max vCPUs thing. That's why I say it's a can of worms :-) Ah, I see. Thank you for the answer and the helpful information ! Regards, Reiji