[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] hvmloader: construct SLIT
commit 4677e007d7d4ee46f2ed428dce95ca630230e480 Author: Wei Liu <wei.liu2@xxxxxxxxxx> AuthorDate: Tue Feb 17 14:36:03 2015 +0100 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Tue Feb 17 14:36:03 2015 +0100 hvmloader: construct SLIT Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx> Acked-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- tools/firmware/hvmloader/acpi/acpi2_0.h | 8 ++++++ tools/firmware/hvmloader/acpi/build.c | 39 ++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletions(-) diff --git a/tools/firmware/hvmloader/acpi/acpi2_0.h b/tools/firmware/hvmloader/acpi/acpi2_0.h index 6169213..d698095 100644 --- a/tools/firmware/hvmloader/acpi/acpi2_0.h +++ b/tools/firmware/hvmloader/acpi/acpi2_0.h @@ -414,6 +414,12 @@ struct acpi_20_srat_memory { #define ACPI_MEM_AFFIN_HOTPLUGGABLE (1 << 1) #define ACPI_MEM_AFFIN_NONVOLATILE (1 << 2) +struct acpi_20_slit { + struct acpi_header header; + uint64_t localities; + uint8_t entry[0]; +}; + /* * Table Signatures. */ @@ -427,6 +433,7 @@ struct acpi_20_srat_memory { #define ACPI_2_0_HPET_SIGNATURE ASCII32('H','P','E','T') #define ACPI_2_0_WAET_SIGNATURE ASCII32('W','A','E','T') #define ACPI_2_0_SRAT_SIGNATURE ASCII32('S','R','A','T') +#define ACPI_2_0_SLIT_SIGNATURE ASCII32('S','L','I','T') /* * Table revision numbers. @@ -441,6 +448,7 @@ struct acpi_20_srat_memory { #define ACPI_2_0_WAET_REVISION 0x01 #define ACPI_1_0_FADT_REVISION 0x01 #define ACPI_2_0_SRAT_REVISION 0x01 +#define ACPI_2_0_SLIT_REVISION 0x01 #pragma pack () diff --git a/tools/firmware/hvmloader/acpi/build.c b/tools/firmware/hvmloader/acpi/build.c index 828fab5..3276df2 100644 --- a/tools/firmware/hvmloader/acpi/build.c +++ b/tools/firmware/hvmloader/acpi/build.c @@ -261,6 +261,38 @@ static struct acpi_20_srat *construct_srat(void) return srat; } +static struct acpi_20_slit *construct_slit(void) +{ + struct acpi_20_slit *slit; + unsigned int i, num, size; + + num = nr_vnodes * nr_vnodes; + size = sizeof(*slit) + num * sizeof(uint8_t); + + slit = mem_alloc(size, 16); + if ( !slit ) + return NULL; + + memset(slit, 0, size); + slit->header.signature = ACPI_2_0_SLIT_SIGNATURE; + slit->header.revision = ACPI_2_0_SLIT_REVISION; + fixed_strcpy(slit->header.oem_id, ACPI_OEM_ID); + fixed_strcpy(slit->header.oem_table_id, ACPI_OEM_TABLE_ID); + slit->header.oem_revision = ACPI_OEM_REVISION; + slit->header.creator_id = ACPI_CREATOR_ID; + slit->header.creator_revision = ACPI_CREATOR_REVISION; + + for ( i = 0; i < num; i++ ) + slit->entry[i] = vdistance[i]; + + slit->localities = nr_vnodes; + + slit->header.length = size; + set_checksum(slit, offsetof(struct acpi_header, checksum), size); + + return slit; +} + static int construct_passthrough_tables(unsigned long *table_ptrs, int nr_tables) { @@ -404,15 +436,20 @@ static int construct_secondary_tables(unsigned long *table_ptrs, } } - /* SRAT */ + /* SRAT and SLIT */ if ( nr_vnodes > 0 ) { struct acpi_20_srat *srat = construct_srat(); + struct acpi_20_slit *slit = construct_slit(); if ( srat ) table_ptrs[nr_tables++] = (unsigned long)srat; else printf("Failed to build SRAT, skipping...\n"); + if ( slit ) + table_ptrs[nr_tables++] = (unsigned long)slit; + else + printf("Failed to build SLIT, skipping...\n"); } /* Load any additional tables passed through. */ -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |