All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86, efi: Convert efi_phys_get_time() args to physical addresses
@ 2011-10-11 10:52 Matt Fleming
  2011-11-07 11:31 ` Matt Fleming
  2011-12-05 13:29 ` [tip:x86/asm] " tip-bot for Maurice Ma
  0 siblings, 2 replies; 6+ messages in thread
From: Matt Fleming @ 2011-10-11 10:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Matthew Garrett, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	x86, Zhang Rui

From: Maurice Ma <maurice.ma@intel.com>

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 <mjg@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
---
 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 3ae4128..d182bba 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -237,7 +237,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;
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86, efi: Convert efi_phys_get_time() args to physical addresses
  2011-10-11 10:52 [PATCH] x86, efi: Convert efi_phys_get_time() args to physical addresses Matt Fleming
@ 2011-11-07 11:31 ` Matt Fleming
  2011-11-07 19:08   ` H. Peter Anvin
  2011-12-05 13:29 ` [tip:x86/asm] " tip-bot for Maurice Ma
  1 sibling, 1 reply; 6+ messages in thread
From: Matt Fleming @ 2011-11-07 11:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Matthew Garrett, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	x86, Zhang Rui

On Tue, 2011-10-11 at 11:52 +0100, Matt Fleming wrote:
> From: Maurice Ma <maurice.ma@intel.com>
> 
> 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 <mjg@redhat.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: Zhang Rui <rui.zhang@intel.com>
> Signed-off-by: Maurice Ma <maurice.ma@intel.com>
> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
> ---
>  arch/x86/platform/efi/efi.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)

Ping?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86, efi: Convert efi_phys_get_time() args to physical addresses
  2011-11-07 11:31 ` Matt Fleming
@ 2011-11-07 19:08   ` H. Peter Anvin
  2011-11-08 11:27     ` Matt Fleming
  2011-11-25 16:38     ` Matt Fleming
  0 siblings, 2 replies; 6+ messages in thread
From: H. Peter Anvin @ 2011-11-07 19:08 UTC (permalink / raw)
  To: Matt Fleming
  Cc: linux-kernel, Matthew Garrett, Thomas Gleixner, Ingo Molnar, x86,
	Zhang Rui

On 11/07/2011 03:31 AM, Matt Fleming wrote:
> 
> Ping?
> 

Is this -stable material?

	-hpa


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86, efi: Convert efi_phys_get_time() args to physical addresses
  2011-11-07 19:08   ` H. Peter Anvin
@ 2011-11-08 11:27     ` Matt Fleming
  2011-11-25 16:38     ` Matt Fleming
  1 sibling, 0 replies; 6+ messages in thread
From: Matt Fleming @ 2011-11-08 11:27 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: linux-kernel, Matthew Garrett, Thomas Gleixner, Ingo Molnar, x86,
	Zhang Rui, Ma, Maurice

On Mon, 2011-11-07 at 11:08 -0800, H. Peter Anvin wrote:
> On 11/07/2011 03:31 AM, Matt Fleming wrote:
> > 
> > Ping?
> > 
> 
> Is this -stable material?

I don't think so. It only affects things early in boot (before
efi_enter_virtual_mode()) is called. Once we've called
SetVirtualAddressMap() we call virt_efi_get_time() to get the time and
everything works fine.

I don't think this bug is even visible to the user apart from the "Oops:
efitime: can't read time!" message displayed on boot. It certainly
doesn't cause a crash or anything like that.

-- 
Matt Fleming, Intel Open Source Technology Center


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86, efi: Convert efi_phys_get_time() args to physical addresses
  2011-11-07 19:08   ` H. Peter Anvin
  2011-11-08 11:27     ` Matt Fleming
@ 2011-11-25 16:38     ` Matt Fleming
  1 sibling, 0 replies; 6+ messages in thread
From: Matt Fleming @ 2011-11-25 16:38 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: linux-kernel, Matthew Garrett, Thomas Gleixner, Ingo Molnar, x86,
	Zhang Rui

On Mon, 2011-11-07 at 11:08 -0800, H. Peter Anvin wrote:
> On 11/07/2011 03:31 AM, Matt Fleming wrote:
> > 
> > Ping?
> > 
> 
> Is this -stable material?

Are you picking this up, Peter?

-- 
Matt Fleming, Intel Open Source Technology Center


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tip:x86/asm] x86, efi: Convert efi_phys_get_time() args to physical addresses
  2011-10-11 10:52 [PATCH] x86, efi: Convert efi_phys_get_time() args to physical addresses Matt Fleming
  2011-11-07 11:31 ` Matt Fleming
@ 2011-12-05 13:29 ` tip-bot for Maurice Ma
  1 sibling, 0 replies; 6+ messages in thread
From: tip-bot for Maurice Ma @ 2011-12-05 13:29 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, mjg, hpa, mingo, rui.zhang, matt.fleming,
	maurice.ma, tglx, mingo

Commit-ID:  e9a9eca517d4cd94e816538efc400257e34bc63e
Gitweb:     http://git.kernel.org/tip/e9a9eca517d4cd94e816538efc400257e34bc63e
Author:     Maurice Ma <maurice.ma@intel.com>
AuthorDate: Tue, 11 Oct 2011 11:52:13 +0100
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 5 Dec 2011 12:45:14 +0100

x86, efi: Convert efi_phys_get_time() args to physical addresses

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>
---
 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 37718f0..d2376eb 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -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;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-12-05 13:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-11 10:52 [PATCH] x86, efi: Convert efi_phys_get_time() args to physical addresses Matt Fleming
2011-11-07 11:31 ` Matt Fleming
2011-11-07 19:08   ` H. Peter Anvin
2011-11-08 11:27     ` Matt Fleming
2011-11-25 16:38     ` Matt Fleming
2011-12-05 13:29 ` [tip:x86/asm] " tip-bot for Maurice Ma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.