From fe356defec5b50c1faab672bf488d68c9c996917 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 2 Dec 2009 13:43:37 +0000 Subject: [PATCH] xend, vt-d: do not reserve vtd_mem if iommu is not enabled Signed-off-by: Dexuan Cui --- tools/python/xen/xend/XendDomainInfo.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 7cbf25ecc0..db744d7e1d 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -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 -- 2.30.2