From: Wei Liu Subject: Re: [PATCH 14/19] hvmloader: disallow memory relocation when vNUMA is enabled Date: Mon, 24 Nov 2014 09:21:50 +0000 Message-ID: <20141124092150.GB30053@zion.uk.xensource.com> References: <1416582421-10789-1-git-send-email-wei.liu2@citrix.com> <1416582421-10789-15-git-send-email-wei.liu2@citrix.com> <20141121195631.GA16313@laptop.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20141121195631.GA16313@laptop.dumpdata.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk Cc: George Dunlap , Wei Liu , Jan Beulich , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, Nov 21, 2014 at 02:56:31PM -0500, Konrad Rzeszutek Wilk wrote: > On Fri, Nov 21, 2014 at 03:06:56PM +0000, Wei Liu wrote: > > Signed-off-by: Wei Liu > > Cc: Jan Beulich > > Cc: George Dunlap > > --- > > tools/firmware/hvmloader/pci.c | 13 +++++++++++++ > > 1 file changed, 13 insertions(+) > > > > diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c > > index 4e8d803..d7ea740 100644 > > --- a/tools/firmware/hvmloader/pci.c > > +++ b/tools/firmware/hvmloader/pci.c > > @@ -88,6 +88,19 @@ void pci_setup(void) > > printf("Relocating guest memory for lowmem MMIO space %s\n", > > allow_memory_relocate?"enabled":"disabled"); > > > > + /* Disallow low memory relocation when vNUMA is enabled, because > > + * relocated memory ends up off node. Further more, even if we > > + * dynamically expand node coverage in hvmloader, low memory and > > + * high memory may reside in different physical nodes, blindly > > + * relocates low memory to high memory gives us a sub-optimal > > + * configuration. > > And this is done in hvmloader, so the toolstack has no inkling that > we need to relocate memory to make space for the PCI. > > In such case I would not have this check here. Instead put it in > libxl You're right, I think this should be placed in libxl. > and disallow vNUMA with PCI passthrough. > > And then the fix is to take the logic that is in hvmloader for PCI > BAR size relocation and move it in libxl. Then it can construct the > proper vNUMA topology and also fix an outstanding QEMU-xen bug. > But FYI not only PCI passthrough requires larger memory hole. A user can use device_model_args_extra (don't remember the exact name) to instrument QEMU to emulate arbitrary PCI devices. Wei. > > + */ > > + if ( hvm_info->nr_nodes != 0 && allow_memory_relocate ) > > + { > > + allow_memory_relocate = false; > > + printf("vNUMA enabled, relocating guest memory for lowmem MMIO space disabled\n"); > > + } > > + > > s = xenstore_read("platform/mmio_hole_size", NULL); > > if ( s ) > > mmio_hole_size = strtoll(s, NULL, 0); > > -- > > 1.7.10.4 > > > > > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xen.org > > http://lists.xen.org/xen-devel