Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp610106pxv; Thu, 22 Jul 2021 08:06:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4IlqcPIEe0pIWRHizTNV8qhh7q4l+vCoTNOeqrwLtTZdbuzUSJ4Ps3cKLd68RQxWsn+OH X-Received: by 2002:a05:6402:3454:: with SMTP id l20mr111642edc.170.1626966395476; Thu, 22 Jul 2021 08:06:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626966395; cv=none; d=google.com; s=arc-20160816; b=Rq7+WeArkvyR41ohRraIhRdBm4eG2+Ip1LnWnK3Fu8VvtXGMDgQ5XcsLxO1U6ZhsQC 4RKw8OZCULQkaBL95zIJ1BthvN5XD8H8UiQrBgVFficFGBP81NlmnrSEcwwS9+wSGJx+ wOrraghti+D+6JxMdpmqipD+HdUMa4ZTClJwPFo2wf/1MUeidOJbO2NSlUCvNf2xfv1/ Ccr4rk5baWiX4xr5qXoWTgQDH/59VpJPL1m3ZkpF/MWOgZjKPMaArNJXqfJW3cEs5ith SHBEihSgyTNvOuH3iIxfwVIpK/nJGivwi2+kedVrxT/Lm4mcotpz16uN88u25i4aySh8 tIHA== 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=2bgmx6aikWNECjNInrD83c4X9mWyCilMDwv4/EHVX7s=; b=Z+jFb/jyfU7MNH2YaCdPt+Ae49nVWIK4ltuQK+XUQvusMyvV9yWNcFXAOU9fi2Fnft d4AD/rvaLbyGrkdtoY0b+1LeATHyLdX0H6jtGSm5z/8AjViuCIbNvkDODRt9BYTw3q+1 hm3gXWqPHcwC1U9Spk40VGbGZ81JC/68OIThYlUL/kimBcWfVN5YacRbBYuBE/cGqrrL LM+a3ghQF4Oa9YiKrdNl0woxC//xsUOWUQkgUo0RuAREe2Nw4Bxa8ogpPYEClY4DLUZw c1wTMAFON+pFNx13sXhwHUwTaA9eMicilu/KshHK6vS9aJNQ8lwTq+2zpGCbn8QfMvX4 hv/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lNs30KEU; 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 r21si37185917ejo.665.2021.07.22.08.06.11; Thu, 22 Jul 2021 08:06:35 -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=lNs30KEU; 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 S232572AbhGVOXy (ORCPT + 99 others); Thu, 22 Jul 2021 10:23:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232375AbhGVOXt (ORCPT ); Thu, 22 Jul 2021 10:23:49 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44DC7C061575 for ; Thu, 22 Jul 2021 08:04:24 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id a17-20020a17090abe11b0290173ce472b8aso4731196pjs.2 for ; Thu, 22 Jul 2021 08:04:24 -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=2bgmx6aikWNECjNInrD83c4X9mWyCilMDwv4/EHVX7s=; b=lNs30KEUEwb/M6gib0m08PWK/K753+CPfftNySVkFtyarDhNou9D61OKqCqKJjYxFy HbJhhktBEGmikY0iJUP3ZvbNJdFURlDxfwey2orTPA511o7q5TaVc4LWD8/X1r/HUI04 Lt/ANNI3QNtz6aV5DqAxeyrwLeytqirbFB94JU/N6oBla4uzJdjnz8iLZiqwFQKPd8HP hLobZ7Fhkzo3TXxxNhHNk3zd5/UT+/oLyR7vKDCe/QuqZKblPjNVOM5kgY0FmOzHzjNr t4uyhb5rx7Fjs8RrZXDuuqhjowRkKJRDIx4Mi88kNbG8iv64Fk1kUbyGIGlaBrBa0h5k Y/Dw== 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=2bgmx6aikWNECjNInrD83c4X9mWyCilMDwv4/EHVX7s=; b=Z77IklQ9Ciieev9yksF9yF/QWBMu6LpnDv94lyXbfw4XW3YIjG/+NWsLwHhFIw++bg k4lSda2aGNJbN9LPcilvfq6/oATdZJnR3ZULUli9dCfDOPvBjjngB++B9x0mktsHcwGF eb1DhA6evRvfuUJE4UXLsC24X5xi/SZlaZcV1zS268gbmJbGcsXvJV+qXetoeb/gyppN 8ESu9nvPX7NF0TYB3Li7aq24OcaGTaDTOfsCc9FDFgtIo3WpgxaFmMbQLr0pbSeNmNk1 ClVw0CUJAsTpNbu7LGxEQOedlW1+fEVj4Iz66aPAG/xyvqeyPC7LZ4FS0r45Fhn0tTHG mL+Q== X-Gm-Message-State: AOAM530mEDmo3xOdMQSv1oO38FINTF4mNB6WjHBAN1PxASSJ8Z45oOC2 EiC6m/qewvFnTUQoyw+LE+Q9HQ== X-Received: by 2002:a62:1c14:0:b029:34a:70f5:40da with SMTP id c20-20020a621c140000b029034a70f540damr293638pfc.37.1626966263551; Thu, 22 Jul 2021 08:04:23 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id j15sm30510959pfh.194.2021.07.22.08.04.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 08:04:22 -0700 (PDT) Date: Thu, 22 Jul 2021 15:04:19 +0000 From: Sean Christopherson To: Maxim Levitsky Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: nVMX: Dynamically compute max VMCS index for vmcs12 Message-ID: References: <20210618214658.2700765-1-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 Thu, Jul 22, 2021, Maxim Levitsky wrote: > On Fri, 2021-06-18 at 14:46 -0700, Sean Christopherson wrote: > > Calculate the max VMCS index for vmcs12 by walking the array to find the > > actual max index. Hardcoding the index is prone to bitrot, and the > > calculation is only done on KVM bringup (albeit on every CPU, but there > > aren't _that_ many null entries in the array). > > > > Fixes: 3c0f99366e34 ("KVM: nVMX: Add a TSC multiplier field in VMCS12") > > Signed-off-by: Sean Christopherson > > Could you give me an example on how this fails in the KVM unit tests? > I have a bug report here and it might be related so I want to save some > time triaging it. FAIL: VMX_VMCS_ENUM.MAX_INDEX expected: 19, actual: 17 FWIW, unless a kernel/hypervisor is sanity checking VMREAD/VMWRITE or doing something clever with the MAX_INDEX, I wouldn't expect this to cause any real world failures.