diff mbox

[RFC,10/20] acpi/hvmloader: Provide address of acpi_info as an argument to ACPI code

Message ID 1459905949-10358-11-git-send-email-boris.ostrovsky@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Boris Ostrovsky April 6, 2016, 1:25 a.m. UTC
Some users of ACPI builder may be building tables in virtual address space.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 tools/firmware/hvmloader/acpi/acpi2_0.h | 4 ++++
 tools/firmware/hvmloader/acpi/build.c   | 3 +--
 tools/firmware/hvmloader/config.h       | 3 +--
 tools/firmware/hvmloader/util.c         | 1 +
 4 files changed, 7 insertions(+), 4 deletions(-)

Comments

Jan Beulich June 3, 2016, 4:03 p.m. UTC | #1
>>> On 06.04.16 at 03:25, <boris.ostrovsky@oracle.com> wrote:
> --- a/tools/firmware/hvmloader/acpi/acpi2_0.h
> +++ b/tools/firmware/hvmloader/acpi/acpi2_0.h
> @@ -306,6 +306,9 @@ struct acpi_20_waet {
>  
>  #define ACPI_TIS_HDR_ADDRESS 0xFED40F00UL
>  
> +/* NB. ACPI_INFO_PHYSICAL_ADDRESS *MUST* match definition in acpi/dsdt.asl! */
> +#define ACPI_INFO_PHYSICAL_ADDRESS    0xFC000000UL

As said in the context of another patch - I don't think this belongs
here, the more that the consumer is in hvmloader/util.c. This is
genuinely a decision of the rest of the firmware (i.e. hvmloader
here). Plus, even if it was to be determined by libacpi, this would
be the wrong header- here there are supposed to be only ACPI
interface definitions.

The same then of course applies to ACPI_TIS_HDR_ADDRESS.

> --- a/tools/firmware/hvmloader/config.h
> +++ b/tools/firmware/hvmloader/config.h
> @@ -65,8 +65,7 @@ extern uint64_t pci_hi_mem_start, pci_hi_mem_end;
>  #define HVMLOADER_PHYSICAL_ADDRESS    0x00100000
>  /* Special BIOS mappings, etc. are allocated from here upwards... */
>  #define RESERVED_MEMBASE              0xFC000000
> -/* NB. ACPI_INFO_PHYSICAL_ADDRESS *MUST* match definition in acpi/dsdt.asl! */
> -#define ACPI_INFO_PHYSICAL_ADDRESS    0xFC000000
> +
>  #define RESERVED_MEMORY_DYNAMIC_START 0xFC001000
>  #define RESERVED_MEMORY_DYNAMIC_END   0xFE000000

The lower context here actually supports what I've said above. So
I think that itsem should stay here.

Jan
diff mbox

Patch

diff --git a/tools/firmware/hvmloader/acpi/acpi2_0.h b/tools/firmware/hvmloader/acpi/acpi2_0.h
index cf707b8..0bfd3ed 100644
--- a/tools/firmware/hvmloader/acpi/acpi2_0.h
+++ b/tools/firmware/hvmloader/acpi/acpi2_0.h
@@ -306,6 +306,9 @@  struct acpi_20_waet {
 
 #define ACPI_TIS_HDR_ADDRESS 0xFED40F00UL
 
+/* NB. ACPI_INFO_PHYSICAL_ADDRESS *MUST* match definition in acpi/dsdt.asl! */
+#define ACPI_INFO_PHYSICAL_ADDRESS    0xFC000000UL
+
 /*
  * Multiple APIC Flags.
  */
@@ -504,6 +507,7 @@  struct acpi_config {
     int apic_mode;
     struct acpi_numa numa;
     uint16_t *tis_hdr;
+    void *acpi_info_page;
 };
 
 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 2bf89e4..991a73f 100644
--- a/tools/firmware/hvmloader/acpi/build.c
+++ b/tools/firmware/hvmloader/acpi/build.c
@@ -589,8 +589,7 @@  void acpi_build_tables(struct acpi_config *config, unsigned int physical)
     if ( !new_vm_gid(config) )
         goto oom;
 
-    memcpy((struct acpi_info *)ACPI_INFO_PHYSICAL_ADDRESS,
-           &config->acpi_info,
+    memcpy(config->acpi_info_page, &config->acpi_info,
            sizeof(config->acpi_info));
 
     return;
diff --git a/tools/firmware/hvmloader/config.h b/tools/firmware/hvmloader/config.h
index b838cf9..6253155 100644
--- a/tools/firmware/hvmloader/config.h
+++ b/tools/firmware/hvmloader/config.h
@@ -65,8 +65,7 @@  extern uint64_t pci_hi_mem_start, pci_hi_mem_end;
 #define HVMLOADER_PHYSICAL_ADDRESS    0x00100000
 /* Special BIOS mappings, etc. are allocated from here upwards... */
 #define RESERVED_MEMBASE              0xFC000000
-/* NB. ACPI_INFO_PHYSICAL_ADDRESS *MUST* match definition in acpi/dsdt.asl! */
-#define ACPI_INFO_PHYSICAL_ADDRESS    0xFC000000
+
 #define RESERVED_MEMORY_DYNAMIC_START 0xFC001000
 #define RESERVED_MEMORY_DYNAMIC_END   0xFE000000
 /*
diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index c2145f6..d099adb 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -925,6 +925,7 @@  void hvmloader_acpi_build_tables(struct acpi_config *config,
     config->numa.vmemrange = vmemrange;
 
     config->tis_hdr = (uint16_t *)ACPI_TIS_HDR_ADDRESS;
+    config->acpi_info_page = (void *)ACPI_INFO_PHYSICAL_ADDRESS;
 
     acpi_build_tables(config, physical);