Re: [patch 29/29] initrd: Fix virtual/physical mix-up in overwrite test



On Thu, 17 Jul 2008 21:16:36 +0200, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
if (initrd_start && !initrd_below_start_ok &&
- initrd_start < min_low_pfn << PAGE_SHIFT) {
+ page_to_pfn(virt_to_page(initrd_start)) < min_low_pfn) {
printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - "
- "disabling it.\n",initrd_start,min_low_pfn << PAGE_SHIFT);
+ "disabling it.\n",
+ page_to_pfn(virt_to_page(initrd_start)), min_low_pfn);
initrd_start = 0;
}

This patch causes warnings on mips:

linux/init/main.c: In function 'start_kernel':
linux/init/main.c:633: warning: passing argument 1 of 'virt_to_phys' makes pointer from integer without a cast
linux/init/main.c:636: warning: passing argument 1 of 'virt_to_phys' makes pointer from integer without a cast

Because an argument of mips virt_to_phys() is an pointer and
initrd_start is unsigned long. It seems most (all?) arch's
virt_to_phys() casts its argument to unsigned long internally. Should
mips follow?

---
Atsushi Nemoto
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [patch 29/29] initrd: Fix virtual/physical mix-up in overwrite test
    ... This patch causes warnings on mips: ... Because an argument of mips virt_to_physis an pointer and ... has `extern void *initrd_start' to fool around this? ...
    (Linux-Kernel)
  • "elf core dump: fix get_user use" breaks mips compilation
    ... breaks the compilation on MIPS: ... cc1: warnings being treated as errors ... Martin Michlmayr ...
    (Linux-Kernel)
  • [PATCH][RFC] MIPS: Simplify ioctl.h header file.
    ... a patch against the MIPS ioctl.h file to shorter it considerably. ... * The original linux ioctl numbering scheme was just a general ... The following are included for compatibility ...
    (Linux-Kernel)
  • Re: Tlb Load Exception!
    ... Though the NULL pointer access is invalid; ... Exception and reboot because of that exception. ... Is there any way to fix / handle this in MIPS? ... architecture and doing an access there always causes a trap. ...
    (comp.os.vxworks)
  • Re: [RFC] Crash on modpost, addend_386_rel()
    ... make better section mismatch reports on i386, arm and mips ... the patch breaks CONFIG_RELOCATABLE=y build. ... Anyway, here is a updated patch tested on i386, arm, ... Subject: kbuild: make better section mismatch reports on i386, ...
    (Linux-Kernel)