File: GENPAGE

package info (click to toggle)
mcelog 104-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 996 kB
  • ctags: 1,508
  • sloc: ansic: 7,739; sh: 481; makefile: 87
file content (24 lines) | stat: -rwxr-xr-x 869 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# GENMPAGE pfn socketid channel dimm corr-err-cnt
# generate a memory error on a page. All fields are optional.
# dimm/channel can be out of sync with the address
# XXX page max 44bit for now
# suitable to be fed into mce-inject or mcelog --ascii
# Note: DIMMs only work when mcelog is in Nehalem mode
# this cannot be forced through mce-inject, but only on the command line
page=${1:-$RANDOM}
socketid=${2:-0}
channel=${3:-0}
dimm=${4:-0}
corr_err_cnt=${5:-0}

printf "# memory error on page %08x000 socket $socketid ch $channel dimm $dimm \n" $page
echo "CPU 0 2" # XXX use cpu in socket
echo "# nehalem"
echo "PROCESSOR 0:0x106a0"
echo "SOCKETID $socketid"
printf "STATUS 0x%08x%08x\n" \
	$[0x88000000 + (1 << (58-32)) + ($corr_err_cnt << 6)] $[0xb0 + $channel]
printf "MISC 0x%08x\n" $[($channel << 18) + ($dimm << 16)]
printf "ADDR 0x%08x000\n" $page