[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5cb1e32e-c880-fa48-aa25-7660d8ad0cdd@redhat.com>
Date: Tue, 8 Mar 2022 09:13:33 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Sean Christopherson <seanjc@...gle.com>,
Hao Peng <flyingpenghao@...il.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kvm: x86: Improve virtual machine startup performance
On 3/8/22 03:03, Sean Christopherson wrote:
> On Thu, Mar 03, 2022, Hao Peng wrote:
>> On Thu, Mar 3, 2022 at 9:29 AM Sean Christopherson <seanjc@...gle.com> wrote:
>>>
>>> On Wed, Mar 02, 2022, Hao Peng wrote:
>>>> Thanks for pointing this out. However, other than shadow_root_level,
>>>> other fields of context will not
>>>> change during the entire operation, such as
>>>> page_fault/sync_page/direct_map and so on under
>>>> the condition of tdp_mmu.
>>>> Is this patch still viable after careful confirmation of the fields
>>>> that won't be modified?
>>>
>>> No, passing around the "init" flag is a hack.
>>>
>>> But, we can achieve what you want simply by initializing the constant data once
>>> per vCPU. There's a _lot_ of state that is constant for a given MMU now that KVM
>>> uses separate MMUs for L1 vs. L2 when TDP is enabled. I should get patches posted
>>> tomorrow, just need to test (famous last words).
>
> Famous last words indeed. Long story short, the patches were mostly easy, but I
> wandered deep into a rabbit hole when trying to make ->inject_page_fault() constant
> per MMU. I'll get something posted this week, though exactly what that something is
> remains to be seen :-)
This is exactly what I have posted a few weeks ago:
https://patchew.org/linux/20220221162243.683208-1-pbonzini@redhat.com/
See in particular
KVM: nVMX/nSVM: do not monkey-patch inject_page_fault callback
KVM: x86/mmu: initialize constant-value fields just once
Paolo
Powered by blists - more mailing lists