From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH] libxl, hvmloader: Don't relocate memory for MMIO hole Date: Tue, 18 Jun 2013 10:57:20 +0100 Message-ID: <51C02F00.7010100@eu.citrix.com> References: <1371487427-13025-1-git-send-email-george.dunlap@eu.citrix.com> <20927.17485.615792.812108@mariner.uk.xensource.com> <51C02D57.4060601@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; Format="flowed" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <51C02D57.4060601@eu.citrix.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: Ian Jackson Cc: Hanweidong , Stefano Stabellini , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 06/18/2013 10:50 AM, George Dunlap wrote: > On 06/17/2013 06:15 PM, Ian Jackson wrote: >> George Dunlap writes ("[PATCH] libxl,hvmloader: Don't relocate memory >> for MMIO hole"): >>> At the moment, qemu-xen can't handle memory being relocated by >>> hvmloader. This may happen if a device with a large enough memory >>> region is passed through to the guest. At the moment, if this >>> happens, then at some point in the future qemu will crash and the >>> domain will hang. (qemu-traditional is fine.) >> >> I think the approach is good. Arguably the two things should be in >> two patches. > > You mean one in libxl to set allow_memory_relocate, one to do something > about it? > >> >>> + const char *s; >>> + uint8_t allow_memory_relocate=3D1; >>> + >>> + s =3D xenstore_read(HVM_XS_ALLOW_MEMORY_RELOCATE, NULL); >>> + if (s) >>> + allow_memory_relocate=3D(uint8_t)strtoll(s, NULL, 0); >> >> Use strtoul, surely, and bool_t (or _Bool). Then there is no need for >> the cast. (Also, spaces round `=3D'.) > > Remember that hvmloader doesn't actually have a libc; this is a locally > implemented function, and AFAICT the only one implemented is strtoll. Hmm, and it doesn't seem to have a bool_t either: pci.c: In function =91pci_setup=92: pci.c:63:5: error: unknown type name =91bool_t=92 make[7]: *** [pci.o] Error 1 uint8_t is what this uses for various other booleans (is_64bar, &c), so = I'll just follow suit. -G