aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-09-12hw: Move lpc firmware space helpersChristophe Lombard6-126/+218
Add new lpc helpers for doing a bulk io to firmware space. Reviewed-by: Abhishek Singh Tomar <abhishek@linux.ibm.com> Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12pldm/ibm/libpldm: Import oem IBM libpldm libraryChristophe Lombard12-1/+2426
This library implements IBM OEM commands support for PLDM and specially encode and decode APIs for in-band readFile and writeFile commands. The source is located here: https://github.com/openbmc/pldm/tree/master/oem/ibm/libpldm and use as is, without any update. The oem IBM libpldm code is integrated into the folder ./pldm/ibm/libpldm as a set of sources, compilated if the compiler flag CONFIG_PLDM is set. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Acked-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12pldm/libpldm: Import libpldm library handling PLDM protocolChristophe Lombard25-1/+15676
Platform Level Data Model (PLDM) is a standard application layer communication protocol defined by the DMTF. PLDM is an effective data and control source. PLDM defines a method to provide efficient access to low-level platform inventory, monitoring, control, eventing, and data/parameters transfer functions such as temperature, fan, voltage, event logging, and boot control. PLDM has defined data representations and commands that abstract the platform management hardware. The library deals with the encoding and decoding of PLDM messages. The source is located here: https://github.com/openbmc/pldm/tree/master/libpldm and use as is, without any update. The libpldm code is integrated into the folder ./pldm/libpldm as a set of sources, compilated if the compiler flag CONFIG_PLDM is set. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Acked-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12libmctp: Import libmctp library handling MCTP protocolChristophe Lombard21-1/+3973
The Management Component Transport Protocol (MCTP) is a protocol defined by the DMTF Platform Management Component Intercommunications sub-team of the DMTF Pre-OS Workgroup. MCTP is designed to support communications between different intelligent hardware components that make up a platform management subsystem that is provides monitoring and control functions inside a managed system. DMTF standard "DSP2016" This library is intended to be a portable implementation of the Management Component Transport Protocol (MCTP), as defined by DMTF standard "DSP0236", plus transport binding specifications. MCTP has been designed to carry multiple types of manageability-related traffic across a common medium. The base MCTP specifications define message types for supporting the initialization and configuration of MCTP itself, and to support vendor-specific messages over MCTP. Other message types, such as message types to support a Platform Level Data Model (PLDM). The source is located here: https://github.com/openbmc/libmctp and use as is, without any update. The libmctp code is integrated into the folder ./libmctp as a set of sources, compiled if the compiler flag CONFIG_PLDM is set. A config file is required. Not being generated automatically by 'configure', it must be edited manually to match the environment. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Acked-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12pldm: Export logging featureChristophe Lombard2-1/+2
To retrieve specific log traces from the external library: libmctp, we need to export the logging api. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12include/asm: Create asm_byteorder.h header fileChristophe Lombard1-0/+10
This file is used by the external library: libpldm. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12include: Provide endian conversion functionsChristophe Lombard1-0/+24
Implement the BSD endian conversion functions in terms of the ccan ones since the external libraries: libpldm and libmctp use them heavily. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12include: Expand print conversion specificier macrosChristophe Lombard1-0/+6
Add PRIxu macros into include inttypes file. These macros are required by the external library: libmctp. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12libc: Add ENXIO error codeChristophe Lombard1-5/+7
Add ENXIO and EMSGSIZE error codes (No such device or address.) in skiboot libc. This error code are required by the external library: libmctp. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12libc: Expand limits.h and include in stdint.hChristophe Lombard2-0/+9
Add maximum native integer size and limits of specified-width integer types. These types are required by the external library: libpldm. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12skiboot v7.1 release notesv7.1Reza Arbab1-0/+13
Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Reviewed-by: Joel Stanley <joel@jms.id.au>
2023-08-09Makefile: Link final elf with --no-warn-rwx-segmentsJoel Stanley1-0/+2
No system loads skiboot as an ELF, so the segment information is not used. Avoids these warnings with binutils as of 2.39: powerpc64-linux-gnu-ld: warning: skiboot.tmp.elf has a LOAD segment with RWX permissions powerpc64-linux-gnu-ld: warning: skiboot.elf has a LOAD segment with RWX permissions Signed-off-by: Joel Stanley <joel@jms.id.au> [arbab: Use try-ldflag for builders with pre-2.39 binutils] Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-08-09pci: Remove MVE opal callsJoel Stanley6-133/+31
These callbacks were used by the p7ioc code that was removed a long time ago. Add them to the list of removed calls and delete the dead code. Linux has removed the code that called these functions in v6.5-rc1. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-07-12init: Add a newline to the LPAR-per-core warningJoel Stanley1-1/+1
Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-07-12psi: Remove PSIHB_XIVR referenceJoel Stanley1-2/+0
The define for PSIHB_XIVR was removed with P7 support. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-07-11pau: Fix a build error with GCC 13.1.1Vaibhav Jain1-1/+1
Compiling hmi.c with GCC 13.1.1 results in following error core/hmi.c:860:25: error: ‘pau’ may be used uninitialized [-Werror=maybe-uninitialized] 860 | pau_opencapi_dump_scoms(pau); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix this by initializing variable 'pau' with NULL when defined in npu_fir_errors(). Variable 'pau' is only assigned/referenced in switch-case blocks when phb_type == phb_type_pau_opencapi. Hence this patch shouldn't introduce any behavioral changes. Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-07-11Support cross compiling on RISC-VAndreas Schwab1-1/+1
Signed-off-by: Andreas Schwab <schwab@suse.de> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-07-11hw/chiptod: allow qemu to use the chiptodNicholas Piggin2-4/+7
There is a QEMU model for ChipTOD (not yet upstream) that provides enough to get through skiboot's sync sequence. So run the chiptod init when running under QEMU, if it is being provided in the device tree. If not, don't crash because the QEMU patch has not been merged yet... Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-06-06core/init: Move opal_mpipl_init earlierNicholas Piggin1-4/+2
There doesn't seem to be any reason to call opal_mpipl_init so late, after sleep, traps, interrupts, machine checks, watchdog, etc., are all disabled. Move it earlier. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-06-06ipmi: remove unused OS watchdog supportNicholas Piggin3-39/+0
This code hasn't been enabled, remove it. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-06-06ipmi: flush the ipmi message queue before booting a kernelNicholas Piggin6-5/+44
Bring ipmi to a consistent state before booting a kernel by flushing all outstanding messages. The OS may not start kicking the IPMI state machine for some time. For example, without this change, when booting in QEMU, the IPMI command issued by ipmi_wdt_final_reset() to disable the watchdog is not sent to the BMC before the OS boots, effectively leaving the watchdog enabled until the OS begins to drive OPAL pollers. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Stewart Smith <stewart@flamingspork.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-06-06platforms: Use astbmc_exitNicholas Piggin13-13/+14
Move all platforms using astbmc_init() to use astbmc_exit(). Move ipmi_set_boot_count() to astbmc_exit from ipmi_wdt_final_reset(). Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-06-06ipmi: Fix potential infinite loop in sync_msg pollingNicholas Piggin1-1/+2
Current gcc with -Os happens to generate code that re-loads the variable in the loop, but that could change without notice, and with -O2 it does infinite loop if sync_msg is !NULL, because it is not declared volatile and there is no compiler barrier in the loop. Add the usual cpu_relax() there to provide the compiler barrier. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Stewart Smith <stewart@flamingspork.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-06-06core/malloc: Make free and realloc tolerant of invalid usageNicholas Piggin1-0/+24
Print a message if free or realloc are called on memory outside the skiboot heap. Freeing is skipped to give the best chance of avoiding a crash. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-06-06VAS: use local_free to free local_alloc memoryNicholas Piggin1-2/+2
free() asserts because local_alloc() doesn't allocate from the skiboot heap region. Fix this by using local_free(). Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-06-06mem_region: Add a local_free functionNicholas Piggin2-0/+38
This allows memory to be allocated with local_alloc() to be freed. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-06-06opal-ci: Drop fedora36, add fedora38Reza Arbab4-3/+3
Fedora 36 has reached end-of-life. Remove it and add Fedora 38. Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Reviewed-by: Dan Horák <dan@danny.cz>
2023-03-28opal/hmi: Recover from unusual HMI with no TB error reported.Mahesh Salgaonkar1-4/+36
Timer facility HMIs are reported with TB error reason set in the TFMR register. With help from reason set in TFMR register, OPAL hmi handler carry out appropriate recovery procedure to successfully recover from Timer facility HMIs. However, On p10, in a very rare situation when core is waking up from stop2 or higher stop state, timer facility goes into error state due to Missing step, causing an HMI with no error reason set in TFMR register other than TFMR[41]=0 (tb_valid) and TFMR[28:31]=9 (tbst_encoded). Ideally, "Missing step" error should be reported in TFMR[44]=1. It looks like in this rare case, while generating HMI, HW fails to sync up the TFMR register with the core which is waking up from stop2. Hence, in absence of proper error reason, OPAL fails to recover from this unusual HMI, resulting in system panic/crash. In order to recover from this HMI it needs to reset the core level error "Missing step". Handle this as special case by treating this as TFMR corrupt error (TFMR[60]) which will then force reset core level errors including Missing step. Reported-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Mahesh Salgaonkar <mahesh@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-02-27hw/phb4: Clear the PEC FIRs when taking the ETU out of resetFrederic Barrat1-13/+17
The documented PEC recovery procedure is to clear the PEC FIR registers when the ETU/PHB is in reset. However, any xscom access targeting a PHB register while it is in reset will raise a new error (PFIR bit 3), so it is possible to get out of reset and still have a FIR register showing errors. It has been observed that the OCC, through its 24x7 service, can do such a xscom access at boot time if we end up in the CRESET path. So the current behavior of logging an error is not desirable. The recommendation from the logic designer is to keep the existing mechanism to clear the FIR registers and add an extra step to clear any new errors immediately after taking the ETU out of reset. That's what this patch is doing. Fixes: https://github.com/open-power/skiboot/issues/273 Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-02-27hw/phb4: Use symbols when accessing PEC registersFrederic Barrat2-12/+19
This patch improves readability just a tiny bit by using symbols, most of them already existing, instead of values when accessing the PEC registers. No functional changes. Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-02-27ci: Update github actions to run on Node 16Reza Arbab1-1/+1
Github is deprecating Node 12 for actions[1]. Support for Node 16 was added to github-pages-deploy-action in v4.4.1. Instead of specifying v4.2.5 in our workflow, only reference the major release, which will pick up the latest. [1] https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12 Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-01-20opal-ci: Use https URLs for systemsim packagesReza Arbab10-18/+18
The links used to download Mambo have stopped working: Step 5/9 : RUN if [ `arch` = "x86_64" ]; then dnf -y install http://public.dhe.ibm.com/software/server/powerfuncsim/p9/packages/v1.1-0/systemsim-p9-1.1-0.f22.x86_64.rpm; fi ---> Running in 4676caeeb953 Last metadata expiration check: 0:03:46 ago on Thu Jan 19 16:06:19 2023. [MIRROR] systemsim-p9-1.1-0.f22.x86_64.rpm: Curl error (56): Failure when receiving data from the peer for http://public.dhe.ibm.com/software/server/powerfuncsim/p9/packages/v1.1-0/systemsim-p9-1.1-0.f22.x86_64.rpm [Recv failure: Connection reset by peer] [MIRROR] systemsim-p9-1.1-0.f22.x86_64.rpm: Curl error (56): Failure when receiving data from the peer for http://public.dhe.ibm.com/software/server/powerfuncsim/p9/packages/v1.1-0/systemsim-p9-1.1-0.f22.x86_64.rpm [Recv failure: Connection reset by peer] [MIRROR] systemsim-p9-1.1-0.f22.x86_64.rpm: Curl error (56): Failure when receiving data from the peer for http://public.dhe.ibm.com/software/server/powerfuncsim/p9/packages/v1.1-0/systemsim-p9-1.1-0.f22.x86_64.rpm [Recv failure: Connection reset by peer] [MIRROR] systemsim-p9-1.1-0.f22.x86_64.rpm: Curl error (56): Failure when receiving data from the peer for http://public.dhe.ibm.com/software/server/powerfuncsim/p9/packages/v1.1-0/systemsim-p9-1.1-0.f22.x86_64.rpm [Recv failure: Connection reset by peer] [FAILED] systemsim-p9-1.1-0.f22.x86_64.rpm: Curl error (56): Failure when receiving data from the peer for http://public.dhe.ibm.com/software/server/powerfuncsim/p9/packages/v1.1-0/systemsim-p9-1.1-0.f22.x86_64.rpm [Recv failure: Connection reset by peer] Curl error (56): Failure when receiving data from the peer for http://public.dhe.ibm.com/software/server/powerfuncsim/p9/packages/v1.1-0/systemsim-p9-1.1-0.f22.x86_64.rpm [Recv failure: Connection reset by peer] Oddly, this only happens with dnf. Using curl directly to fetch the package works. Since the issue is isolated to http, let's just change these links to https, which is probably a good idea regardless. Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-01-19opal-ci: Update qemu command line to test booting upFrederic Barrat1-2/+1
Starting with qemu 7.2, there's no longer any PCI root port configured when the '-nodefaults' option is used. Since that option is used and we include some PCI devices when we test booting with qemu, qemu 7.2 is throwing an error as it doesn't have a bus to attach the devices to. It's currently breaking the CI on Fedora rawhide, where qemu has been updated to version 7.2. Support for powernv in qemu has improved since the qemu-boot-check test was introduced and there's no good reason to run with '-nodefaults' any more. So this patch removes it. Which allows to also remove a few extra devices from the command line since the defaults are sane. And we can still attach PCI devices. Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-01-19ci: Update github actions to run on Node 16Reza Arbab2-2/+2
Github is deprecating Node 12 for actions[1]. Update our workflow from using actions/checkout@v2 to v3, which runs on Node 16. [1] https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12 Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com>
2023-01-03opal-ci: Drop fedora35, add fedora37Reza Arbab4-3/+3
Fedora 35 has reached end-of-life. Remove it and add Fedora 37. Reviewed-by: Dan Horák <dan@danny.cz> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2022-09-20external/mambo: add a poor man's ftrace commandNicholas Piggin1-0/+26
Add an ftrace command that steps instructions and prints the symbol whenever it changes. This can be helpful for low level debugging. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2022-08-23docs/platforms: Add Rainier product nameJoel Stanley1-3/+9
Rainier has GA'd as the S1014/S1022/S1024. Signed-off-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Dan Horák <dan@danny.cz> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2022-08-23mambo: print useful error when mysim mmap failsRyan Grimm1-2/+2
My user id didn't have access to disk.img and the code printed the error message: ERROR: pmem: 'mysim mmap' command needs newer mambo mysim mmap has been in Mambo for a while so this patch prints out the error message from catch. Now we get the useful: ERROR: pmem: 'mysim mmap' Error opening file disk.img for mapping Signed-off-by: Ryan Grimm <grimm@linux.ibm.com> Reviewed-by: Dan Horák <dan@danny.cz> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2022-08-03mambo: Fix backtrace when trace mixes endian codeRyan Grimm1-0/+7
In the case of LE kernel and BE skiboot, the bt functions triggers an illegal address when the kernel has a stack pointer in skiboot. For example, in copy_and_flush: pc: 0x000000000000C25C +0x000000000000C25C lr: 0x000000000000C240 +0x000000000000C240 stack:0x0000000031C13D20 0x8428023000000000 +0x8428023000000000 Illegal Address 0x001EC13100000007 The bad address is from mem_display_64 and is fixed up by inverting the LE bit: systemsim % mem_display_64 [ expr 0x0000000031C13D20 ] 1 0x103EC13100000000 systemsim % mem_display_64 [ expr 0x0000000031C13D20 ] 0 0x0000000031C13E10 This patch tests the pointer by catching the illegal access and inverting the LE bit. Now the stack trace looks good: pc: 0x000000000000C254 +0x000000000000C254 lr: 0x000000000000C240 +0x000000000000C240 stack:0x0000000031C13D20 0x0000000030022884 .load_and_boot_kernel+0xc6c stack:0x0000000031C13E10 0x0000000030023344 .main_cpu_entry+0x8bc Opal calls also look good too now: pc: 0x0000000030028588 .cpu_idle_delay+0xb8 lr: 0x000000003002856C .cpu_idle_delay+0x9c stack:0x0000000031C13A10 0x0000000030028514 .cpu_idle_delay+0x44 stack:0x0000000031C13AB0 0x000000003002D6C0 .time_wait_nopoll+0x34 stack:0x0000000031C13B20 0x000000003002D77C .time_wait+0xa8 stack:0x0000000031C13BA0 0x000000003002821C .cpu_wait_job+0x3c stack:0x0000000031C13C40 0x0000000030029554 .opal_reinit_cpus+0x3c0 stack:0x0000000031C13D10 0x00000000300038AC opal_entry+0x14c stack:0x000000000071FDA0 0xC0000000000537B0 opal_call+0x40 stack:0x000000000071FE60 0xC00000000005450C opal_reinit_cpus+0x20 stack:0x000000000071FED0 0xC00000000065FDAC opal_configure_cores+0x48 stack:0x000000000071FF00 0xC000000000656554 early_setup+0x134 Signed-off-by: Ryan Grimm <grimm@linux.ibm.com> Reviewed-by: Dan Horák <dan@danny.cz> Acked-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2022-07-05interrupts: Speed up opal interrupts scanningFrederic Barrat4-5/+38
When looking for which interrupts are serviced by opal, we scan all sources and query every single interrupt to know if it's for linux or opal. An optimization was made so that if the source doesn't have an 'interrupt' op (=the handler) or an 'attributes' op (to do the query), then we can skip the source. That's all good. However, when xive was introduced, the 'irq_source' defining those ops was wrapped in a 'xive_src' source which adds a level of indirection for those 'attributes' and 'interrupt' ops. So the previous optimization no longer works: the 'attributes' and 'interrupt' ops are defined from the wrapper, but if we could look past the indirection, we would realize they are not. That is getting problematic for the rather large generic IPIs source. We have 8 million such interrupts defined per chip on P10 and because the above optimization is no longer kicking in, we are now querying every single one of them to know if it is for opal. Real hardware swallows it without much difficulty, but simulators don't. Running qemu on my laptop, the full scan takes ~12 seconds per chip! This patch adds a callback for an interrupt source to report whether it has opal interrupts. If the source doesn't define it, then we fallback to looking at the 'interrupt' and 'attributes' ops, like before, as it is still useful on P8. We can then define that new callback on the xive sources, allowing to look past the indirection level and skip scanning the source when appropriate. Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2022-06-13xive: Fix NSR value when dumping the state of thread contextFrederic Barrat2-2/+2
There's no reason to skip 2 bits when printing the Notification Source Register (NSR) of any thread context ring. So it's got to be a silly mistake and we should shift by 56 bits and not 58 :-) Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com> Reviewed-by: Dan Horák <dan@danny.cz> Reviewed-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2022-06-13cpu: Fix HID SPR icache flushing and attn change sequenceNicholas Piggin2-2/+26
Changing the HID attn enable bit on POWER9 and POWER10 requires the icache to be flushed *after* ATTN is changed. It is not clear that it may be done at the same time, so move it to after the attn bit change. Flushing the icache with HID requires a 0->1 edge and the bit does not reset back to 0, so first write 1 then 0 ready for the next flush. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2022-06-13core: detect LPAR-per-core mode and report in dtNicholas Piggin4-0/+44
Some firmware configurations boot in LPAR-per-core mode, which is not compatible with KVM on POWER9 and later machines. Detect which LPAR mode the boot core is in (all others will be set the same way), and if booted in LPAR-per-core mode then print a warning and add a device-tree entry that the OS can test for. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2022-06-13opal-ci: Drop fedora34, add fedora36Reza Arbab4-4/+5
Fedora 34 has reached end-of-life. Remove it and add Fedora 36. Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com> Reviewed-by: Dan Horák <dan@danny.cz>
2022-06-13libstb: Fix memcpy overread in fakenv_readpublic()Reza Arbab1-2/+2
Caught by `make check` on fedora-rawhide (GCC 12): libstb/secvar/test/../storage/fakenv_ops.c: In function 'fakenv_readpublic': libstb/secvar/test/../storage/fakenv_ops.c:155:17: error: 'memcpy' reading 134 bytes from a region of size 34 [-Werror=stringop-overread] 155 | memcpy(&nv_name->t.name, tpmnv_vars_name, sizeof(TPM2B_NAME)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from libstb/secvar/test/secvar-test-secboot-tpm.c:5: libstb/secvar/test/../storage/secboot_tpm.c:35:15: note: source object 'tpmnv_vars_name' of size 34 35 | const uint8_t tpmnv_vars_name[] = { | ^~~~~~~~~~~~~~~ libstb/secvar/test/../storage/fakenv_ops.c:158:17: error: 'memcpy' reading 134 bytes from a region of size 34 [-Werror=stringop-overread] 158 | memcpy(&nv_name->t.name, tpmnv_control_name, sizeof(TPM2B_NAME)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libstb/secvar/test/../storage/secboot_tpm.c:41:15: note: source object 'tpmnv_control_name' of size 34 41 | const uint8_t tpmnv_control_name[] = { | ^~~~~~~~~~~~~~~~~~ The source and destination of each memcpy have known sizes, and we are copying the smaller buffer into the larger one, so change the memcpy size to that of the smaller buffer. Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2022-06-13libstb: Work around deprecated API warnings on OpenSSL 3.0 systemsReza Arbab1-0/+1
Several OpenSSL APIs that libstb uses have been deprecated in OpenSSL 3.0. Commit 9a1f95f87004 ("libstb/create-container: avoid using deprecated APIs when compiling with OpenSSL 3.0") enabled `make` to succeed on an OpenSSL 3.0 system, but `make check` still fails: libstb/print-container.c:405:9: error: 'EC_KEY_new' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] libstb/print-container.c:413:9: error: 'EC_KEY_set_group' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] libstb/print-container.c:425:9: error: 'EC_POINT_bn2point' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] libstb/print-container.c:429:9: error: 'EC_KEY_set_public_key' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] libstb/print-container.c:434:9: error: 'ECDSA_do_verify' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] libstb/print-container.c:449:9: error: 'EC_KEY_free' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] This print-container.c is derived from the one in the sb-signing-utils project. Ideally, OpenSSL 3.0 support should be added there first and then synced back into skiboot. Until that is complete[1], build with -Wno-error=deprecated-declarations so these errors stop blocking our CI. [1] https://github.com/open-power/sb-signing-utils/issues/35 Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2022-06-13fsp: Fix possible use of null "%s" prlog argumentReza Arbab1-1/+3
Caught by CI in fedora-rawhide (GCC 12): hw/fsp/fsp-codeupdate.c:116:26: error: '%s' directive argument is null [-Werror=format-overflow=] 116 | prlog(PR_NOTICE, "CUPD: IPL SIDE = %s\n", side); To prevent this, explicitly print the value of ipl_side instead. Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Reviewed-by: Dan Horák <dan@danny.cz>
2022-05-23xscom: Parse P10 ec revisionJoel Stanley1-18/+19
Use a look up table to support the p9, p10dd1 and p10dd2 conversions. Running on a Rainier: > [ 268.267370706,6] CPU: P10 generation processor (max 4 threads/core) > [ 268.267372501,7] CPU: Boot CPU PIR is 0x0460 PVR is 0x00801200 > [ 268.284420384,5] CHIP: Chip ID 0000 type: P10 DD2.02 > [ 268.284464084,5] CHIP: Chip ID 0002 type: P10 DD2.02 > [ 268.284500468,5] CHIP: Chip ID 0004 type: P10 DD2.02 > [ 268.284538166,5] CHIP: Chip ID 0006 type: P10 DD2.02 > [ 268.286317879,5] PLAT: Detected Rainier platform Signed-off-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Dan Horák <dan@danny.cz> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2022-05-23xscom: Move p9 ec level parsing to a functionJoel Stanley1-30/+44
In preparation for adding p10 logic. No functional change. Reviewed-by: Dan Horák <dan@danny.cz> Signed-off-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2022-05-09CI: Clean up and re-enable testing on Fedora rawhideFrederic Barrat3-6/+28
Testing on rawhide somehow vanished when we converted to github actions. This patch cleans up the related CI files and re-enables it. Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>