From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] align vga rom to 4k boundary. Date: Sat, 11 Apr 2009 14:14:37 +0300 Message-ID: <49E07B9D.6060706@redhat.com> References: <1239071051-14847-1-git-send-email-glommer@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, aliguori@us.ibm.com To: Glauber Costa Return-path: Received: from mx2.redhat.com ([66.187.237.31]:37451 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752899AbZDKLOq (ORCPT ); Sat, 11 Apr 2009 07:14:46 -0400 In-Reply-To: <1239071051-14847-1-git-send-email-glommer@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Glauber Costa wrote: > Instead of aligning to 2k boundary, as required by the bios, > align to 4k boundary, as required by kvm memory functions. Without > this patch, starting kvm with -vga std option fails with: > > create_userspace_phys_mem: Invalid argument > kvm_cpu_register_physical_memory: failed > > as described by: https://bugzilla.redhat.com/show_bug.cgi?id=494376 > > It does not fail with cirrus vga, because it is naturally aligned. > This problem does not seem to affect upstream qemu. > > exit(1); > } > /* Round up vga bios size to the next 2k boundary */ > - vga_bios_size = (vga_bios_size + 2047) & ~2047; > + vga_bios_size = (vga_bios_size + 4095) & ~4095; > option_rom_start = 0xc0000 + vga_bios_size; > > /* setup basic memory access */ > Comment needs updating. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.