Re: [Xen-devel] [PATCH v2 06/23] acpi/hvmloader: Collect processor and NUMA info in hvmloader
>>> On 09.08.16 at 15:43,wrote: > On 08/09/2016 09:27 AM, Jan Beulich wrote: > On 04.08.16 at 23:06, wrote: >>> --- >>> v2: >>> * Note: struct acpi_numa's pointers can't be constified due to their >>> use in later patches >> Well, I hope I'll remember once I get there. > > Patch 22, init_acpi_config() routine. Thanks. >>> --- a/tools/firmware/hvmloader/acpi/build.c >>> +++ b/tools/firmware/hvmloader/acpi/build.c >>> @@ -70,7 +70,8 @@ static void set_checksum( >>> p[checksum_offset] = -sum; >>> } >>> >>> -static struct acpi_20_madt *construct_madt(struct acpi_info *info) >>> +static struct acpi_20_madt *construct_madt(struct acpi_config *config, >> const? (I'm btw going to take the liberty to fix up patch 2 in this >> regard when committing it later today, > > Keep in mind that this series is blocked by re-licensing not yet having > been acked by all parties. This affects the series starting with a later > patch (the one that moves files to tools/, patch 14) but I am not sure > it's worth committing early patches only. Patch 15 is the only exception. Well, primarily I wanted to reduce the amount of necessary resends. Since the initial patches shouldn't break anything, I think committing them should be fine. Unless you tell me not to, of course. Jan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v2 06/23] acpi/hvmloader: Collect processor and NUMA info in hvmloader
On 08/09/2016 09:43 AM, Boris Ostrovsky wrote: > On 08/09/2016 09:27 AM, Jan Beulich wrote: > On 04.08.16 at 23:06,wrote: >>> --- >>> v2: >>> * Note: struct acpi_numa's pointers can't be constified due to their >>> use in later patches >> Well, I hope I'll remember once I get there. > Patch 22, init_acpi_config() routine. > >>> --- a/tools/firmware/hvmloader/acpi/build.c >>> +++ b/tools/firmware/hvmloader/acpi/build.c >>> @@ -70,7 +70,8 @@ static void set_checksum( >>> p[checksum_offset] = -sum; >>> } >>> >>> -static struct acpi_20_madt *construct_madt(struct acpi_info *info) >>> +static struct acpi_20_madt *construct_madt(struct acpi_config *config, >> const? (I'm btw going to take the liberty to fix up patch 2 in this >> regard when committing it later today, > Keep in mind that this series is blocked by re-licensing not yet having > been acked by all parties. This affects the series starting with a later > patch (the one that moves files to tools/, patch 14) but I am not sure > it's worth committing early patches only. Patch 15 is the only exception. Oh, and it is also built on top of Anthony's BIOS series. -boris ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v2 06/23] acpi/hvmloader: Collect processor and NUMA info in hvmloader
On 08/09/2016 09:27 AM, Jan Beulich wrote: On 04.08.16 at 23:06,wrote: >> --- >> v2: >> * Note: struct acpi_numa's pointers can't be constified due to their >> use in later patches > Well, I hope I'll remember once I get there. Patch 22, init_acpi_config() routine. > >> --- a/tools/firmware/hvmloader/acpi/build.c >> +++ b/tools/firmware/hvmloader/acpi/build.c >> @@ -70,7 +70,8 @@ static void set_checksum( >> p[checksum_offset] = -sum; >> } >> >> -static struct acpi_20_madt *construct_madt(struct acpi_info *info) >> +static struct acpi_20_madt *construct_madt(struct acpi_config *config, > const? (I'm btw going to take the liberty to fix up patch 2 in this > regard when committing it later today, Keep in mind that this series is blocked by re-licensing not yet having been acked by all parties. This affects the series starting with a later patch (the one that moves files to tools/, patch 14) but I am not sure it's worth committing early patches only. Patch 15 is the only exception. -boris ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH v2 06/23] acpi/hvmloader: Collect processor and NUMA info in hvmloader
>>> On 04.08.16 at 23:06,wrote: > --- > v2: > * Note: struct acpi_numa's pointers can't be constified due to their > use in later patches Well, I hope I'll remember once I get there. > --- a/tools/firmware/hvmloader/acpi/build.c > +++ b/tools/firmware/hvmloader/acpi/build.c > @@ -70,7 +70,8 @@ static void set_checksum( > p[checksum_offset] = -sum; > } > > -static struct acpi_20_madt *construct_madt(struct acpi_info *info) > +static struct acpi_20_madt *construct_madt(struct acpi_config *config, const? (I'm btw going to take the liberty to fix up patch 2 in this regard when committing it later today, and patch 4 would need this too then for construct_secondary_tables().) > @@ -134,9 +135,9 @@ static struct acpi_20_madt *construct_madt(struct > acpi_info *info) > io_apic->ioapic_addr = IOAPIC_BASE_ADDRESS; > > lapic = (struct acpi_20_madt_lapic *)(io_apic + 1); > -info->nr_cpus = hvm_info->nr_vcpus; > +info->nr_cpus = config-> hvminfo->nr_vcpus; Stray blank. This wouldn't have happened had you introduced a local variable hvm_info. > @@ -195,7 +196,7 @@ static struct acpi_20_waet *construct_waet(void) > return waet; > } > > -static struct acpi_20_srat *construct_srat(void) > +static struct acpi_20_srat *construct_srat(struct acpi_config *config) const again? > @@ -252,12 +254,12 @@ static struct acpi_20_srat *construct_srat(void) > return srat; > } > > -static struct acpi_20_slit *construct_slit(void) > +static struct acpi_20_slit *construct_slit(struct acpi_config *config) And again. Jan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH v2 06/23] acpi/hvmloader: Collect processor and NUMA info in hvmloader
No need for ACPI code to rely on hvm_info variable. Signed-off-by: Boris Ostrovsky--- v2: * Note: struct acpi_numa's pointers can't be constified due to their use in later patches tools/firmware/hvmloader/acpi/build.c | 50 + tools/firmware/hvmloader/acpi/libacpi.h | 13 + tools/firmware/hvmloader/util.c | 9 ++ 3 files changed, 48 insertions(+), 24 deletions(-) diff --git a/tools/firmware/hvmloader/acpi/build.c b/tools/firmware/hvmloader/acpi/build.c index 8ca7e69..075d8d7 100644 --- a/tools/firmware/hvmloader/acpi/build.c +++ b/tools/firmware/hvmloader/acpi/build.c @@ -70,7 +70,8 @@ static void set_checksum( p[checksum_offset] = -sum; } -static struct acpi_20_madt *construct_madt(struct acpi_info *info) +static struct acpi_20_madt *construct_madt(struct acpi_config *config, + struct acpi_info *info) { struct acpi_20_madt *madt; struct acpi_20_madt_intsrcovr *intsrcovr; @@ -81,7 +82,7 @@ static struct acpi_20_madt *construct_madt(struct acpi_info *info) sz = sizeof(struct acpi_20_madt); sz += sizeof(struct acpi_20_madt_intsrcovr) * 16; sz += sizeof(struct acpi_20_madt_ioapic); -sz += sizeof(struct acpi_20_madt_lapic) * hvm_info->nr_vcpus; +sz += sizeof(struct acpi_20_madt_lapic) * config->hvminfo->nr_vcpus; madt = mem_alloc(sz, 16); if (!madt) return NULL; @@ -134,9 +135,9 @@ static struct acpi_20_madt *construct_madt(struct acpi_info *info) io_apic->ioapic_addr = IOAPIC_BASE_ADDRESS; lapic = (struct acpi_20_madt_lapic *)(io_apic + 1); -info->nr_cpus = hvm_info->nr_vcpus; +info->nr_cpus = config-> hvminfo->nr_vcpus; info->madt_lapic0_addr = (uint32_t)lapic; -for ( i = 0; i < hvm_info->nr_vcpus; i++ ) +for ( i = 0; i < config->hvminfo->nr_vcpus; i++ ) { memset(lapic, 0, sizeof(*lapic)); lapic->type= ACPI_PROCESSOR_LOCAL_APIC; @@ -144,7 +145,7 @@ static struct acpi_20_madt *construct_madt(struct acpi_info *info) /* Processor ID must match processor-object IDs in the DSDT. */ lapic->acpi_processor_id = i; lapic->apic_id = LAPIC_ID(i); -lapic->flags = (test_bit(i, hvm_info->vcpu_online) +lapic->flags = (test_bit(i, config->hvminfo->vcpu_online) ? ACPI_LOCAL_APIC_ENABLED : 0); lapic++; } @@ -195,7 +196,7 @@ static struct acpi_20_waet *construct_waet(void) return waet; } -static struct acpi_20_srat *construct_srat(void) +static struct acpi_20_srat *construct_srat(struct acpi_config *config) { struct acpi_20_srat *srat; struct acpi_20_srat_processor *processor; @@ -204,8 +205,8 @@ static struct acpi_20_srat *construct_srat(void) void *p; unsigned int i; -size = sizeof(*srat) + sizeof(*processor) * hvm_info->nr_vcpus + - sizeof(*memory) * nr_vmemranges; +size = sizeof(*srat) + sizeof(*processor) * config->hvminfo->nr_vcpus + + sizeof(*memory) * config->numa.nr_vmemranges; p = mem_alloc(size, 16); if ( !p ) @@ -222,25 +223,26 @@ static struct acpi_20_srat *construct_srat(void) srat->table_revision = ACPI_SRAT_TABLE_REVISION; processor = (struct acpi_20_srat_processor *)(srat + 1); -for ( i = 0; i < hvm_info->nr_vcpus; i++ ) +for ( i = 0; i < config->hvminfo->nr_vcpus; i++ ) { processor->type = ACPI_PROCESSOR_AFFINITY; processor->length = sizeof(*processor); -processor->domain = vcpu_to_vnode[i]; +processor->domain = config->numa.vcpu_to_vnode[i]; processor->apic_id = LAPIC_ID(i); processor->flags= ACPI_LOCAL_APIC_AFFIN_ENABLED; processor++; } memory = (struct acpi_20_srat_memory *)processor; -for ( i = 0; i < nr_vmemranges; i++ ) +for ( i = 0; i < config->numa.nr_vmemranges; i++ ) { memory->type = ACPI_MEMORY_AFFINITY; memory->length= sizeof(*memory); -memory->domain= vmemrange[i].nid; +memory->domain= config->numa.vmemrange[i].nid; memory->flags = ACPI_MEM_AFFIN_ENABLED; -memory->base_address = vmemrange[i].start; -memory->mem_length= vmemrange[i].end - vmemrange[i].start; +memory->base_address = config->numa.vmemrange[i].start; +memory->mem_length= config->numa.vmemrange[i].end - +config->numa.vmemrange[i].start; memory++; } @@ -252,12 +254,12 @@ static struct acpi_20_srat *construct_srat(void) return srat; } -static struct acpi_20_slit *construct_slit(void) +static struct acpi_20_slit *construct_slit(struct acpi_config *config) { struct acpi_20_slit *slit; unsigned int i, num, size; -num = nr_vnodes * nr_vnodes; +num = config->numa.nr_vnodes * config->numa.nr_vnodes;