diff mbox

[v3,50/62] xen/efi: store EFI system table in efi structure

Message ID 1447753261-7552-51-git-send-email-shannon.zhao@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Shannon Zhao Nov. 17, 2015, 9:40 a.m. UTC
From: Shannon Zhao <shannon.zhao@linaro.org>

When preparing EFI tables for Dom0, it needs the information of EFI
system table. Here store it in efi structure.

Signed-off-by: Parth Dixit <parth.dixit@linaro.org>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 xen/common/efi/boot.c | 2 ++
 xen/include/xen/efi.h | 1 +
 2 files changed, 3 insertions(+)

Comments

Jan Beulich Nov. 17, 2015, 11:07 a.m. UTC | #1
>>> On 17.11.15 at 10:40, <shannon.zhao@linaro.org> wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
> 
> When preparing EFI tables for Dom0, it needs the information of EFI
> system table. Here store it in efi structure.

Again I'm pretty sure I had already pointed out that this not being
needed on x86 calls for either more than the brief description above
or this being done just for ARM or (preferably) the table pointer
- where _really_ needed - to be passed around as function
argument(s).

Jan
Julien Grall Nov. 17, 2015, 11:57 a.m. UTC | #2
Hi Shannon,

On 17/11/15 09:40, shannon.zhao@linaro.org wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
> 
> When preparing EFI tables for Dom0, it needs the information of EFI
> system table. Here store it in efi structure.

On ARM64 the EFI stub is completely independent and therefore it's not
possible to share variable between Xen and the stub.

If it's working today is only by luck as we zero the BSS after the stub
jumped to Xen entry point.

Regards,

> Signed-off-by: Parth Dixit <parth.dixit@linaro.org>
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
> ---
>  xen/common/efi/boot.c | 2 ++
>  xen/include/xen/efi.h | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
> index 78d8ae9..6a48624 100644
> --- a/xen/common/efi/boot.c
> +++ b/xen/common/efi/boot.c
> @@ -1155,6 +1155,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
>  
>      efi_tables();
>  
> +    efi.est = (long)SystemTable;
> +
>      /* Collect PCI ROM contents. */
>      setup_efi_pci();
>  
> diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h
> index e74dad1..e112296 100644
> --- a/xen/include/xen/efi.h
> +++ b/xen/include/xen/efi.h
> @@ -16,6 +16,7 @@ struct efi {
>      unsigned long acpi20;       /* ACPI table (ACPI 2.0) */
>      unsigned long smbios;       /* SM BIOS table */
>      unsigned long smbios3;      /* SMBIOS v3 table */
> +    unsigned long est;          /* EFI system table */
>  };
>  
>  extern struct efi efi;
>
Shannon Zhao Nov. 18, 2015, 3:17 a.m. UTC | #3
On 2015/11/17 19:57, Julien Grall wrote:
> Hi Shannon,
> 
> On 17/11/15 09:40, shannon.zhao@linaro.org wrote:
>> From: Shannon Zhao <shannon.zhao@linaro.org>
>>
>> When preparing EFI tables for Dom0, it needs the information of EFI
>> system table. Here store it in efi structure.
> 
> On ARM64 the EFI stub is completely independent and therefore it's not
> possible to share variable between Xen and the stub.
> 
> If it's working today is only by luck as we zero the BSS after the stub
> jumped to Xen entry point.
> 
Yes, that's right. Sorry, I didn't investigate this deeply while just
getting this patch of Parth version.

I re-think about it. The reason why we need that variable is that when
we create EFI System table for Dom0 it copies the table header from
that. Since it supplies Dom0 a Xen specific UEFI and it could get the
information from other way, this change is not necessary. I'll drop this
at next version.

Thanks,
diff mbox

Patch

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 78d8ae9..6a48624 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1155,6 +1155,8 @@  efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     efi_tables();
 
+    efi.est = (long)SystemTable;
+
     /* Collect PCI ROM contents. */
     setup_efi_pci();
 
diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h
index e74dad1..e112296 100644
--- a/xen/include/xen/efi.h
+++ b/xen/include/xen/efi.h
@@ -16,6 +16,7 @@  struct efi {
     unsigned long acpi20;       /* ACPI table (ACPI 2.0) */
     unsigned long smbios;       /* SM BIOS table */
     unsigned long smbios3;      /* SMBIOS v3 table */
+    unsigned long est;          /* EFI system table */
 };
 
 extern struct efi efi;