[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: kernel panic with freebsd-image 7.2-5 (i386)



it seems better:

# ./7.2-4_with_patch/lib/modules/7.2-1-486/acpi.ko
Program Headers:
 Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
 LOAD           0x000000 0x00000000 0x00000000 0x54008 0x54008 R E 0x1000
 LOAD           0x055000 0x00055000 0x00055000 0x0241c 0x03c8c RW  0x1000
 DYNAMIC        0x055000 0x00055000 0x00055000 0x00078 0x00078 RW  0x4
 GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4

Same as with build on io.debian.net, OK.

Applying the patch fixes the problem. The kernel boots perfectly with
the acpi module loaded.

Good, many thanks for testing.
IMHO, we can use this hack for current kernel.

It remains to investigate what is the real problem

a) loader expects VirtAddr/PhysAddr be the same as Offset
b) start of the RW segment have to be page aligned
c) something in acpi.ko needs bigger alignment than default "4"

It might be specific for acpi.ko or general module problem.

We could play with linker script, like change

  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .)  & (CONSTANT (MAXPAGESIZE) - 1));
  . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));

into

  . = ALIGN (CONSTANT (MAXPAGESIZE));
  . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));

and use private linker script for modules or enhance loader/grub2
or use private linker script and merge "R E" segment with "RW " segment
into one "RWE" segment.

I do not have native kfreebsd-i386, my k-i is QEMU,
only my k-a is real one ;-), (un)fortunately it doesn't fail in QEMU.

Petr


Reply to: