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

2008-02-18 Thread Ingo Molnar
* Andi Kleen <[EMAIL PROTECTED]> wrote: > > UEFI specification 2.1 (section 6.2, page 124) that the > > NumberOfPages (num_pages) of EFI_MEMORY_DESCRIPTOR > > (efi_memory_desc_t) must be "Number of 4KB pages in the memory > > region". So we need not worry about potential EFI_PAGE_SHIFT > > ch

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

2008-02-18 Thread Andi Kleen
> After looking up in UEFI specification, I found that it is specified by Thanks. > UEFI specification 2.1 (section 6.2, page 124) that the NumberOfPages > (num_pages) of EFI_MEMORY_DESCRIPTOR (efi_memory_desc_t) must be "Number > of 4KB pages in the memory region". So we need not worry about pot

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

2008-02-17 Thread Huang, Ying
On Fri, 2008-02-15 at 08:08 +0100, Ingo Molnar wrote: > * Huang, Ying <[EMAIL PROTECTED]> wrote: > > > On Thu, 2008-02-14 at 17:12 +0100, Ingo Molnar wrote: > > > this is indeed a bug (we change the attributes for a larger area than > > > needed), but your fix is unclean. Find below a cleaner so

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

2008-02-15 Thread Andi Kleen
Huang, Ying wrote: > On Fri, 2008-02-15 at 09:48 +0100, Andi Kleen wrote: >> On Fri, Feb 15, 2008 at 12:48:06PM +0800, Huang, Ying wrote: >>> This patch has been tested on Intel x86 platform with EFI 32/64. >> Can EFI_PAGE_SIZE ever be < 4k? If yes you would need to round up >> first to linux page

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

2008-02-15 Thread Huang, Ying
On Fri, 2008-02-15 at 09:55 +0100, Andi Kleen wrote: > > But because end_pfn_map contains the above UC memory area, efi_ioremap() > > is not used on EFI 64. > > I see. It would be a good idea if you could test with a limited > memmap (mem=... command line option) just to make sure this path works

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

2008-02-15 Thread Huang, Ying
On Fri, 2008-02-15 at 09:48 +0100, Andi Kleen wrote: > On Fri, Feb 15, 2008 at 12:48:06PM +0800, Huang, Ying wrote: > > > > This patch has been tested on Intel x86 platform with EFI 32/64. > > Can EFI_PAGE_SIZE ever be < 4k? If yes you would need to round up > first to linux page size before shif

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

2008-02-15 Thread Andi Kleen
> But because end_pfn_map contains the above UC memory area, efi_ioremap() > is not used on EFI 64. I see. It would be a good idea if you could test with a limited memmap (mem=... command line option) just to make sure this path works Right now I don't think pageattr.c will deal fully correct wit

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

2008-02-15 Thread Andi Kleen
On Fri, Feb 15, 2008 at 12:48:06PM +0800, Huang, Ying wrote: > > This patch has been tested on Intel x86 platform with EFI 32/64. Can EFI_PAGE_SIZE ever be < 4k? If yes you would need to round up first to linux page size before shifting. -Andi -- To unsubscribe from this list: send the line "un

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

2008-02-14 Thread Huang, Ying
On Fri, 2008-02-15 at 08:08 +0100, Ingo Molnar wrote: > * Huang, Ying <[EMAIL PROTECTED]> wrote: > > > On Thu, 2008-02-14 at 17:12 +0100, Ingo Molnar wrote: > > > this is indeed a bug (we change the attributes for a larger area than > > > needed), but your fix is unclean. Find below a cleaner so

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

2008-02-14 Thread Ingo Molnar
* Linus Torvalds <[EMAIL PROTECTED]> wrote: > 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 E

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

2008-02-14 Thread Ingo Molnar
* Huang, Ying <[EMAIL PROTECTED]> wrote: > On Thu, 2008-02-14 at 17:12 +0100, Ingo Molnar wrote: > > this is indeed a bug (we change the attributes for a larger area than > > needed), but your fix is unclean. Find below a cleaner solution. > > > > Ying, if you agree with this fix could you ple

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

