Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1718944pxj; Wed, 19 May 2021 12:15:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2H5zBS05pQ221QF7y/8xENsX8uxYfDtYlPJBesj345BD07OnRljyNB0BHaV4l7zHbSYOp X-Received: by 2002:a17:906:1fc4:: with SMTP id e4mr704730ejt.336.1621451718742; Wed, 19 May 2021 12:15:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621451718; cv=none; d=google.com; s=arc-20160816; b=Ech2DpeGXBJfSptljq9FSqCakRIUVdIgcEzdxwpcRtwT47/b3SittkZN0HPWQJY9xt y7QWpPQTtUfQEnqSB1mjYYYPoa+gacVtvvxzX9L2N3CxLgWPHQAumTE+VjClqfxHGwgM gqsW1DlevCxuhaJsVca3q7jOSrEAF+Hdvs/x3k80MZxe86HgBCP/v6zIfKNMipIvPM2j EoYMj5Z4eyZwQhmBipFdnlKLfK+B+UUKrf0W55nr2eNchZR0auKseM9BN3RhnOAcXrzH 4B9wCuYm6sp1OaNhNp/HhmGMU4DZJq0VHumJbKzbs9914agBfzfolydRf+BDJ94GjeRS ri/w== 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=DnmuvHtt1deacPj+Snj8/pH1mY4iAhMVnQylVRRVpd4=; b=dyDVbXooc0gjM3tt7CMbU9uO/sYsJfNhIn54wvWhkCzgvF2YaYAfDmwZeA25dUMmWS haP0IwuwmvPK5/m2lq2xlV0Z6SiQmR2ckJqVF3BLaW4MB/eWrfeoiSfhObINibp6vW6k C3ALBg0QElHIMugeTKk6JEqU0X00ZUrP58J+h+AgN0KntBKD7XnrL9Nl0a0ly7Qw4MGn MsGONTQFbSsYOWfre9VuNSR2YXk4buMBt1MiYpbs/FFcmmiU9Gwo1gBEHu1yp0HJfY4b imqkx3OsQN81ory72YNRJYneE5UuQeQIwhcM1I27ZPlorUoamZVSVq68iYFeJ88cyivn yTrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YOYmwA+D; 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 c95si114284edf.464.2021.05.19.12.14.53; Wed, 19 May 2021 12:15:18 -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=YOYmwA+D; 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 S237823AbhESFci (ORCPT + 99 others); Wed, 19 May 2021 01:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239595AbhESFcX (ORCPT ); Wed, 19 May 2021 01:32:23 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 560E3C061760 for ; Tue, 18 May 2021 22:31:03 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id 27so7338465pgy.3 for ; Tue, 18 May 2021 22:31:03 -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=DnmuvHtt1deacPj+Snj8/pH1mY4iAhMVnQylVRRVpd4=; b=YOYmwA+DVk1bcQT6/IoU5pCTF3kHLLxBFH9sLDHox2JEITBzlViWyoldStr+ZDARZJ jun3TazxYuYvkvEZlOX/H5atpgG6E+5WJ/DMSWdYCQ6DV/WU3ZsqDUikxOiVpaezO0Hd LqCqFsm2XEtqeEaTz+hqdLrSHKVFOP1i3FwGbpcfUnydUJpHhfc+sMHuybhReOc5yHRY JgAwh5VhnWI/srdEtdRwqPclPGfnlceW/cqUFUZsXEiJsxkAxD7iSpYhlLbumBj04vKX Ew91emGCyayOoZi0ap3xiGBS5W4NFCXUUhKdhysToqZjwk+kDkT+rWzY/RTbAppEFIm5 faCg== 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=DnmuvHtt1deacPj+Snj8/pH1mY4iAhMVnQylVRRVpd4=; b=n6sTqm40nXubKCZWmH8qsXQAAOgIriohmURa4lFe9kSznr6meripu8W4t5Xul4SbAE sWE0bHyzxkQWunlmFAfeEs+vBBlPnrvscfmLsE7yn0QUeMm6ti3LBLPkTGSbKtHltWJ7 wXk6JOTNnPlVNrU0AWVrS9xpeQffDtIcTJMUEBLYCPmrKZbr+IB904DGcu6uL7TAmnQv blBcR/p5hD0dBBpKS+ZcOwsROZwj38AWc4XI2ocsxiWcSCZ74dNYF+WNsNxzViSj3vfC tVk3GkmI+FStG1VzpoOftOx5AgrtkhZSSol74y40OSAEF1vWfOP96RkqEPOmBbgTtsE2 ZcjQ== X-Gm-Message-State: AOAM531kxvkkMeZDFOh1GIQB0KJ4COHhWiHTULgdh8nKDduXx1L4fSXL jI8aYUmIJgUZKjaZxAi572sY1KOCNDByA4kamZONXQ== X-Received: by 2002:a63:4f50:: with SMTP id p16mr9103143pgl.40.1621402262794; Tue, 18 May 2021 22:31:02 -0700 (PDT) MIME-Version: 1.0 References: <20210424004645.3950558-1-seanjc@google.com> <20210424004645.3950558-4-seanjc@google.com> In-Reply-To: <20210424004645.3950558-4-seanjc@google.com> From: Reiji Watanabe Date: Tue, 18 May 2021 22:30:46 -0700 Message-ID: Subject: Re: [PATCH 03/43] KVM: SVM: Require exact CPUID.0x1 match when stuffing EDX at INIT 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 On Fri, Apr 23, 2021 at 5:47 PM Sean Christopherson wrote: > > Do not allow an inexact CPUID "match" when querying the guest's CPUID.0x1 > to stuff EDX during INIT. In the common case, where the guest CPU model > is an AMD variant, allowing an inexact match is a nop since KVM doesn't > emulate Intel's goofy "out-of-range" logic for AMD and Hygon. If the > vCPU model happens to be an Intel variant, an inexact match is possible > if and only if the max CPUID leaf is precisely '0'. Aside from the fact > that there's probably no CPU in existence with a single CPUID leaf, if > the max CPUID leaf is '0', that means that CPUID.0.EAX is '0', and thus > an inexact match for CPUID.0x1.EAX will also yield '0'. > > So, with lots of twisty logic, no functional change intended. > > Signed-off-by: Sean Christopherson Reviewed-by: Reiji Watanabe