[Skiboot] [PATCH] external/mambo: Disable MEMORY_OVERFLOW

Michael Ellerman mpe at ellerman.id.au
Thu Jun 25 21:56:55 AEST 2020

Mambo has a strange feature called MEMORY_OVERFLOW, enabled by
default, which causes some accesses to non-existent memory addresses
to transparently "create" memory.

This can be confusing when debugging, eg:

  systemsim % mysim cpu 0 display spr pc
  systemsim % mysim memory display 0xC0000000000246B8 8

Appears to show that the memory at pc (NIP) is currently zeroes.

The astute observer will note that "mysim memory display" takes
physical addresses, not effective addresses. So unless this machine
has > 12XB of RAM, this access should have failed as there is no
memory at that address.

Turning MEMORY_OVERFLOW off gives us a much more sensible result:

  systemsim % mysim memory display 0xC0000000000246B8 8
  Illegal Address 0xC0000000000246B8

It doesn't appear to have any effect on accesses done from Linux, with
the setting enabled or disabled we still get a machine check for bad
accesses in real mode:

  0:mon> p $__mmu_off
  return value is 0x9000000030001003
  0:mon> d c008000000000000
  c008000000000000 [15447.242793] Disabling lock debugging due to kernel taint
  [15447.242824] MCE: CPU0: machine check (Severe) Host Real address Load/Store (foreign) [Not recovered]
  [15447.242868] MCE: CPU0: NIP: [c000000000103090] mread+0x90/0x190
  [15447.242897] MCE: CPU0: Initiator CPU
  [15447.242918] MCE: CPU0: Hardware error
  [15447.242939] opal: Hardware platform error: Unrecoverable Machine Check exception
  [15447.242978] CPU: 0 PID: 18 Comm: kopald Tainted: G   M              5.7.0-gcc-8.2.0-13354-gd475a86526b5-dirty #127
  [15447.243022] NIP:  c000000000103090 LR: c000000000103034 CTR: c0000000000c2050
  [15447.243059] REGS: c0000000fffbfd70 TRAP: 0200   Tainted: G   M               (5.7.0-gcc-8.2.0-13354-gd475a86526b5-dirty)
  [15447.243101] MSR:  9000000000201003 <SF,HV,ME,RI,LE>  CR: 28002224  XER: 20040000
  [15447.243150] CFAR: c000000000029660 DAR: c008000000000000 DSISR: 00000008 IRQMASK: 3
  [15447.243150] GPR00: 0000000028002224 c0000000f05074c0 c000000001775e00 0000000000000000
  [15447.243150] GPR04: c0000000f0507768 0000000000000010 0000000000000010 c0000000f0507768
  [15447.243150] GPR08: 0007ffff0faf8899 0000000000000000 c0000000f0507767 9000000030001003
  [15447.243150] GPR12: 0000000031c10000 c000000001970000 c0000000f0507738 0000000000000000
  [15447.243150] GPR16: 000000000000002e 0000000000000010 000000000000002e 0000000000000010
  [15447.243150] GPR20: c000000000e563d0 c000000000ffcf88 c000000000fddf30 c008000000000000
  [15447.243150] GPR24: c0000000f0507767 c000000000ffc678 0000000000000040 c0000000f0507878
  [15447.243150] GPR28: c0000000f0507768 c0000000f0507768 0000000000000010 0000000000000000
  [15447.243485] NIP [c000000000103090] mread+0x90/0x190
  [15447.243514] LR [c000000000103034] mread+0x34/0x190
  [15447.243538] Call Trace:
  [15447.243559] [c0000000f05074c0] [c0000000f0507510] 0xc0000000f0507510 (unreliable)
  [15447.243602] [c0000000f0507510] [c000000000107b48] xmon_core+0xd18/0x3a10
  [15447.243640] [c0000000f0507850] [c00000000010a870] xmon+0x30/0x80
  [15447.243677] [c0000000f05079f0] [c0000000001050d4] sysrq_handle_xmon+0xc4/0xd0
  [15447.243720] [c0000000f0507a20] [c000000000882954] __handle_sysrq+0xd4/0x220
  [15447.243758] [c0000000f0507ac0] [c00000000089db68] __hvc_poll+0x268/0x4b0
  [15447.243796] [c0000000f0507b60] [c00000000089e824] hvc_handle_interrupt+0x24/0x70
  [15447.243838] [c0000000f0507b80] [c0000000001c2474] __handle_irq_event_percpu+0xb4/0x350
  [15447.243880] [c0000000f0507c50] [c0000000001c2754] handle_irq_event_percpu+0x44/0xc0
  [15447.243923] [c0000000f0507c90] [c0000000001c2844] handle_irq_event+0x74/0xc0
  [15447.243965] [c0000000f0507cc0] [c0000000001c9770] handle_level_irq+0xe0/0x1c0
  [15447.244006] [c0000000f0507cf0] [c0000000001c0a44] generic_handle_irq+0x54/0x80
  [15447.244046] [c0000000f0507d10] [c0000000000ca050] opal_handle_events+0x130/0x150
  [15447.244088] [c0000000f0507d60] [c0000000000c1e7c] kopald+0x9c/0x140
  [15447.244124] [c0000000f0507db0] [c00000000016ea9c] kthread+0x19c/0x1b0
  [15447.244161] [c0000000f0507e20] [c00000000000d1a8] ret_from_kernel_thread+0x5c/0x74

Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
 external/mambo/skiboot.tcl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl
index 6003fcbef..264846c22 100644
--- a/external/mambo/skiboot.tcl
+++ b/external/mambo/skiboot.tcl
@@ -122,6 +122,7 @@ myconf config processor/timebase_frequency 1/1
 myconf config enable_pseries_nvram false
 myconf config machine_option/NO_RAM TRUE
 myconf config machine_option/NO_ROM TRUE
+myconf config machine_option/MEMORY_OVERFLOW FALSE
 if { $default_config == "PEGASUS" } {
     # We need to be DD2 or greater on p8 for the HILE HID bit.

More information about the Skiboot mailing list