From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7ust-0000qk-M6 for qemu-devel@nongnu.org; Wed, 14 Mar 2012 16:33:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7usr-0006kc-PS for qemu-devel@nongnu.org; Wed, 14 Mar 2012 16:33:23 -0400 Received: from mail-pz0-f47.google.com ([209.85.210.47]:47017) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7usr-0006kW-Jh for qemu-devel@nongnu.org; Wed, 14 Mar 2012 16:33:21 -0400 Received: by dado14 with SMTP id o14so3676477dad.34 for ; Wed, 14 Mar 2012 13:33:19 -0700 (PDT) Message-ID: <4F61008B.4070007@codemonkey.ws> Date: Wed, 14 Mar 2012 15:33:15 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1331049010-24312-1-git-send-email-avi@redhat.com> In-Reply-To: <1331049010-24312-1-git-send-email-avi@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] kvmvapic: align start address as well as size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Jan Kiszka , qemu-devel@nongnu.org On 03/06/2012 09:50 AM, Avi Kivity wrote: > The kvmvapic code remaps a section of ROM as RAM to allow the guest to > maintain state there. It is careful to align the section size to a page > boundary, to avoid creating subpages, but neglects to do the same for > the start address. These leads to an assert later on when the memory > core tries to create a page which is half RAM and half ROM. > > Fix by aligning the start address to a page boundary. > > This can be triggered by running qemu-system-x86_64 -enable-kvm -vga none. > > Signed-off-by: Avi Kivity Tested-by: Anthony Liguori Are you going to do a PULL request or do you want me to apply directly? Regards, Anthony Liguori > --- > hw/kvmvapic.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/hw/kvmvapic.c b/hw/kvmvapic.c > index 36ccfbc..e8bfeec 100644 > --- a/hw/kvmvapic.c > +++ b/hw/kvmvapic.c > @@ -578,8 +578,10 @@ static void vapic_map_rom_writable(VAPICROMState *s) > rom_size = ram[rom_paddr + 2] * ROM_BLOCK_SIZE; > s->rom_size = rom_size; > > - /* We need to round up to avoid creating subpages > + /* We need to round to avoid creating subpages > * from which we cannot run code. */ > + rom_size += rom_paddr& ~TARGET_PAGE_MASK; > + rom_paddr&= TARGET_PAGE_MASK; > rom_size = TARGET_PAGE_ALIGN(rom_size); > > memory_region_init_alias(&s->rom, "kvmvapic-rom", section.mr, rom_paddr,