Re: [PATCH v3 kvm/queue 14/16] KVM: Handle page fault for private memory

2022-01-13 Thread Yan Zhao
hi Sean, Sorry for the late reply. I just saw this mail in my mailbox. On Wed, Jan 05, 2022 at 08:52:39PM +, Sean Christopherson wrote: > On Wed, Jan 05, 2022, Yan Zhao wrote: > > Sorry, maybe I didn't express it clearly. > > > > As in the kvm_faultin_pfn_private(), > > static bool kvm_fault

Re: [PATCH v3 kvm/queue 14/16] KVM: Handle page fault for private memory

2022-01-05 Thread Sean Christopherson
On Wed, Jan 05, 2022, Yan Zhao wrote: > Sorry, maybe I didn't express it clearly. > > As in the kvm_faultin_pfn_private(), > static bool kvm_faultin_pfn_private(struct kvm_vcpu *vcpu, > struct kvm_page_fault *fault, > bool *is_pr

Re: [PATCH v3 kvm/queue 14/16] KVM: Handle page fault for private memory

2022-01-05 Thread Yan Zhao
On Wed, Jan 05, 2022 at 02:28:10PM +0800, Chao Peng wrote: > On Tue, Jan 04, 2022 at 06:06:12PM +0800, Yan Zhao wrote: > > On Tue, Jan 04, 2022 at 05:10:08PM +0800, Chao Peng wrote: <...> > > Thanks. So QEMU will re-generate memslots and set KVM_MEM_PRIVATE > > accordingly? Will it involve slot de

Re: [PATCH v3 kvm/queue 14/16] KVM: Handle page fault for private memory

2022-01-04 Thread Chao Peng
On Tue, Jan 04, 2022 at 06:06:12PM +0800, Yan Zhao wrote: > On Tue, Jan 04, 2022 at 05:10:08PM +0800, Chao Peng wrote: > > On Tue, Jan 04, 2022 at 09:46:35AM +0800, Yan Zhao wrote: > > > On Thu, Dec 23, 2021 at 08:30:09PM +0800, Chao Peng wrote: > > > > When a page fault from the secondary page tab

Re: [PATCH v3 kvm/queue 14/16] KVM: Handle page fault for private memory

2022-01-04 Thread Yan Zhao
On Tue, Jan 04, 2022 at 05:10:08PM +0800, Chao Peng wrote: > On Tue, Jan 04, 2022 at 09:46:35AM +0800, Yan Zhao wrote: > > On Thu, Dec 23, 2021 at 08:30:09PM +0800, Chao Peng wrote: > > > When a page fault from the secondary page table while the guest is > > > running happens in a memslot with KVM_

Re: [PATCH v3 kvm/queue 14/16] KVM: Handle page fault for private memory

2022-01-04 Thread Chao Peng
On Tue, Jan 04, 2022 at 09:46:35AM +0800, Yan Zhao wrote: > On Thu, Dec 23, 2021 at 08:30:09PM +0800, Chao Peng wrote: > > When a page fault from the secondary page table while the guest is > > running happens in a memslot with KVM_MEM_PRIVATE, we need go > > different paths for private access and

Re: [PATCH v3 kvm/queue 14/16] KVM: Handle page fault for private memory

2022-01-03 Thread Yan Zhao
On Thu, Dec 23, 2021 at 08:30:09PM +0800, Chao Peng wrote: > When a page fault from the secondary page table while the guest is > running happens in a memslot with KVM_MEM_PRIVATE, we need go > different paths for private access and shared access. > > - For private access, KVM checks if the page

[PATCH v3 kvm/queue 14/16] KVM: Handle page fault for private memory

2021-12-23 Thread Chao Peng
When a page fault from the secondary page table while the guest is running happens in a memslot with KVM_MEM_PRIVATE, we need go different paths for private access and shared access. - For private access, KVM checks if the page is already allocated in the memory backend, if yes KVM establish