From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932310AbbJMPD6 (ORCPT ); Tue, 13 Oct 2015 11:03:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35313 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753010AbbJMPD5 (ORCPT ); Tue, 13 Oct 2015 11:03:57 -0400 Date: Tue, 13 Oct 2015 17:03:52 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, aderumier@odiso.com, stable@vger.kernel.org Subject: Re: [PATCH 1/2] KVM: x86: build kvm_userspace_memory_region in x86_set_memory_region 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1444651758-6926-2-git-send-email-pbonzini@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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. > > 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/kvm_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 size); 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čmář