Re: [RFCv2 13/13] KVM: unmap guest memory using poisoned pages

2021-04-20 Thread Sean Christopherson
On Tue, Apr 20, 2021, Kirill A. Shutemov wrote: > On Mon, Apr 19, 2021 at 08:09:13PM +, Sean Christopherson wrote: > > On Mon, Apr 19, 2021, Kirill A. Shutemov wrote: > > > The critical question is whether we ever need to translate hva->pfn after > > > the page is added to the guest private mem

Re: [RFCv2 13/13] KVM: unmap guest memory using poisoned pages

2021-04-19 Thread Kirill A. Shutemov
On Mon, Apr 19, 2021 at 08:09:13PM +, Sean Christopherson wrote: > On Mon, Apr 19, 2021, Kirill A. Shutemov wrote: > > On Mon, Apr 19, 2021 at 06:09:29PM +, Sean Christopherson wrote: > > > On Mon, Apr 19, 2021, Kirill A. Shutemov wrote: > > > > On Mon, Apr 19, 2021 at 04:01:46PM +, Sea

Re: [RFCv2 13/13] KVM: unmap guest memory using poisoned pages

2021-04-19 Thread Sean Christopherson
On Mon, Apr 19, 2021, Kirill A. Shutemov wrote: > On Mon, Apr 19, 2021 at 06:09:29PM +, Sean Christopherson wrote: > > On Mon, Apr 19, 2021, Kirill A. Shutemov wrote: > > > On Mon, Apr 19, 2021 at 04:01:46PM +, Sean Christopherson wrote: > > > > But fundamentally the private pages, are well

Re: [RFCv2 13/13] KVM: unmap guest memory using poisoned pages

2021-04-19 Thread Kirill A. Shutemov
On Mon, Apr 19, 2021 at 06:09:29PM +, Sean Christopherson wrote: > On Mon, Apr 19, 2021, Kirill A. Shutemov wrote: > > On Mon, Apr 19, 2021 at 04:01:46PM +, Sean Christopherson wrote: > > > But fundamentally the private pages, are well, private. They can't be > > > shared > > > across pro

Re: [RFCv2 13/13] KVM: unmap guest memory using poisoned pages

2021-04-19 Thread David Hildenbrand
On 19.04.21 20:09, Sean Christopherson wrote: On Mon, Apr 19, 2021, Kirill A. Shutemov wrote: On Mon, Apr 19, 2021 at 04:01:46PM +, Sean Christopherson wrote: But fundamentally the private pages, are well, private. They can't be shared across processes, so I think we could (should?) requir

Re: [RFCv2 13/13] KVM: unmap guest memory using poisoned pages

2021-04-19 Thread Sean Christopherson
On Mon, Apr 19, 2021, Kirill A. Shutemov wrote: > On Mon, Apr 19, 2021 at 04:01:46PM +, Sean Christopherson wrote: > > But fundamentally the private pages, are well, private. They can't be > > shared > > across processes, so I think we could (should?) require the VMA to always be > > MAP_PRIV

Re: [RFCv2 13/13] KVM: unmap guest memory using poisoned pages

2021-04-19 Thread Kirill A. Shutemov
On Mon, Apr 19, 2021 at 04:01:46PM +, Sean Christopherson wrote: > On Mon, Apr 19, 2021, Kirill A. Shutemov wrote: > > On Fri, Apr 16, 2021 at 05:30:30PM +, Sean Christopherson wrote: > > > I like the idea of using "special" PTE value to denote guest private > > > memory, > > > e.g. in thi

Re: [RFCv2 13/13] KVM: unmap guest memory using poisoned pages

2021-04-19 Thread Sean Christopherson
On Mon, Apr 19, 2021, Kirill A. Shutemov wrote: > On Fri, Apr 16, 2021 at 05:30:30PM +, Sean Christopherson wrote: > > I like the idea of using "special" PTE value to denote guest private memory, > > e.g. in this RFC, HWPOISON. But I strongly dislike having KVM involved in > > the > > manipul

Re: [RFCv2 13/13] KVM: unmap guest memory using poisoned pages

2021-04-19 Thread Kirill A. Shutemov
On Fri, Apr 16, 2021 at 05:30:30PM +, Sean Christopherson wrote: > On Fri, Apr 16, 2021, Kirill A. Shutemov wrote: > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > > index 1b404e4d7dd8..f8183386abe7 100644 > > --- a/arch/x86/kvm/x86.c > > +++ b/arch/x86/kvm/x86.c > > @@ -8170,6 +8170,

Re: [RFCv2 13/13] KVM: unmap guest memory using poisoned pages

2021-04-19 Thread Xiaoyao Li
On 4/17/2021 1:30 AM, Sean Christopherson wrote: On Fri, Apr 16, 2021, Kirill A. Shutemov wrote: [...] index fadaccb95a4c..cd2374802702 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -436,6 +436,8 @@ static inline int kvm_arch_vcpu_memslots_id(struct kvm_vcpu *vcpu)

Re: [RFCv2 13/13] KVM: unmap guest memory using poisoned pages

2021-04-16 Thread Sean Christopherson
On Fri, Apr 16, 2021, Kirill A. Shutemov wrote: > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 1b404e4d7dd8..f8183386abe7 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -8170,6 +8170,12 @@ int kvm_emulate_hypercall(struct kvm_vcpu *vcpu) > kvm_sched_