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=-9.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 1EAFBC433EF for ; Fri, 17 Sep 2021 17:37:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F017560F21 for ; Fri, 17 Sep 2021 17:37:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240482AbhIQRix (ORCPT ); Fri, 17 Sep 2021 13:38:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58188 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237238AbhIQRiv (ORCPT ); Fri, 17 Sep 2021 13:38:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631900249; 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=TQ69tgYk0yh6UZaHgteT2LE/TfdaRnldb8roVNiJD38=; b=iiyeAz9QaH+6lxRvjURkqzMp+5SJz8MSIDhUVSt4+bj3U9P3exX4kDYn4QL0HrqG+jsIrQ ve9QcdgtmIahEHzzrUPWbNXSbdAVt8faFZCj6pLzWWZgUWCEjjkBUuwVzvmtt7tZRvM522 Z/7cpWb+9fUP8qXtNxuuc5DA93EpaSM= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-130-fmyQeStBPa-D0aHZfepvJg-1; Fri, 17 Sep 2021 13:37:25 -0400 X-MC-Unique: fmyQeStBPa-D0aHZfepvJg-1 Received: by mail-ed1-f70.google.com with SMTP id r7-20020aa7c147000000b003d1f18329dcso9795522edp.13 for ; Fri, 17 Sep 2021 10:37:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=TQ69tgYk0yh6UZaHgteT2LE/TfdaRnldb8roVNiJD38=; b=H4idvV+kWMy0DgYQhRdlTN9XY2xgMSpVCGbl/9d0H1lEnX0FuljttdGhVwTL/Qrclm WtM12+rsTSW6NrZD8U5yf+YCv5oAD5ufScOGoe+lCR4AGAXfxXyuVsCUvLyULRmqi181 YLoDFJr49tTFl+kBPHHLlTZbGc0Q0CMBu8y9zVY6jbHOZcktKnfZFcuXKvjavG+kn/rG QX0pmb1Kf5A9d/H8yHxH+VWp+n4V0IwDcP5Ssp9VZ232s5cvssfsLNoqDnqvcbCa65G/ TxGNiddM4L8g/eDryIRzLbrikqv9/qI9NOcN4KwniMqfZbXSs4TtsTA4G9qWjQxuiQgM xnHw== X-Gm-Message-State: AOAM530CyGLR2m6HFWdZ78+2pOvgtf1aofmT7lljVqQiL4Z9nDORBdl2 2nQpxF07yEqIVc5fOq6IUpk6TrVqVNRAZwnbGiFExQfkdVHuzv4hp68FboPy0c6Oz4en3kh6twW zDyVr02/pwX0MJo1VvMFK2gVH X-Received: by 2002:aa7:d582:: with SMTP id r2mr13896173edq.324.1631900244583; Fri, 17 Sep 2021 10:37:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLtBte+3SaIrVpcwkvtQdqnblyNWMQHx8gbT1bNYByKRPARqRI8cZxbuL5acvrGWIvc77JMg== X-Received: by 2002:aa7:d582:: with SMTP id r2mr13896157edq.324.1631900244407; Fri, 17 Sep 2021 10:37:24 -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 k20sm2532336ejd.33.2021.09.17.10.37.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Sep 2021 10:37:22 -0700 (PDT) Subject: Re: [PATCH 0/3] KVM: x86: Clean up RESET "emulation" To: Sean Christopherson Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm , "Kernel Mailing List, Linux" , Reiji Watanabe References: <20210914230840.3030620-1-seanjc@google.com> From: Paolo Bonzini Message-ID: Date: Fri, 17 Sep 2021 19:37:21 +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 17/09/21 19:34, Sean Christopherson wrote: >> but I do like it so yes, that was it. Especially the fact that init_vmcb now >> has a single caller. I would further consider moving save area initialization >> to *_vcpu_reset, and keeping the control fields in init_vmcb/vmcs. That would >> make it easier to relate the two functions to separate parts of the manuals. > > I like the idea, but I think I'd prefer to tackle that at the same time as generic > support for handling MSRs at RESET/INIT. No problem, just roughly sketching some ideas for the future. But you're absolutely right that some MSRs have effects on the control areas rather than the save area (and some have effects on neither). Thanks, Paolo > E.g. instead of manually writing > vmcs.GUEST_SYSENTER_* at RESET, provide infrastruture to automagically run through > all emulated/virtualized at RESET and/or INIT as appropriate to initialize the > guest value. >