kvm: bios: make MMIO address page aligned in guest
commitfb48c7c858cc612e3e1cb011c534075ac5de553d
authorWeidong Han <weidong.han@intel.com>
Thu, 19 Feb 2009 09:24:20 +0000 (19 17:24 +0800)
committerAvi Kivity <avi@redhat.com>
Tue, 24 Feb 2009 10:43:15 +0000 (24 12:43 +0200)
treee117efc0cbf2ef2fba7d7304a4850803b705b571
parentac9131b23a3033043a0aa8ca55506654adcb9545
kvm: bios: make MMIO address page aligned in guest

MMIO of some devices are not page aligned, such as some EHCI
controllers and virtual Realtek NIC in guest. Current guest
bios doesn't guarantee the start address of MMIO page aligned.
This may result in failure of device assignment, because KVM
only allow to register page aligned memory slots. For example,
it fails to assign EHCI controller (its MMIO size is 1KB) with
virtual Realtek NIC (its MMIO size is 256Bytes), because MMIO
of virtual Realtek NIC in guest starts from 0xf2001000, MMIO of
the EHCI controller will starts from 0xf2001400.

MMIO addresses in guest are allocated in guest bios. This patch
makes MMIO address page aligned in bios, then fixes the issue.

Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
bios/rombios32.c