From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 213F3C4743C for ; Mon, 21 Jun 2021 16:44:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0DAF86108E for ; Mon, 21 Jun 2021 16:44:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232060AbhFUQqb (ORCPT ); Mon, 21 Jun 2021 12:46:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29672 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232779AbhFUQlY (ORCPT ); Mon, 21 Jun 2021 12:41:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624293549; 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=sNrhWGaCEE6tlRQzMAC0qRSOkCc4lESqY0tViKqRaA4=; b=U8kgj9CngIlwHAjNzu0z8Yn+aTlDLVaL4XYepIRC2crWNXCbGUS3bebegNG5wiEtPTg1kJ vI1PuCHjGsJmSYbig28nm6fPl9qTjtMn8SOfN7ZQ4Ifg1NlBKsXfr7Acms9e9Qy5YXOR3H xvlm04SPMvGjoYK1cGBfOzATFl+UZOg= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-453-taKbhib6OI6B6lB8WI61KA-1; Mon, 21 Jun 2021 12:39:07 -0400 X-MC-Unique: taKbhib6OI6B6lB8WI61KA-1 Received: by mail-wr1-f69.google.com with SMTP id l13-20020adfe9cd0000b0290119a0645c8fso8638175wrn.8 for ; Mon, 21 Jun 2021 09:39:07 -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=sNrhWGaCEE6tlRQzMAC0qRSOkCc4lESqY0tViKqRaA4=; b=BrdyTXTkFQzsTA0pkaFjnTQ7Fdqd/Ku/5yBlmX91n/Go3JhXLj0jgZFEezU9/kzqCD /989tcDmlD5TJfNbXjC6S2x7cRyYpnfeoMdJLZDNDmOxIQ38Eqkj5vWt6ajQfc41Jx6F 5r3scZwg1NEP/KEkewB36C93lzU571Aeg9ikWu339vitBW1neLI8w7DeIOVOzr0/RGi4 FpmgorTuQY+HZVz1MOQtii6UMSZ1stZAulAfmQqc9NnEFQbCCyY55o/Qp2jYg3vyQcMR X7Gc1Y3uUUAukFoXUmS9V8FcRx1OFiguyKFEMAwC5I6y2rqetHZKRLPPmZ7pSr203KeO kxYA== X-Gm-Message-State: AOAM533pTv7lNistIuju78c2K9gQw4L7nRv+hIR9vPdV0cny1qo0cctv 7VvUX57mtRc5yZ5LyczTsz4TEFfR5xOshVFCjob7gm/2lLAlIPXfwlGCQ1qoEyMS9JzJMHQRN9T sYhMDvYz1xozKk00WtvN0NaT6eqDoRQ2HFxhICJXDAI+ZrL3Pgg2pqE9SHfKzsI5xH8g3gFCUV4 u3 X-Received: by 2002:adf:c3d4:: with SMTP id d20mr29479260wrg.183.1624293546396; Mon, 21 Jun 2021 09:39:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdEswH/yGTRhXZ1gO9tpcXCMyM68MKeybsENTeeaW0I+76u4JxxClPc6tiA9Gn01YIGQBV5Q== X-Received: by 2002:adf:c3d4:: with SMTP id d20mr29479237wrg.183.1624293546245; Mon, 21 Jun 2021 09:39:06 -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 y14sm11979790wrq.66.2021.06.21.09.39.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Jun 2021 09:39:05 -0700 (PDT) Subject: Re: [PATCH] KVM: nVMX: Dynamically compute max VMCS index for vmcs12 To: 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: Mon, 21 Jun 2021 18:39:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210618214658.2700765-1-seanjc@google.com> 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 18/06/21 23:46, 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 > --- > > Note, the vmx test in kvm-unit-tests will still fail using stock QEMU, > as QEMU also hardcodes and overwrites the MSR. The test passes if I > hack KVM to ignore userspace (it was easier than rebuilding QEMU). Queued, thanks. Without having checked the kvm-unit-tests sources very thoroughly, this might be a configuration issue in kvm-unit-tests; in theory "-cpu host" (unlike "-cpu host,migratable=no") should not enable TSC scaling. Paolo