From: "Jan Beulich" Subject: Re: [PATCH v2 13/19] hvmloader: construct SRAT Date: Wed, 10 Dec 2014 08:20:38 +0000 Message-ID: <54881066020000780004E6D6@mail.emea.novell.com> References: <1417448023-27311-1-git-send-email-wei.liu2@citrix.com> <1417448023-27311-14-git-send-email-wei.liu2@citrix.com> <54873724020000780004E37B@mail.emea.novell.com> <20141209180657.GG25749@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20141209180657.GG25749@zion.uk.xensource.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu Cc: ian.campbell@citrix.com, dario.faggioli@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, ufimtseva@gmail.com, boris.ostrovsky@oracle.com List-Id: xen-devel@lists.xenproject.org >>> On 09.12.14 at 19:06, wrote: > On Tue, Dec 09, 2014 at 04:53:40PM +0000, Jan Beulich wrote: >> >>> On 01.12.14 at 16:33, wrote: >> > + memset(memory, 0, sizeof(*memory)); >> > + memory->type = ACPI_MEMORY_AFFINITY; >> > + memory->length = sizeof(*memory); >> > + memory->domain = vmemrange[i].nid; >> > + memory->flags = ACPI_MEM_AFFIN_ENABLED; >> > + memory->base_address = vmemrange[i].start; >> > + memory->mem_length = mem; >> > + memory++; >> > + } >> > + >> > + srat->header.length = size; >> >> Mind checking size == memory - p here? >> > > Why? There doesn't seem to be anything that would cause memory -p != > size in between during runtime. Except for that original calculation being wrong - that's what I would mean such a check to verify. Jan