2008-02-14 Thread Huang, Ying
On Thu, 2008-02-14 at 21:44 -0800, Linus Torvalds wrote: > > On Fri, 15 Feb 2008, Huang, Ying wrote: > > > > I think the patch following may be better, because it is possible that > > the EFI_PAGE_SHIFT and PAGE_SHIFT are different. > > If this is a problem in practice, we'd be better off having

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

2008-02-14 Thread Linus Torvalds
On Fri, 15 Feb 2008, Huang, Ying wrote: > > I think the patch following may be better, because it is possible that > the EFI_PAGE_SHIFT and PAGE_SHIFT are different. 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 >

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

2008-02-14 Thread Huang, Ying
On Thu, 2008-02-14 at 17:12 +0100, Ingo Molnar wrote: > this is indeed a bug (we change the attributes for a larger area than > needed), but your fix is unclean. Find below a cleaner solution. > > Ying, if you agree with this fix could you please test and ACK it before > we push it to Linus? (t

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

2008-02-14 Thread Huang, Ying
On Thu, 2008-02-14 at 19:38 +0100, Ingo Molnar wrote: > * Andi Kleen <[EMAIL PROTECTED]> wrote: > > > > this is indeed a bug (we change the attributes for a larger area > > > than needed), but your fix is unclean. Find below a cleaner > > > solution. > > > > You're still ignoring the other prob

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

2008-02-14 Thread Andi Kleen
On Thu, Feb 14, 2008 at 02:08:16PM -0800, Arjan van de Ven wrote: > On Thu, 14 Feb 2008 22:42:41 +0100 > Andi Kleen <[EMAIL PROTECTED]> wrote: > > > On Thu, Feb 14, 2008 at 07:38:19PM +0100, Ingo Molnar wrote: > > > > > > * Andi Kleen <[EMAIL PROTECTED]> wrote: > > > > > > > > this is indeed a b

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

2008-02-14 Thread Arjan van de Ven
On Thu, 14 Feb 2008 22:42:41 +0100 Andi Kleen <[EMAIL PROTECTED]> wrote: > On Thu, Feb 14, 2008 at 07:38:19PM +0100, Ingo Molnar wrote: > > > > * Andi Kleen <[EMAIL PROTECTED]> wrote: > > > > > > this is indeed a bug (we change the attributes for a larger > > > > area than needed), but your fix

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

2008-02-14 Thread Andi Kleen
On Thu, Feb 14, 2008 at 07:38:19PM +0100, Ingo Molnar wrote: > > * Andi Kleen <[EMAIL PROTECTED]> wrote: > > > > this is indeed a bug (we change the attributes for a larger area > > > than needed), but your fix is unclean. Find below a cleaner > > > solution. > > > > You're still ignoring the

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

2008-02-14 Thread Ingo Molnar
* Andi Kleen <[EMAIL PROTECTED]> wrote: > > this is indeed a bug (we change the attributes for a larger area > > than needed), but your fix is unclean. Find below a cleaner > > solution. > > You're still ignoring the other problem of set_memory_uc() not > handling fixmap and ioremap correctly

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

2008-02-14 Thread Andi Kleen
> this is indeed a bug (we change the attributes for a larger area than > needed), but your fix is unclean. Find below a cleaner solution. You're still ignoring the other problem of set_memory_uc() not handling fixmap and ioremap correctly. I explained it to you several times now and you have no

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

2008-02-14 Thread Ingo Molnar
* Andi Kleen <[EMAIL PROTECTED]> wrote: > --- linux.orig/arch/x86/kernel/efi.c > +++ linux/arch/x86/kernel/efi.c > @@ -413,17 +413,31 @@ void __init efi_enter_virtual_mode(void) > > efi.systab = NULL; > for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { > +

[PATCH] Fix left over EFI cache mapping problems

2008-02-14 Thread Andi Kleen
Fix left over EFI cache mapping problems [History: this was originally part of a larger patch that got partially added earlier. This patch fixes the left-over bugs and also fixes another bug I noticed while revising this] cpa/set_memory_* does not properly support ioremap or fixmap (efi_ioremap o