Re: Reading /dev/mem by dd

From: Robert Hancock
Date: Wed Nov 11 2009 - 16:10:05 EST


On 11/11/2009 08:36 AM, Anton D. Kachalov wrote:
Hello everyone!

I've found strange behavior of reading /dev/mem:

for i in 0 1 2; do
echo $i
dd if=/dev/mem of=/dev/null skip=$((6+$i)) bs=$((0x20000000)) count=1
done

On some systems with Supermicro X8DTU I've got several messages during
first 512Mb starting from 0xc000_0000:

"BUG: soft lockup - CPU#xx stuck for 61s!"

On other systems with the sameboard I've stuck without any errors at
last 10Mb before 0x1_0000_0000. Local APIC access?

On E5440 (Dell PowerEdge 1950) I've just got several:
APIC error on CPU3: 00(80)
APIC error on CPU3: 80(80)
...
APIC error on CPU3: 80(80)
That looks like wrong register access.

I don't think that we prevent any access to device registers in /dev/mem - if you read something that has side effects and something breaks, well I guess you get to keep both pieces :-) There's a reason it's root-only..
--
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/