From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: Re: [Qemu-ppc] [PATCH] kvm: Fix memory slot page alignment logic Date: Fri, 07 Nov 2014 22:24:07 +0100 Message-ID: <545D3877.1070900@suse.de> References: <1415395125-18926-1-git-send-email-agraf@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: pbonzini@redhat.com, qemu-stable@nongnu.org, stuart.yoder@freescale.com, kvm@vger.kernel.org, qemu-devel@nongnu.org To: qemu-ppc@nongnu.org Return-path: Received: from cantor2.suse.de ([195.135.220.15]:57306 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752612AbaKGVYJ (ORCPT ); Fri, 7 Nov 2014 16:24:09 -0500 In-Reply-To: <1415395125-18926-1-git-send-email-agraf@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: 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