Age | Commit message (Collapse) | Author | Files | Lines |
|
New code that is very much pflash functionality was added in commit
f2c87a3d2f6 "pflash option to retrieve PNOR partition flags".
Unfortunately at the time there wasn't an easy way to test pflash.
The previous patch adds pflash infrastructure and plumbs it into
`make check` nicely. This commit converts the tests originally added to
libflash tests.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The reason for this is that check targets for one tool will start to
depend on other tools. For example, future pflash tests will rely on
ffspart to generate pnors. The current method is too racey and results
in races cleaning/building ffspart for its tests and for pflash tests.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Recent work did some optimising which unfortunately removed some of the
progress bars in pflash.
It turns out that there's only one thing people prefer to correctly
programmed flash chips, it is the ability to watch little equals
characters go across their screens for potentially minutes.
Personally I don't understand the appeal but I have received strongly
worded requests for the reinstatement of the progress bars in pflash and
I fear for the stability of our society if pflash doesn't promptly regain
its most unimportant feature.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Using exit() all over the place has lead to a huge mess of leaving all
sorts of dangling references to malloc()ed memory, to blocklevel_devices
and even sometimes file descriptors.
Stop using exit() and simply report everything back to the main where
everything can be freed on the way back out.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Very simple rework, makes sense to calculate those at the same time.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
It doesn't make sense for --tune to do anything unless --direct was
passed.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Currently all the flash details including the pointer to the
blocklevel_device to access the flash is global. This is annoying since
it makes it hard to know when it was allocated, some of the code just
changes it which makes tracking difficult.
Rather than have it globally accessible, pass it around as a structure
so better control who modifies it and where and when.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
pflash should check the alignment of addresses and sizes when asked to
erase. There are two possibilities:
1. The user has specified sizes manually in which case pflash should
be as flexible as possible, blocklevel_smart_erase() permits this. To
prevent possible mistakes pflash will require --force to perform a
manual erase of unaligned sizes.
2. The user used -P to specify a partition, partitions aren't
necessarily erase granule aligned anymore, blocklevel_smart_erase() can
handle. In this it doesn't make sense to warn/error about misalignment
since the misalignment is inherent to the FFS partition and not really
user input.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Also add 0x in front of --info output to avoid a copy and paste mistake.
Reported-by: Michael Neuling <mikey@neuling.org>
Suggested-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Recent reworks of pflash expose more partition flags, the --info command
only prints them in their one character short names.
It isn't obvious what they all are, add a little description
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Currently the FFS header/TOC generation code requires that consumers
know the size of their TOC beforehand. While this may be advantageous in
some circumstances if there are known limitations of other software. It
should not be a requirement.
Knowing the size of the FFS header/TOC partially breaks the abstraction
since it would require consumers of the library to be aware of/have some
idea of the on flash structure and size.
Future work may introduce functions to force sizes but the default
behaviour should be to calculate it behind the scenes.
This patch also addresses an off by one issue in checking for TOC
overflow.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Also add usage text to pflash.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Recent reworks were tested on the travis-ci system. Unfortunately, there
are configurations of running `make check` which the travis-ci doesn't
do. On some systems extra problems crop up.
Removing the stack size check is only done for the host compiler as the
check is only critical for skiboot its self where stack space is
contained.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We end up with a bit of a nasty hack to count the libflash symlinks
in gard and pflash as part of libflash code coverage, but it does
work and is unlikely to break anytime soon.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Reviewed-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Mostly unused parameter warnings due to callbacks
Reviewed-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This enables some extra linked list checking
Reviewed-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
mostly missing prototypes and unused parameters.
Reviewed-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This commit extends pflash with an option to retrieve and print
information for a particular partition, including the content from
"pflash -i" and a verbose list of set miscellaneous flags. -i option
is also updated to print a short list of flags in addition to the
ECC flag, with one character per flag. A test of the new option is
included in libflash/test.
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
Reviewed-by: Cyril Bur <cyril.bur@au1.ibm.com>
[stewart@linux.vnet.ibm.com: various test fixes, enable gcov]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
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>
|
|
This patch adds support to send SBE pass through command to HBRT.
HBRT interface details provided by Daniel M. Crowell (<dcrowell@us.ibm.com>).
CC: Daniel M Crowell <dcrowell@us.ibm.com>
CC: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We didn't init cpio_size in the no cpio case.
Fixes: 52aed80bddd5eed94c537f2bb0b846e4b5683728
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
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>
|
|
Your BMC needs a special debug image flashed to use this, the exact
image and methods aren't something I can publish here, but if you work
for IBM or SMC you can find out from the right sources.
A few things are needed to move around to be able to flash to a SMC BMC.
For a start, the SSH daemon will only accept connections after a special
incantation (which I also can't share), but you should put that in the
~/.skiboot_boot_tests file along with some other default login information
we don't publicise too broadly (because Security Through Obscurity is
*obviously* a good idea....)
We also can't just directly "ssh /bin/true", we need an expect script,
and we can't scp, but we can anonymous rsync!
You also need a pflash binary to copy over.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Reviewed-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This change provides the facility to invoke HBRT's reset_pm_complex, in
the same manner is done with process_occ_reset previously.
We add a control command for `opal-prd pm-complex reset`, which is just
an alias for occ_reset at this stage.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Tested-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This change adds the implementation of firmware_request() and
firmware_notify(). To do this, we need to add a message queue, so that
we can properly handle out-of-order messages coming from firmware.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
With the introductuion of the opaque firmware channel, we want to
support variable-sized messages. Rather than expecting to read an
entire 'struct opal_prd_msg' in one read() call, we can split this
over mutiple reads, potentially expanding our message buffer.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This change hooks-up the get_ipoll_mask callback, and use a
HBRT-provided mask if it's present.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Tested-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This change adds new callbacks defined for p9, and the base thunks for
the added calls.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
CC: Daniel M Crowell <dcrowell@us.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Interpret the (optional) *_MRK log prefixes on HBRT messages, and set
the syslog log priority to suit.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The `occ reset` and `occ error` actions can both take a chip id
argument, but we're currently just using zero. This change changes the
control message format to pass the chip ID from the control process to
the opal-prd daemon.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We'd like to add other type-specific fields, so introduce a union to
populate with these.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Increment once, rather than having to use 'optind + 1' on every
subsequent usage.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|