[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240307025252.GH368614@ls.amr.corp.intel.com>
Date: Wed, 6 Mar 2024 18:52:52 -0800
From: Isaku Yamahata <isaku.yamahata@...ux.intel.com>
To: David Matlack <dmatlack@...gle.com>
Cc: isaku.yamahata@...el.com, kvm@...r.kernel.org, isaku.yamahata@...il.com,
linux-kernel@...r.kernel.org,
Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Michael Roth <michael.roth@....com>,
Federico Parola <federico.parola@...ito.it>,
isaku.yamahata@...ux.intel.com
Subject: Re: [RFC PATCH 2/8] KVM: Add KVM_MAP_MEMORY vcpu ioctl to
pre-populate guest memory
On Wed, Mar 06, 2024 at 04:49:19PM -0800,
David Matlack <dmatlack@...gle.com> wrote:
> > + cond_resched();
> > +
> > + r = kvm_arch_vcpu_map_memory(vcpu, mapping);
> > + if (r)
> > + break;
> > +
> > + added = true;
> > + }
> > +
> > + srcu_read_unlock(&vcpu->kvm->srcu, idx);
> > + vcpu_put(vcpu);
> > +
> > + if (added && mapping->nr_pages > 0)
> > + r = -EAGAIN;
>
> This can overwrite the return value from kvm_arch_vcpu_map_memory().
This is to convert ERESTART into EAGAIN. I'll drop this check
and document EINTR so that caller should be aware of partial population.
--
Isaku Yamahata <isaku.yamahata@...ux.intel.com>
Powered by blists - more mailing lists