[coreboot] cbmem fails with `Failed to mmap /dev/mem: Resource temporarily unavailable` and code coverage enabled

Aaron Durbin adurbin at google.com
Mon Sep 28 16:38:06 CEST 2015


On Sun, Sep 27, 2015 at 2:54 PM, Paul Menzel
<paulepanter at users.sourceforge.net> wrote:
> Dear coreboot folks,
>
>
> building a coreboot image for the ASRock E350M1 with the attached
> config, having code coverage enabled, I am unable to run the utility
> `cbmem`.
>
> ```
> $ sudo util/cbmem/cbmem -V -l
> Looking for coreboot table at 0 1048576 bytes.
> Mapping 1MB of physical memory at 0x0 (requested 0x0).
> Found!
>   coreboot table entry 0x11
>     Found forwarding entry.
> Unmapping 1MB of virtual memory at 0xb74b6000.
> Looking for coreboot table at c7f9f000 1048576 bytes.
> Mapping 1MB of physical memory at 0xffffffffc7f9f000 (requested 0xc7f9f000).
>   ... failed.  Mapping 1052671B of physical memory at 0xffffffffc7f9e000.
> Failed to mmap /dev/mem: Resource temporarily unavailable
> ```
>
> Linux complains with the messages below.
>
> ```
> $ dmesg
> […]
> [  916.233910] x86/PAT: cbmem:2647 conflicting memory types c7f9f000-c809f000 uncached-minus<->write-back
> [  916.233927] x86/PAT: reserve_memtype failed [mem 0xc7f9f000-0xc809efff], track uncached-minus, req write-back
> […]
> ```
>

You are going to need to open the /dev/mem file w/ O_SYNC flags
because the kernel is marking that range of memory as uncacheable.
More info can be found here:
https://www.kernel.org/doc/Documentation/x86/pat.txt

# cat /sys/kernel/debug/x86/pat_memtype_list

would be helpful along  with this:

$ for i in /sys/firmware/memmap/*; do echo $(cat $i/type $i/start $i/end); done

>
> Thanks,
>
> Paul
>
>
> [1] http://review.coreboot.org/11729
> --
> coreboot mailing list: coreboot at coreboot.org
> http://www.coreboot.org/mailman/listinfo/coreboot



More information about the coreboot mailing list