login
Header Space

 
 

Re: [PATCH] Fix left over EFI cache mapping problems

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Huang, Ying <ying.huang@...>
Cc: Ingo Molnar <mingo@...>, Andi Kleen <andi@...>, <tglx@...>, <linux-kernel@...>
Date: Friday, February 15, 2008 - 1:44 am

On Fri, 15 Feb 2008, Huang, Ying wrote:

If this is a problem in practice, we'd be better off having a helper 
function to do it, to avoid overflows. Right now, doing


overflows at 4GB on x86-32. And maybe you never have areas that big, and 
people are moving over to 64-bit anyway, it still sounds like a bug 
waiting to happen.

So *if* we care (I doubt we do, since EFI_PAGE_SHIFT at least right now 
matches PAGE_SHIFT on x86), you'd probably want to do something like

  static inline unsigned long efi_pages_to_native_pages(unsigned long efi_pages)
  {
  #if EFI_PAGE_SHIFT > PAGE_SHIFT
	return efi_pages << (EFI_PAGE_SHIFT - PAGE_SHIFT);
  #else
	return efi_pages >> (PAGE_SHIFT - EFI_PAGE_SHIFT);
  #endif
  }

or whatever.

Otherwise, trying to avoid a bug with different page sizes is actually 
more likely to *introduce* one rather than fix one..

			Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Fix left over EFI cache mapping problems, Andi Kleen, (Thu Feb 14, 9:13 am)
Re: [PATCH] Fix left over EFI cache mapping problems, Ingo Molnar, (Thu Feb 14, 12:12 pm)
Re: [PATCH] Fix left over EFI cache mapping problems, Huang, Ying, (Fri Feb 15, 12:48 am)
Re: [PATCH] Fix left over EFI cache mapping problems, Andi Kleen, (Fri Feb 15, 4:48 am)
Re: [PATCH] Fix left over EFI cache mapping problems, Huang, Ying, (Fri Feb 15, 5:21 am)
Re: [PATCH] Fix left over EFI cache mapping problems, Andi Kleen, (Fri Feb 15, 5:43 am)
Re: [PATCH] Fix left over EFI cache mapping problems, Ingo Molnar, (Fri Feb 15, 3:08 am)
Re: [PATCH] Fix left over EFI cache mapping problems, Huang, Ying, (Sun Feb 17, 9:53 pm)
Re: [PATCH] Fix left over EFI cache mapping problems, Andi Kleen, (Mon Feb 18, 7:26 am)
Re: [PATCH] Fix left over EFI cache mapping problems, Ingo Molnar, (Mon Feb 18, 10:05 am)
Re: [PATCH] Fix left over EFI cache mapping problems, Huang, Ying, (Fri Feb 15, 3:32 am)
Re: [PATCH] Fix left over EFI cache mapping problems, Linus Torvalds, (Fri Feb 15, 1:44 am)
Re: [PATCH] Fix left over EFI cache mapping problems, Ingo Molnar, (Fri Feb 15, 3:30 am)
Re: [PATCH] Fix left over EFI cache mapping problems, Huang, Ying, (Fri Feb 15, 2:24 am)
Re: [PATCH] Fix left over EFI cache mapping problems, Andi Kleen, (Thu Feb 14, 1:16 pm)
Re: [PATCH] Fix left over EFI cache mapping problems, Ingo Molnar, (Thu Feb 14, 2:38 pm)
Re: [PATCH] Fix left over EFI cache mapping problems, Huang, Ying, (Thu Feb 14, 10:52 pm)
Re: [PATCH] Fix left over EFI cache mapping problems, Andi Kleen, (Fri Feb 15, 4:55 am)
Re: [PATCH] Fix left over EFI cache mapping problems, Huang, Ying, (Fri Feb 15, 5:16 am)
Re: [PATCH] Fix left over EFI cache mapping problems, Andi Kleen, (Thu Feb 14, 5:42 pm)
Re: [PATCH] Fix left over EFI cache mapping problems, Arjan van de Ven, (Thu Feb 14, 6:08 pm)
Re: [PATCH] Fix left over EFI cache mapping problems, Andi Kleen, (Thu Feb 14, 7:01 pm)
speck-geostationary