|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH RFC 05/20] acpi/hvmloader: Move passthrough initialization from ACPI code
Initiale it in hvmloader, avoiding ACPI code's use of xenstore_read()
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
---
tools/firmware/hvmloader/acpi/acpi2_0.h | 4 ++++
tools/firmware/hvmloader/acpi/build.c | 22 +++++++---------------
tools/firmware/hvmloader/util.c | 10 ++++++++++
3 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/tools/firmware/hvmloader/acpi/acpi2_0.h
b/tools/firmware/hvmloader/acpi/acpi2_0.h
index 1ed0d44..2617762 100644
--- a/tools/firmware/hvmloader/acpi/acpi2_0.h
+++ b/tools/firmware/hvmloader/acpi/acpi2_0.h
@@ -481,6 +481,10 @@ struct acpi_config {
struct acpi_info acpi_info;
uint64_t vm_gid[2];
uint32_t table_flags;
+ struct {
+ unsigned long acpi_pt_addr;
+ uint32_t acpi_pt_length;
+ } pt;
};
void acpi_build_tables(struct acpi_config *config, unsigned int physical);
diff --git a/tools/firmware/hvmloader/acpi/build.c
b/tools/firmware/hvmloader/acpi/build.c
index 9f45f26..8a05c7c 100644
--- a/tools/firmware/hvmloader/acpi/build.c
+++ b/tools/firmware/hvmloader/acpi/build.c
@@ -271,10 +271,10 @@ static struct acpi_20_slit *construct_slit(void)
}
static int construct_passthrough_tables(unsigned long *table_ptrs,
- int nr_tables)
+ int nr_tables,
+ struct acpi_config *config)
{
- const char *s;
- uint8_t *acpi_pt_addr;
+ unsigned long acpi_pt_addr;
uint32_t acpi_pt_length;
struct acpi_header *header;
int nr_added;
@@ -282,19 +282,11 @@ static int construct_passthrough_tables(unsigned long
*table_ptrs,
uint32_t total = 0;
uint8_t *buffer;
- s = xenstore_read(HVM_XS_ACPI_PT_ADDRESS, NULL);
- if ( s == NULL )
- return 0;
-
- acpi_pt_addr = (uint8_t*)(uint32_t)strtoll(s, NULL, 0);
- if ( acpi_pt_addr == NULL )
- return 0;
-
- s = xenstore_read(HVM_XS_ACPI_PT_LENGTH, NULL);
- if ( s == NULL )
+ if ( config->pt.acpi_pt_addr == 0 )
return 0;
- acpi_pt_length = (uint32_t)strtoll(s, NULL, 0);
+ acpi_pt_addr = config->pt.acpi_pt_addr;
+ acpi_pt_length = config->pt.acpi_pt_length;
for ( nr_added = 0; nr_added < nr_max; nr_added++ )
{
@@ -430,7 +422,7 @@ static int construct_secondary_tables(unsigned long
*table_ptrs,
}
/* Load any additional tables passed through. */
- nr_tables += construct_passthrough_tables(table_ptrs, nr_tables);
+ nr_tables += construct_passthrough_tables(table_ptrs, nr_tables, config);
table_ptrs[nr_tables] = 0;
return nr_tables;
diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index 54261ae..230e14a 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -26,6 +26,7 @@
#include <xen/xen.h>
#include <xen/memory.h>
#include <xen/sched.h>
+#include <xen/hvm/hvm_xs_strings.h>
#include <xen/hvm/params.h>
/*
@@ -893,6 +894,15 @@ void hvmloader_acpi_build_tables(struct acpi_config
*config,
config->vm_gid[1] = strtoll(end+1, NULL, 0);
}
+ s = xenstore_read(HVM_XS_ACPI_PT_ADDRESS, NULL);
+ if ( s ) {
+ config->pt.acpi_pt_addr = strtoll(s, NULL, 0);
+
+ s = xenstore_read(HVM_XS_ACPI_PT_LENGTH, NULL);
+ if ( s )
+ config->pt.acpi_pt_length = strtoll(s, NULL, 0);
+ }
+
if ( battery_port_exists() )
config->table_flags |= ACPI_BUILD_SSDT_PM;
if ( !strncmp(xenstore_read("platform/acpi_s3", "1"), "1", 1) )
--
2.4.3
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |