aboutsummaryrefslogtreecommitdiff
path: root/external/mambo
AgeCommit message (Collapse)AuthorFilesLines
2019-07-26SPDX-ify all skiboot codeStewart Smith5-16/+16
Use Software Package Data Exchange (SPDX) to indicate license for each file that is unique to skiboot. At the same time, ensure the (C) who and years are correct. See https://spdx.org/ Signed-off-by: Stewart Smith <stewart@linux.ibm.com> [oliver: Added a few missing files] Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-06-27external/mambo: Bump default POWER9 to Nimbus DD2.3Nicholas Piggin1-2/+2
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-06-13external/mambo: fix tcl startup code for mambo bogus net (repost)Aaron Sawdey1-4/+6
Repost of the same thing with Signed-off-by, and Acked-by from Michael Neuling. This fixes a couple issues with external/mambo/skiboot.tcl so I can use the mambo bogus net. * newer distros (ubuntu 18.04) allow tap device to have a user specified name instead of just tapN so we need to pass in a name not a number. * need some kind of default for net_mac, and need the mconfig for it to be set from an env var. Thanks, Aaron Acked-by: Michael Neuling <mikey at neuling.org> Signed-off-by: Aaron Sawdey <sawdey at linux.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-05-20skiboot.tcl: Add option to wait for GDB server connectionAlistair Popple1-0/+4
Add an environment variable which makes Mambo wait for a connection from gdb prior to starting simulation. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-05-15mambo: Integrate addr2line into backtrace commandMichael Neuling1-3/+6
Gives nice output like this: systemsim % bt pc: 0xC0000000002BF3D4 _savegpr0_28+0x0 lr: 0xC00000000004E0F4 opal_call+0x10 stack:0x000000000041FAE0 0xC00000000004F054 opal_check_token+0x20 stack:0x000000000041FB50 0xC0000000000500CC __opal_flush_console+0x88 stack:0x000000000041FBD0 0xC000000000050BF8 opal_flush_console+0x24 stack:0x000000000041FC00 0xC0000000001F9510 udbg_opal_putc+0x88 stack:0x000000000041FC40 0xC000000000020E78 udbg_write+0x7c stack:0x000000000041FC80 0xC0000000000B1C44 console_unlock+0x47c stack:0x000000000041FD80 0xC0000000000B2424 register_console+0x320 stack:0x000000000041FE10 0xC0000000003A5328 register_early_udbg_console+0x98 stack:0x000000000041FE80 0xC0000000003A4F14 setup_arch+0x68 stack:0x000000000041FEF0 0xC0000000003A0880 start_kernel+0x74 stack:0x000000000041FF90 0xC00000000000AC60 start_here_common+0x1c Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-05-15mambo: Add addr2func for symbol resolutionMichael Neuling2-2/+62
If you supply a VMLINUX_MAP/SKIBOOT_MAP/USER_MAP addr2func can guess at your symbol name. ie systemsim % p pc 0xC0000000002A68F8 systemsim % addr2func [p pc] fdt_offset_ptr+0x78 Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-05-15external/mambo: Add an option to exit Mambo when the system is shutdownAlistair Popple2-0/+9
Automatically exiting can be convenient for scripting. Will also exit due to a HW crash (eg. unhandled exception). Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> [stewart: handle case where SKIBOOT_AUTORUN is not set] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-04-17external/mambo: also invoke readline for the non-autorun caseNicholas Piggin1-0/+2
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-04-09README: Reflect openpower_mambo_defconfig name changeReza Arbab1-1/+1
The name of this op-build config has changed. Use the new name. Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-03-28external/mambo: Mambo hack to add trace-imc nodes in the device-treeAnju T Sudhakar1-0/+21
Update skiboot.tcl device tree to include trace-imc node to help test the code path in mambo. Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-03-28external/mambo: Error out if kernel is too largeRussell Currey1-0/+4
If you're trying to boot a gigantic kernel in mambo (which you can reproduce by building a kernel with CONFIG_MODULES=n) you'll get misleading errors like: WARNING: 0: (0): [0:0]: Invalid/unsupported instr 0x00000000[INVALID] WARNING: 0: (0): PC(EA): 0x0000000030000010 PC(RA):0x0000000030000010 MSR: 0x9000000000000000 LR: 0x0000000000000000 WARNING: 0: (0): numInstructions = 0 WARNING: 1: (1): [0:0]: Invalid/unsupported instr 0x00000000[INVALID] WARNING: 1: (1): PC(EA): 0x0000000000000E40 PC(RA):0x0000000000000E40 MSR: 0x9000000000000000 LR: 0x0000000000000000 WARNING: 1: (1): numInstructions = 1 WARNING: 1: (1): Interrupt to 0x0000000000000E40 from 0x0000000000000E40 INFO: 1: (2): ** Execution stopped: Continuous Interrupt, Instruction caused exception, ** So add an error to skiboot.tcl to warn the user before this happens. Making PAYLOAD_ADDR further back is one way to do this but if there's a less gross way to generally work around this very niche problem, I can suggest that instead. Signed-off-by: Russell Currey <ruscur@russell.cc> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-03-28external/mambo: Populate kernel-base-address in the DTRussell Currey1-1/+4
skiboot.tcl defines PAYLOAD_ADDR as 0x20000000, which is the default in skiboot. This is also the default in skiboot unless kernel-base-address is set in the device tree. If you change PAYLOAD_ADDR to something else for mambo, skiboot won't see it because it doesn't set that DT property, so fix it so that it does. Signed-off-by: Russell Currey <ruscur@russell.cc> Acked-by: Michael Neuling <mikey@neuling.org> [stewart: fix up mambo hacks for STB] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-02-12external/mambo: allow CPU targeting for most debug utilsNicholas Piggin1-97/+229
Debug util functions target CPU 0:0:0 by default Some can be overidden explicitly per invocation, and others can't at all. Even for those that can be overidden, it is a pain to type them out when you're debugging a particular thread. Provide a new 'target' function that allows the default CPU target to be changed. Wire that up that default to all other utils. Provide a new 'S' step command which only steps the target CPU. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-23external/mambo: Check for qtrace_utils.tcl before sourcing itMadhavan Srinivasan1-1/+3
Commit cb835dbdf875 ('external/mambo: conditionally source qtrace script') added qtrace_utils.tcl sourcing in skiboot.tcl without a check to see whether it exists in the current directory. This broke running mambo from another directory using skiboot.tcl. Patch adds a check. Fixes: cb835dbdf875 ('external/mambo: conditionally source qtrace script') Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-09-20mambo: Merge PMEM_DISK and PMEM_VOLATILE codeMichael Neuling1-46/+31
PMEM_VOLATILE and PMEM_DISK can't be used together and are basically copies of the same code. This merges the two and allows them used together. Same API is kept. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-08-15don't fail fatally if qtrace can't be loadedStewart Smith1-1/+3
Helps with p9 public mambo on fedora at least Fixes: cb835dbdf8758b1fb0cae0ef2f93b324d1c4c96e Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-08-13external/mambo: conditionally source qtrace scriptNicholas Piggin2-7/+10
This automatically gives qtrace commads if the simulator provides the capability. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-06-27pmem: volatile bindings for the poorly enabledBalbir singh1-0/+26
PMEM_DISK bindings were added, but they rely on a rather recent mmap feature. This patch steals from those bindings to add volatile bindings. I've used these bindings with PMEM_VOLATILE to launch an instance with the publicly available systemsim-p9. The bindings are volatile and one should not expect any data to be saved/retrieved. Signed-off-by: Balbir singh <bsingharora@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-05-24external/mambo: Add support for readline if it existsBalbir Singh1-1/+14
Add support for tclreadline package if it is present. This patch loads the package and uses it when the simulation stops for any reason. Signed-off-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-05-09mambo: Enable XER CA32 and OV32 bits on P9Anton Blanchard1-1/+1
POWER9 adds 32 bit carry and overflow bits to the XER, but we need to set the relevant CTRL1 bit to enable them. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-05-02external/mambo: simplify implementation of diBalbir singh1-9/+3
We've got a great disassembly function built-in, reuse that to implement di (as in xmon). Improves 1bcd6d84: (external/mambo: Add di command to decode instructions) Signed-off-by: Balbir singh <bsingharora@gmail.com> Acked-By: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-04-29mambo: Add persistent memory disk supportMichael Neuling1-0/+29
This adds support to for mapping disks images using persistent memory. Disks can be added by setting this ENV variable: PMEM_DISK="/mydisks/disk1.img,/mydisks/disk2.img" These will show up in Linux as /dev/pmem0 and /dev/pmem1. This uses a new feature in mambo "mysim memory mmap .." which is only available since mambo commit 0131f0fc08 (from 24/4/2018). This also needs the of_pmem.c driver in Linux which is only available since v4.17. It works with powernv_defconfig + CONFIG_OF_PMEM. ie --- a/arch/powerpc/configs/powernv_defconfig +++ b/arch/powerpc/configs/powernv_defconfig @@ -238,6 +238,8 @@ CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_GENERIC=y CONFIG_VIRTIO_PCI=m CONFIG_VIRTIO_BALLOON=m +CONFIG_LIBNVDIMM=y +# CONFIG_ND_BLK is not set CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-04-24external/mambo: Add di command to decode instructionsMichael Neuling1-0/+11
By default you get 16 instructions but you can specify the number you want. ie systemsim % di 0x100 4 0x0000000000000100: Enc:0xA64BB17D : mtspr HSPRG1,r13 0x0000000000000104: Enc:0xA64AB07D : mfspr r13,HSPRG0 0x0000000000000108: Enc:0xF0092DF9 : std r9,0x9F0(r13) 0x000000000000010C: Enc:0xA6E2207D : mfspr r9,PPR Using di since it's what xmon uses. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-04-19mambo/mambo_utils.tcl: Inject an MCE at a specified addressBalbir Singh1-1/+15
Currently we don't support injecting an MCE on a specific address. This is useful for testing functionality like memcpy_mcsafe() (see https://patchwork.ozlabs.org/cover/893339/) The core of the functionality is a routine called inject_mce_ue_on_addr, which takes an addr argument and injects an MCE (load/store with UE) when the specified address is accessed by code. This functionality can easily be enhanced to cover instruction UE's as well. A sample use case to create an MCE on stack access would be set addr [mysim display gpr 1] inject_mce_ue_on_addr $addr This would cause an mce on any r1 or r1 based access Signed-off-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-04-19external/mambo: improve helper for machine checksNicholas Piggin1-9/+53
Improve workarounds for stop injection, because mambo often will trigger on 0x104/204 when injecting sreset/mces. This also adds a workaround to skip injecting on reservations to avoid infinite loops when doing inject_mce_step. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Acked-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-02-28mambo: Add fw-feature flags for security related settingsMichael Ellerman1-1/+22
Newer firmwares report some feature flags related to security settings via HDAT. On real hardware skiboot translates these into device tree properties. For testing purposes just create the properties manually in the tcl. These values don't exactly match any actual chip revision, but the code should not rely on any exact set of values anyway. We just define the most interesting flags, that if toggled to "disable" will change Linux behaviour. You can see the actual values in the hostboot source in src/usr/hdat/hdatiplparms.H. Also add an environment variable for easily toggling the top-level "security on" setting. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-12-20Mambo: run hello_world and sreset_world tests with Secure and Trusted BootStewart Smith1-1/+1
We *disable* the secure boot part, but we keep the verified boot part as we don't currently have container verification code for Mambo. We can run a small part of the code currently though. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-11-30mambo: Add support for NUMAMichael Ellerman1-0/+25
Currently the mambo scripts can do multiple chips, but only the first ever has memory. This patch adds support for having memory on each chip, with each appearing as a separate NUMA node. Each node gets MEM_SIZE worth of memory. It's opt-in, via export MAMBO_NUMA=1. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-11-29mambo: split qtrace macros out into qtrace_utils.tclStewart Smith2-11/+10
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-11-28external/mambo: Switch qtrace command to use pluginsNicholas Piggin1-26/+7
The plugin seems to be the preferred way to do this now, it works better, and the qtracer emitter seems to generate invalid traces in new mambo versions. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-09-12skiboot/skiboot.tcl: Add imc device nodes to skiboot.tclMadhavan Srinivasan1-0/+82
Add In-Memory Collection counter dummy nodes to the skiboot.tcl to aid code testing in mambo for both OPAL and Kernel side enablement. Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-09-04mambo: Add mambo socket programMichael Neuling2-0/+367
This adds a program that can be run inside a mambo simulator in linux userspace which enables TCP sockets to be proxied in and out of the simulator to the host. Unlike mambo bogusnet, it's requires no linux or skiboot specific drivers/infrastructure to run. eg. Run inside the simulator: - to forward host ssh connections to sim ssh server ./mambo-socket-proxy -h 10022 -s 22 Then connect to port 10022 on your host ssh -p 10022 localhost - to allow http proxy access from inside the sim to local http proxy ./mambo-socket-proxy -b proxy.mynetwork -h 3128 -s 3128 Multiple connections are supported. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-19mambo: Update P9 PVR to reflect Scale out 24 core chipsMichael Neuling1-2/+2
The P9 PVR bits 48:51 don't indicate a revision but instead different configurations. From BookIV we have: Bits: Configuration 0: Scale out 12 cores 1: Scale out 24 cores 2: Scale up 12 cores 3: Scale up 24 cores Skiboot will mostly the use "Scale out 24 core" configuration (ie. SMT4 not SMT8) so reflect this in mambo. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-14mambo: Create multiple chips when we have multiple CPUsMichael Ellerman1-1/+11
Currently when we boot mambo with multiple CPUs, we create multiple CPU nodes in the device tree, and each claims to be on a separate chip. However we don't create multiple xscom nodes, which means skiboot only knows about a single chip, and all CPUs end up on it. At the moment mambo is not able to create multiple xscom controllers. We can create fake ones, just by faking the device tree up, but that seems uglier than this solution. So create a mambo-chip for each CPU other than 0, to tell skiboot we want a separate chip created. This then enables Linux to see multiple chips: smp: Brought up 2 nodes, 2 CPUs numa: Node 0 CPUs: 0 numa: Node 1 CPUs: 1 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-08mambo: fix cpio/initramfs reservationStewart Smith1-0/+1
We didn't init cpio_size in the no cpio case. Fixes: 52aed80bddd5eed94c537f2bb0b846e4b5683728 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-08mambo: Add a reservation for the initramfsOliver O'Halloran1-0/+5
On most systems the initramfs is loaded inside the part of memory reserved for the OS [0x0-0x30000000] and skiboot will never touch it. On mambo it's loaded at 0x80000000 and if you're unlucky skiboot can allocate over the top of it and corrupt the initramfs blob. There might be the downside that the kernel cannot re-use the initramfs memory since it's marked as reserved, but the kernel might also free it anyway. Fixes: 65612f120735 Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Tested-by: Michael Ellerman <mpe@ellerman.id.au> [stewart@linux.vnet.ibm.com: add Fixes] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-06mambo: Match whole string when looking up symbols with linsym/skisymMichael Ellerman1-2/+2
linsym/skisym use a regex to match the symbol name, and accepts a partial match against the entry in the symbol map, which can lead to somewhat confusing results, eg: systemsim % linsym early_setup 0xc000000000027890 systemsim % linsym early_setup$ 0xc000000000aa8054 systemsim % linsym early_setup_secondary 0xc000000000027890 I don't think that's the behaviour we want, so append a $ to the name so that the symbol has to match against the whole entry, eg: systemsim % linsym early_setup 0xc000000000aa8054 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Tested-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-31mambo: Allow loading multiple CPIOsMichael Ellerman1-4/+10
Currently we have support for loading a single CPIO and telling Linux to use it as the initrd. But the Linux code actually supports having multiple CPIOs contiguously in memory, between initrd-start and end, and will unpack them all in order. That is a really nice feature as it means you can have a base CPIO with your root filesystem, and then tack on others as you need for various tests etc. So expand the logic to handle SKIBOOT_INITRD, and treat it as a comma separated list of CPIOs to load. I chose comma as it's fairly rare in filenames, but we could make it space, colon, whatever. Or we could add a new environment variable entirely. The code also supports trimming whitespace from the values, so you can have "cpio1, cpio2". Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-19mambo: Add skiboot/linux symbol lookupOliver O'Halloran2-0/+50
Adds the skisym and linsym commands which can be used to find the address of a Linux or Skiboot symbol. To function this requires the user to provide the SKIBOOT_MAP and VMLINUX_MAP environmental variables which indicate which skiboot.map and System.map files should be used. Examples: Look up a symbol address: systemsim % skisym .load_and_boot_kernel 0x0000000030013a08 Set a breakpoint there: systemsim % b [skisym .load_and_boot_kernel] breakpoint set at [0:0]: 0x0000000030013a08 (0x0000000030013A08) Enc:0x7D800026 : mfcr r12 Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-03mambo: Fix reserved-ranges nodeOliver O'Halloran1-0/+4
The DT bindings for the /reserved-memory node requires that it: a) Has #size-cells equal to the root b) Has #address-cells equal to the root c) Has an empty ranges property (i.e directly maps on the root) Currently we do not assign any of these when generating the Mambo device tree which causes the booted kernel to ignore the reservations in the /reserved-memory node. Fixes: b7b5302af737 Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-01external/mambo: add helper for machine checksNicholas Piggin1-3/+187
Add helpers to construct machine checks with registers set up properly. exc_mce raises a machine check exception that can be stepped into. This is useful for testing the machine check handler. Also add a similar exc_sreset for system reset. inject_mce does the same but runs immediately and stops when the instruction reaches the NIP (which can get tangled up if machine check re-enters this code). This is useful for testing robustness to interleaving machine checks. inject_mce_step allows injecting MCEs between each instruction and stepping over them. inject_mce_step_ri does the same but only when MSR has RI set. This can be useful to test correctness of low level code. For example, testing system call vs machine check: systemsim % b 0xC000000000004c00 systemsim % c 0xC000000000004C00 (0x0000000000004C00) Enc:0xA64BB17D : mtspr HSPRG1,r13 systemsim % inject_mce_step_ri 100 0xC000000000004C04 (0x0000000000004C04) Enc:0xA64AB07D : mfspr r13,HSPRG0 0xC000000000004C08 (0x0000000000004C08) Enc:0x80002DF9 : std r9,0x80(r13) 0xC000000000004C0C (0x0000000000004C0C) Enc:0xA6E2207D : mfspr r9,PPR 0xC000000000004C10 (0x0000000000004C10) Enc:0x7813427C : mr r2,r2 0xC000000000004C14 (0x0000000000004C14) Enc:0x88004DF9 : std r10,0x88(r13) 0xC000000000004C18 (0x0000000000004C18) Enc:0xD8002DF9 : std r9,0xD8(r13) 0xC000000000004C1C (0x0000000000004C1C) Enc:0x2600207D : mfcr r9 0xC000000000004C20 (0x0000000000004C20) Enc:0xE8074D89 : lbz r10,0x7E8(r13) 0xC000000000004C24 (0x0000000000004C24) Enc:0x00000A2C : cmpwi cr0,r10,0 0xC000000000004C28 (0x0000000000004C28) Enc:0xA80F8240 : bne cr0,$+0xFA8 (bc 0x4,0x2,0xFA8,0,0) 0xC000000000004C2C (0x0000000000004C2C) Enc:0xA64AB17D : mfspr r13,HSPRG1 0xC000000000004C30 (0x0000000000004C30) Enc:0xBE1E202C : cmpdi cr0,r0,7870 0xC000000000004C34 (0x0000000000004C34) Enc:0x2000C241 : beq cr0,$+0x20 (bc 0xE,0x2,0x20,0,0) 0xC000000000004C38 (0x0000000000004C38) Enc:0x786BA97D : mr r9,r13 0xC000000000004C3C (0x0000000000004C3C) Enc:0xA64AB07D : mfspr r13,HSPRG0 0xC000000000004C40 (0x0000000000004C40) Enc:0xA6027A7D : mfspr r11,SRR0 0xC000000000004C44 (0x0000000000004C44) Enc:0xA6029B7D : mfspr r12,SRR1 0xC000000000004C48 (0x0000000000004C48) Enc:0x02004039 : li r10,2 0xC000000000004C4C (0x0000000000004C4C) Enc:0x6401417D : mtmsrd r10,1 0xC000000000004C50 (0x0000000000004C50) Enc:0xB0620048 : b $+0x62B0 236380163: (212143620): Disabling lock debugging due to kernel taint 0xC000000000004C50 (0x0000000000004C50) Enc:0xB0620048 : b $+0x62B0 0xC00000000000AF00 (0x000000000000AF00) Enc:0xE1F78A79 : rldicl. r10,r12,30,63,63 (0x0000000000000001) 0xC00000000000AF00 (0x000000000000AF00) Enc:0xE1F78A79 : rldicl. r10,r12,30,63,63 (0x0000000000000001) [...] Every instruction after 0xC000000000004C4C is getting an interleaving MCE, and continuing after this injection the kernel prints a lot of MCE reports and continues working properly. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Tested-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-04-07mambo: Allow setting the Linux command line from the environmentMichael Ellerman1-1/+5
For automated testing it's helpful to be able to set the Linux command line via an environment variable. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-04-07mambo: Add util function for breaking on console outputMichael Ellerman1-0/+14
Mambo can execute a trigger when certain output appears on the console. You can run any tcl function when the trigger fires, but the simplest thing to use it for is stopping the simulation. Add a helper to do that, break_on_console(), and a matching function to clear the trigger, clear_console_break(). Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-03-24mambo: No need to explicitly look for env(SKIBOOT)Michael Ellerman1-3/+0
We don't need to explicitly check for the SKIBOOT environment variable, the existing code that does: mconfig boot_image SKIBOOT ../../skiboot.lid Will do that for us, using the content of SKIBOOT if it's set, otherwise falling back to ../../skiboot.lid. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-02-22external/mambo: add device tree fixup for POWER9 stop levelsNicholas Piggin1-0/+7
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-12-23mambo_utils: add ascii output to hexdumpOliver O'Halloran1-1/+12
Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-12-23mambo_utils: add p_str <addr> [limit]Oliver O'Halloran1-0/+19
Adds a helper function to mambo_utils.tcl that prints the NUL terminated string at <addr>, and optionally limits the output to a fixed number of characters. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-12-23mambo_utils: make p return a valueOliver O'Halloran1-5/+2
Currently the "p" command uses puts to output the result to the user. This works for interactive usage, but it makes it impossible for use inside scripts. This patch changes the function to return the value rather than print it. The mambo interpreter prints the result of an expression so this should not cause any user visible changes. With this change you can use p in expressions: x [p r3] 4 Which will display the word at the address in r3. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-12-13mambo: fake NVRAM supportChris Smart1-1/+21
This re-configures the Mambo platform to use the new fake NVRAM introduced by Jack Miller <jack@codezen.org> in commit: mambo: Add Fake NVRAM driver An existing NVRAM file can be loaded by pointing SKIBOOT_NVRAM environment variable to the file when running Mambo. If no NVRAM file is provided, the default is set to 256Kb and will be formatted automatically by Skiboot on boot, e.g.: [ 0.000975501,5 ] NVRAM: Size is 256 KB [ 0.002292860,3 ] NVRAM: Partition at offset 0x0 has incorrect 0 length [ 0.002298792,3 ] NVRAM: Re-initializing (size: 0x00040000) This has been tested in Mambo, on bare metal Linux, as well as OpenPower BMC machines. Signed-off-by: Chris Smart <chris@distroguy.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-24external/mambo: add shortcut to print all GPRsOliver O'Halloran1-0/+4
The 'p' function added by mambo utils can be used to print registers (GPR or SPR) from a thread. Mambo supports printing all the GPRs in one go so this plumbs it into the 'p' function. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>