Skip to content

Commit

Permalink
x86, efi: Convert efi_phys_get_time() args to physical addresses
Browse files Browse the repository at this point in the history
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!"

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Matthew Garrett <mjg@redhat.com>
Link: http://lkml.kernel.org/r/1318330333-4617-1-git-send-email-matt@console-pimps.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Maurice Ma authored and Ingo Molnar committed Dec 5, 2011
1 parent 2e57ae0 commit e9a9eca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/platform/efi/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ static efi_status_t __init phys_efi_get_time(efi_time_t *tm,

spin_lock_irqsave(&rtc_lock, flags);
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();
spin_unlock_irqrestore(&rtc_lock, flags);
return status;
Expand Down

0 comments on commit e9a9eca

Please sign in to comment.