[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191202204943.GC31681@xz-x1>
Date: Mon, 2 Dec 2019 15:49:43 -0500
From: Peter Xu <peterx@...hat.com>
To: Sean Christopherson <sean.j.christopherson@...el.com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>,
"Dr . David Alan Gilbert" <dgilbert@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>
Subject: Re: [PATCH RFC 02/15] KVM: Add kvm/vcpu argument to
mark_dirty_page_in_slot
On Mon, Dec 02, 2019 at 11:32:22AM -0800, Sean Christopherson wrote:
> On Fri, Nov 29, 2019 at 04:34:52PM -0500, Peter Xu wrote:
>
> Why?
[1]
>
> > From: "Cao, Lei" <Lei.Cao@...atus.com>
> >
> > Signed-off-by: Cao, Lei <Lei.Cao@...atus.com>
> > Signed-off-by: Paolo Bonzini <pbonzini@...hat.com>
> > Signed-off-by: Peter Xu <peterx@...hat.com>
> > ---
> > virt/kvm/kvm_main.c | 26 +++++++++++++++++---------
> > 1 file changed, 17 insertions(+), 9 deletions(-)
> >
> > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> > index fac0760c870e..8f8940cc4b84 100644
> > --- a/virt/kvm/kvm_main.c
> > +++ b/virt/kvm/kvm_main.c
> > @@ -145,7 +145,10 @@ static void hardware_disable_all(void);
> >
> > static void kvm_io_bus_destroy(struct kvm_io_bus *bus);
> >
> > -static void mark_page_dirty_in_slot(struct kvm_memory_slot *memslot, gfn_t gfn);
> > +static void mark_page_dirty_in_slot(struct kvm *kvm,
> > + struct kvm_vcpu *vcpu,
> > + struct kvm_memory_slot *memslot,
> > + gfn_t gfn);
>
> Why both? Passing @vcpu gets you @kvm.
You are right on that I should fill in something at [1]..
Because @vcpu can be NULL (if you continue to read this patch, you'll
see sometimes NULL is passed in), and we at least need a context to
mark the dirty ring. That's also why we need a per-vm dirty ring to
be the fallback of the cases where we don't have vcpu context.
Thanks,
--
Peter Xu
Powered by blists - more mailing lists