From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH 1/2] KVM: x86: build kvm_userspace_memory_region in x86_set_memory_region Date: Tue, 13 Oct 2015 17:03:52 +0200 Message-ID: <20151013150352.GA6877@potion.brq.redhat.com> References: <1444651758-6926-1-git-send-email-pbonzini@redhat.com> <1444651758-6926-2-git-send-email-pbonzini@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, aderumier@odiso.com, stable@vger.kernel.org To: Paolo Bonzini Return-path: Content-Disposition: inline In-Reply-To: <1444651758-6926-2-git-send-email-pbonzini@redhat.com> Sender: stable-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2015-10-12 14:09+0200, Paolo Bonzini: > The next patch will make x86_set_memory_region fill the > userspace_addr. Since the struct is not used untouched > anymore, it makes sense to build it in x86_set_memory_region > directly; it also simplifies the callers. >=20 > Reported-by: Alexandre DERUMIER > Cc: stable@vger.kernel.org > Fixes: 9da0e4d5ac969909f6b435ce28ea28135a9cbd69 > Signed-off-by: Paolo Bonzini > --- > diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/k= vm_host.h > @@ -1199,9 +1199,7 @@ void kvm_complete_insn_gp(struct kvm_vcpu *vcpu= , int err); > -int __x86_set_memory_region(struct kvm *kvm, > - const struct kvm_userspace_memory_region *mem); > -int x86_set_memory_region(struct kvm *kvm, > - const struct kvm_userspace_memory_region *mem); > +int __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 = size); > +int x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 si= ze); kvm_userspace_memory_region has u64 size, but we only use this for few pages anyway and will hopefully get a warning from GCC if that changes. Patch makes the code much better, Reviewed-by: Radim Kr=C4=8Dm=C3=A1=C5=99