Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4380257pxv; Mon, 5 Jul 2021 22:43:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwo7pnMTWQpja9g7w9nWJo01RIYQP4Tto77Ilss6zqezhYHFo09zzStHIuD13ipad3nxcm/ X-Received: by 2002:a6b:4f08:: with SMTP id d8mr1722077iob.199.1625550228132; Mon, 05 Jul 2021 22:43:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625550228; cv=none; d=google.com; s=arc-20160816; b=ihPJA9bLMYtI5/1MZpKpvJ8O1duoPHhQD+HrbVVzABr57XsO32mshDtkFweTbfFEg8 IVhKozvviQ0OUHTruDxuoKBnmG9Ck5JFsuCSXNFifaLHEjU7ydfDker3rJ2oPyAuYjnT DFJs/lt2hRKKRh+CrbEeGGp6CYkcEF+YQKByvCgLV2ujiY+2p9C+gD3fv3xvWjm/yheu dvalO2WlT4RhYZXUuu5KYxsHciWQskr6kkj2z0UOZ6/MiddfbgMIPlhp6GJXSoTXazc0 G7vJ8VjMM7k1u+McELUfKQyYmjZKnYJiv/dg9ATaX2CP1Tlb4+8/ikwkMYFzKs2JNA83 suVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=kR/4RD2c6G7vfOI3cAArYTywlbZ39ro+LD6XzRbKsSs=; b=eK9Hi0VHeR+0B7zHg3ktr07wGR4wJqvyUFtS+QDj5I7mdDBV3l4TPPXGrw9YzC85fl ilvpNlo+uwNwtlFcutd6nyim9crw+0nEGdcehm4ZbXc4HUDoDg1v+TMxEDq/utG27MPz X5nkXzHwZaF5A6L/265Qp1HPNhyc+5DJ/PugN94MlmNkY2A8/3sP76C/lqEf5hUJFtpo ZfZRrvDa05ZmbEDQ8UnCKu8/JGTad6HiG8cHl07TlBbRRzkxHAXhIVUDnn+VnR4sjQoL 5CMt0ztg80VdozW8ARRhPa1eQ8sojIpzGrJig+94FQeQv+QLgKvHY1Sxz2ct2m3UIDJ0 rEew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TDR6ZtCB; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f10si11407680jar.27.2021.07.05.22.43.36; Mon, 05 Jul 2021 22:43: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=@redhat.com header.s=mimecast20190719 header.b=TDR6ZtCB; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230077AbhGFFpb (ORCPT + 99 others); Tue, 6 Jul 2021 01:45:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37352 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230058AbhGFFp3 (ORCPT ); Tue, 6 Jul 2021 01:45:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625550171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kR/4RD2c6G7vfOI3cAArYTywlbZ39ro+LD6XzRbKsSs=; b=TDR6ZtCBD9NitmTh6bdTybfy4XDJht6ItyVVW+kKBEuKor2wWgQa+aXyrAWjTSkRC6md/S fVh4zkCyIuGnCV5vR+8v+shg/21TJDfYNsdrxr0VTs3NbJq91nSPn6QmwCf4KesRnpJdJH ae+T/Z68g7bylHFhUb+i1CckFl0yx3s= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-407-Liit78xhPjmxEmvAHs-jRw-1; Tue, 06 Jul 2021 01:42:50 -0400 X-MC-Unique: Liit78xhPjmxEmvAHs-jRw-1 Received: by mail-wm1-f70.google.com with SMTP id f9-20020a7bcd090000b02901eca9a0d67cso250948wmj.0 for ; Mon, 05 Jul 2021 22:42:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kR/4RD2c6G7vfOI3cAArYTywlbZ39ro+LD6XzRbKsSs=; b=f4gb+/pEoh16aQW2F0N/OyC/lcml6dvUXRA4W2h3vwCphVE47wJX4pO6fMXaXKxU4Q MmED9sowVLx4gpiTTUxW9ulGG7vOj4W91npYV+6opYY0ur871bsxZkOwaEwntx1mggQJ NCgudQ0Oltu69SEilfLU1ZuWIy2hTb8uKJld/kCATTgWFR6gXSqRi7hGyVO9I+23/BeO dkL3r1yOY9DhKnQUZ2HZZBMj6Xs2RjqbN5nz6B90d2c2Cy5mkEYO89nEzY3ywm9v5+6p 7H2WQJIGEwvf01b6IVocQ8wAvZNIxQtVCyFatsx3c2dnsLCVzFshUEqTSBmgd6uqWu7C qciQ== X-Gm-Message-State: AOAM5311cNn5E6e3XOmG18cEbLoiQIzvD0k07eQ9rzOS+T3YVqVZ6UJm qvN6+RDu7v/A4oJaZ1xhYUYoWOCXTwmAVF6xC0wHW3vxzmxdc/+eQu+p/EoGnefJ5QiG79/xIIf WFtZq4ONXQlgiOZfsDCCSLNbxkXbW+M2Lt5+hloyKlr09Y8kID41sKuNGMrmZogoDeiMsm29C3H Gb X-Received: by 2002:adf:a74a:: with SMTP id e10mr19186478wrd.185.1625550168823; Mon, 05 Jul 2021 22:42:48 -0700 (PDT) X-Received: by 2002:adf:a74a:: with SMTP id e10mr19186458wrd.185.1625550168591; Mon, 05 Jul 2021 22:42:48 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id w8sm16481761wrt.83.2021.07.05.22.42.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Jul 2021 22:42:47 -0700 (PDT) Subject: Re: [PATCH] KVM: nVMX: Dynamically compute max VMCS index for vmcs12 To: "Hu, Robert" , Sean Christopherson Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20210618214658.2700765-1-seanjc@google.com> From: Paolo Bonzini Message-ID: Date: Tue, 6 Jul 2021 07:42:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/07/21 05:05, Hu, Robert wrote: >> As noted in the code comments, KVM allows VMREAD/VMWRITE to all defined >> fields, whether or not the field should actually exist for the vCPU model doesn't >> enter into the equation. That's technically wrong as there are a number of >> fields that the SDM explicitly states exist iff a certain feature is supported. To >> fix that we'd need to add a "feature flag" to vmcs_field_to_offset_table that is >> checked against the vCPU model, though updating the MSR would probably fall >> onto userspace's shoulders? > > [Hu, Robert] > Perhaps more easier and proper to do this in KVM side. > QEMU sets actual feature set down to KVM, and KVM updates IA32_VMX_VMCS_ENUM > MSR accordingly. We don't see a channel that QEMU constructs a VMCS and sets a whole > to KVM. Yes, it's possible to do that too. If that is included in Linux 5.14, we can remove it from QEMU. Paolo