lkml.org 
[lkml]   [2020]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 03/14] KVM: X86: Don't track dirty for KVM_SET_[TSS_ADDR|IDENTITY_MAP_ADDR]
On Wed, Mar 11, 2020 at 12:01:19PM -0400, Peter Xu wrote:
> On Tue, Mar 10, 2020 at 08:06:37AM -0700, Sean Christopherson wrote:
> > On Mon, Mar 09, 2020 at 05:44:13PM -0400, Peter Xu wrote:
> > > - idx = srcu_read_lock(&kvm->srcu);
> > > - fn = to_kvm_vmx(kvm)->tss_addr >> PAGE_SHIFT;
> > > - r = kvm_clear_guest_page(kvm, fn, 0, PAGE_SIZE);
> > > - if (r < 0)
> > > - goto out;
> > > + for (idx = 0; idx < 3; idx++) {
> > > + r = __copy_to_user(ua + PAGE_SIZE * idx, zero_page, PAGE_SIZE);
> > > + if (r)
> > > + return -EFAULT;
> > > + }
> >
> > Can this be done in a single __copy_to_user(), or do those helpers not like
> > crossing page boundaries?
>
> Maybe because the zero_page is only PAGE_SIZE long? :)

Ha, yeah, that'd be a good reason to loop.

> [...]

\
 
 \ /
  Last update: 2020-03-11 17:12    [W:0.062 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site