From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH 1/1] KVM: VMX: Clean up private memory slot allocation Date: Fri, 14 Nov 2008 10:27:25 +0800 Message-ID: <200811141027.25895.sheng@linux.intel.com> References: <1226388688-32247-1-git-send-email-sheng@linux.intel.com> <491C1D21.5090501@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mga07.intel.com ([143.182.124.22]:7849 "EHLO azsmga101.ch.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750984AbYKNCat (ORCPT ); Thu, 13 Nov 2008 21:30:49 -0500 In-Reply-To: <491C1D21.5090501@redhat.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Thursday 13 November 2008 20:27:13 Avi Kivity wrote: > Sheng Yang wrote: > > userspace_addr should be a meaningless value. > > Perhaps in __kvm_set_memory_region(), if !user_alloc? > > Why is it needed? Did you observe any problem? A potential issue is kvm_userspace_mem.userspace_addr don't have value, so for the recent case, it won't show stably everytime... So I think it's a potential issue, to prevent further confusing on this (if necessary). -- regards Yang, Sheng > > > @@ -2022,6 +2022,8 @@ static int alloc_apic_access_page(struct kvm *kvm) > > kvm_userspace_mem.flags = 0; > > kvm_userspace_mem.guest_phys_addr = 0xfee00000ULL; > > kvm_userspace_mem.memory_size = PAGE_SIZE; > > + /* userspace_addr is invalid, make it unaligned */ > > + kvm_userspace_mem.userspace_addr = PAGE_SIZE - 1; > > r = __kvm_set_memory_region(kvm, &kvm_userspace_mem, 0); > > if (r) > > goto out; > > @@ -2044,6 +2046,8 @@ static int alloc_identity_pagetable(struct kvm > > *kvm) kvm_userspace_mem.flags = 0; > > kvm_userspace_mem.guest_phys_addr = VMX_EPT_IDENTITY_PAGETABLE_ADDR; > > kvm_userspace_mem.memory_size = PAGE_SIZE; > > + /* userspace_addr is invalid, make it unaligned */ > > + kvm_userspace_mem.userspace_addr = PAGE_SIZE - 1; > > r = __kvm_set_memory_region(kvm, &kvm_userspace_mem, 0); > > if (r) > > goto out;