From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xmr0w-0006He-Tj for qemu-devel@nongnu.org; Fri, 07 Nov 2014 16:24:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xmr0r-0008NM-F8 for qemu-devel@nongnu.org; Fri, 07 Nov 2014 16:24:14 -0500 Message-ID: <545D3877.1070900@suse.de> Date: Fri, 07 Nov 2014 22:24:07 +0100 From: Alexander Graf MIME-Version: 1.0 References: <1415395125-18926-1-git-send-email-agraf@suse.de> In-Reply-To: <1415395125-18926-1-git-send-email-agraf@suse.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] kvm: Fix memory slot page alignment logic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-ppc@nongnu.org Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, qemu-stable@nongnu.org, kvm@vger.kernel.org, stuart.yoder@freescale.com On 07.11.14 22:18, Alexander Graf wrote: > Memory slots have to be page aligned to get entered into KVM. There > is existing logic that tries to ensure that we pad memory slots that > are not page aligned to the biggest region that would still fit in the > alignment requirements. > > Unfortunately, that logic is broken. It tries to calculate the start > offset based on the region size. > > Fix up the logic to do the thing it was intended to do and document it > properly in the comment above it. > > With this patch applied, I can successfully run an e500 guest with more > than 3GB RAM (at which point RAM starts overlapping subpage memory regions). > > Cc: qemu-stable@nongnu.org > Signed-off-by: Alexander Graf If everyone agrees that this patch does indeed do what the code is intended to do (I think it's quite correct, to be 100% right it should use getpagesize() rather than TARGET_PAGE_SIZE), this should go into 2.2 still. Alex