Age | Commit message (Collapse) | Author | Files | Lines |
|
Commit '6b08928d - build/lds: place debug sections according to
defaults' introduced a DEBUG_SECTIONS macro that is effectivelly
resetting the location pointer back to zero, making the next section
(builtin_kernel) collide with the earlier sections.
Fix by moving these sections to the very end.
Error message:
$ make KERNEL=zImage.epapr
[CC] asm/asm-offsets.s
[GN] include/asm-offsets.h
<...>
[LD] skiboot.tmp.elf
ld: section .builtin_kernel LMA [0000000000000000,0000000000285d87]
overlaps section .head LMA [0000000000000000,0000000000003897]
ld: section .naca LMA [0000000000004000,000000000000505f] overlaps
section .builtin_kernel LMA [0000000000000000,0000000000285d87]
make: *** [/skiboot/Makefile.main:333: skiboot.tmp.elf] Error 1
Fixes: 6b08928d - build/lds: place debug sections according to defaults
Signed-off-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
|
|
Witht addition of libtss and mbedtls the .data section now overlaps the
start of the .bss section. Adding a few MB to the offset doesn't hurt.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
|
|
Separate code, data, read-only data, and other significant sections
with PAGE_SIZE alignment. This enables memory protection for these
sections with a later patch.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
|
|
skiboot is static so these are always empty.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
|
|
SPDX makes it a simpler diff.
I have audited the commit history of each file to ensure that they are
exclusively authored by IBM and thus we have the right to relicense.
The motivation behind this is twofold:
1) We want to enable experiments with coreboot, which is GPLv2 licensed
2) An upcoming firmware component wants to incorporate code from skiboot
and code from the Linux kernel, which is GPLv2 licensed.
I have gone through the IBM internal way of gaining approval for this.
The following files are not exclusively authored by IBM, so are *not*
included in this update (I will be seeking approval from contributors):
core/direct-controls.c
core/flash.c
core/pcie-slot.c
external/common/arch_flash_unknown.c
external/common/rules.mk
external/gard/Makefile
external/gard/rules.mk
external/opal-prd/Makefile
external/pflash/Makefile
external/xscom-utils/Makefile
hdata/vpd.c
hw/dts.c
hw/ipmi/ipmi-watchdog.c
hw/phb4.c
include/cpu.h
include/phb4.h
include/platform.h
libflash/libffs.c
libstb/mbedtls/sha512.c
libstb/mbedtls/sha512.h
platforms/astbmc/barreleye.c
platforms/astbmc/garrison.c
platforms/astbmc/mihawk.c
platforms/astbmc/nicole.c
platforms/astbmc/p8dnu.c
platforms/astbmc/p8dtu.c
platforms/astbmc/p9dsu.c
platforms/astbmc/vesnin.c
platforms/rhesus/ec/config.h
platforms/rhesus/ec/gpio.h
platforms/rhesus/gpio.c
platforms/rhesus/rhesus.c
platforms/astbmc/talos.c
platforms/astbmc/romulus.c
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
[oliver: fixed up the drift]
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
|
|
This results in the same layout and location of the naca and hv data
structures.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
|
|
BUILD_ASSERT can not be used for constants generated by the assembler
or linker. This results in variable length arrays that do not catch
the failure condition. This was caught by sparse.
Remove these and add some equivalent as/ld checks which actually do
the right thing.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
|
|
Right now the romem checksum runs from _start until the start of our
data area. This spans the area used for the MPIPL data structures since
they're included in the SPIRA-H data area.
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
|
|
Using traps for assertions like Linux does gives a few advantages:
- The asm code leading to the failure condition is nicer.
- The interrupt gives a clean snapshot of machine state to dump.
The difficulty with using traps for this in OPAL is that the runtime
component will not deal well with the OS taking the 0x700 interrupt
caused by a trap in OPAL.
The long term goal is to improve the ability of the OS to inspect and
debug OPAL at runtime. For now though, the traps are patched out before
passing control to the OS, and the assert falls through to in-line
failure handling.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[oliver: commit prefix, added and renamed the FWTS label, fix tests]
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
|
|
- Split SPIRAH memory to accommodate architected register ntuple.
Today we have 1K memory for SPIRAH and it uses 288 bytes. Lets split
this into two parts :
SPIRAH (756 bytes)
architected register memory (256 bytes)
- Update SPIRAH architected register ntuple
- Calculate memory required to capture architected registers data
Ideally we should use HDAT provided data (proc_dump_area->thread_size).
But we are not getting this data during boot. Hence lets reserve fixed
memory for architected registers data collection.
- Add architected registers destination memory to reserve-memory DT node.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
[oliver: rebased]
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
|
|
Each entry in MDST and MDDT takes 16 bytes. With 1K we can have upto 64
entries. This is sufficient to support OPAL MPIPL (memory preserving IPL).
Presently OPAL reserves 2K memory for MDST table. Lets split this into two
region of 1K for MDST and MDDT table.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
[oliver: rebased]
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
|
|
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>
|
|
So we need to change our heap size to make more room for data/bss
without having to change where the console is or have more fun moving
things about.
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
Produced in a SKIBOOT_GCOV=1 build, and never called by skiboot.
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
We want to be able to mmap the trace buffers to be used by the
dump_trace tool. This means that the trace bufferes must be page
aligned. Currently they are aligned to 4K. Most power systems have a
64K page size. On systems with a 4K page size, 64K aligned will still be
page aligned. Change the allocation of the trace buffers to be 64K
aligned.
The trace_info struct that contains the trace buffer is actually what is
allocated aligned memory. This means the trace buffer itself is not
actually aligned and this is the address that is currently exposed
through sysfs. To get around this change the address that is exposed to
sysfs to be the trace_info struct. This means the lock in trace_info is
now visible too.
Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
Place remaining orphan linker sections according to default script
as described by `ld --verbose`.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
Place debug orphan linker sections according to default script
as described by `ld --verbose`.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
skiboot does not use unwind tables, this option saves about 100kB,
mostly from .text.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
It seems that newer toolchains get us multiple ctors sections to link in
rather than just one. If we discard them (as we were doing), then we
don't have a working gcov build (and we get the "doesn't look sane"
warning on boot).
So, include ctors* and all is well.
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
This also tidies up linker script symbol declarations and adds
_rodata_mem symbol for the next change to use.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
|
|
Fixes GCOV builds with gcc7, which uses this.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
GCOV enabled builds with modern GCC are getting bigger.
At some point we're going to have to go do something sensible,
but even on our larger systems we're not *that* close to running
out of heap that this would be a problem.
HEAP is now 12MB rather than 13MB.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Add an experimental option to do basic dead code and data elimintation
with -ffunction-sections/-fdata-sections/--gc-sections.
This saves about 80kB of text/data.
Also remove the use of of -ffunction-sections by default. This predates
git history, but I don't think there is a good reason to use it without
--gc-sections. The GCC manual says:
Only use these options when there are significant benefits from
doing so. When you specify these options, the assembler and linker
create larger object and executable files and are also slower. You
cannot use gprof on all systems if you specify this option, and you
may have problems with debugging if you specify both this option
and -g.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Previous patch reduced reserved space in spira structure. Now its safe
to reduce the memory for spira section from 2K to 1K. Create separate
memory section with 1K size for SPIRA-H.
Also initialize SPIRA-H. FSP makes use of this information to pass various
boot time data (like SPIRA-S, etc) to host.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Anton sent a similar patch to Linus, here is his comment:
<<
Recent toolchains force the TOC to be 256 byte aligned. We need
to enforce this alignment in our linker script, otherwise pointers
to our TOC variables (...) could be incorrect.
>>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
As part of setting up GCOV data structures correctly, GCC/GCOV generates
a bunch of constructor routines that the C runtime is expected to run
really early on.
skiboot was not running GCC generated constructors. Luckily, it's really
easy to do so.
This patch will run GCC constructors very early on during boot (if there
are any)
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
When built with gcov, skiboot is >1MB (closer to 1.5MB) and there
were a few assumptions about skiboot being <1MB.
The biggest one was that when code got larger, we'd have the sbss section
start in the middle of code, so that when we were going to relocate ourselves,
we'd only get the first 1MB of skiboot relocated, which excluded the
_DYNAMIC section, meaning that relocate() would not find the right
sections.
We also needed to not start writing over random parts of skiboot.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We use a double link technique, doing a first pass with a .o containing
a dummy symbol map, then re-linking with a new .o
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Separate text translation from capture of the backtrace
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
At present CPU control area ntuple in SPIRA structure is NULL.
ATTN component in Service Processor side checks for this field and if its empty,
it logs hardcoded SRC (0xBB821410) and generates SYSDUMP. So we have 1 SRC for
all failure (assert call) from OPAL side. This makes difficult to debug the issue.
Service processor provides attention area interface (FIPS PHyp Attentions spec),
so that we can pass SRC and user data (error message) to service processor.
This will helps us identify different failures in OPAL.
This patch enables attention area and provides interface (update_sp_attn_area())
to add src and user data (error message) through assert macro.
Attention SRC format:
1st byte - Opal src type
2-4 bytes - Holds the address of the assert function call
Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|