xend, vt-d: do not reserve vtd_mem if iommu is not enabled

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
This commit is contained in:
Keir Fraser committed 2009-12-02 13:43:37 +00:00
1 parent a0289c3119
commit fe356defec
1 file changed
+7 -4
+7 -4
View File
@@ -2758,10 +2758,13 @@ class XendDomainInfo:
# set memory limit
xc.domain_setmaxmem(self.domid, maxmem)
# Reserve 1 page per MiB of RAM for separate VT-d page table.
vtd_mem = 4 * (self.info['memory_static_max'] / 1024 / 1024)
# Round vtd_mem up to a multiple of a MiB.
vtd_mem = ((vtd_mem + 1023) / 1024) * 1024
vtd_mem = 0
info = xc.physinfo()
if 'hvm_directio' in info['virt_caps']:
# Reserve 1 page per MiB of RAM for separate VT-d page table.
vtd_mem = 4 * (self.info['memory_static_max'] / 1024 / 1024)
# Round vtd_mem up to a multiple of a MiB.
vtd_mem = ((vtd_mem + 1023) / 1024) * 1024
self.guest_bitsize = self.image.getBitSize()
# Make sure there's enough RAM available for the domain
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.