From: Maurice Ma <[email protected]>

Because callers of efi_phys_get_time() pass virtual stack addresses as
arguments, we need to find their corresponding physical addresses and
when calling GetTime() in physical mode.

Without this patch the following line is printed on boot,

        "Oops: efitime: can't read time!"

Cc: Matthew Garrett <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: [email protected]
Cc: Zhang Rui <[email protected]>
Signed-off-by: Maurice Ma <[email protected]>
Signed-off-by: Matt Fleming <[email protected]>
Integrated-by: Darren Hart <[email protected]>
---
 arch/x86/platform/efi/efi.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 899e393..4fd8217 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -167,7 +167,8 @@ static efi_status_t __init phys_efi_get_time(efi_time_t *tm,
        efi_status_t status;
 
        efi_call_phys_prelog();
-       status = efi_call_phys2(efi_phys.get_time, tm, tc);
+       status = efi_call_phys2(efi_phys.get_time, virt_to_phys(tm),
+                               virt_to_phys(tc));
        efi_call_phys_epilog();
        return status;
 }
-- 
1.7.6.4

_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to