| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
The TRNG service will return random data in x3. Use the correct field
when filling the buffer in trng_read.
This driver has not been in any release, so no security advisory is
needed.
Reviewed by: bz
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D50979
|
|
|
|
|
|
|
|
|
|
|
| |
In the SMCCC TRNG and Errata ABI drivers check if the version
functions are implemented before calling them. Without this the firmware
may complain about an unimplemented function being called.
Reported by: bz
Reviewed by: bz
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D50978
|
|
|
|
|
|
|
|
|
|
| |
Switch to the SMCCC not supported macro in smccc_arch_features. This
shouldn't be a functional change as the value is identical to the PSCI
value it replaces.
Reviewed by: bz, emaste
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D50977
|
|
|
|
|
|
| |
Reviewed by: imp, jhb
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D50913
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for the Arm Errata Management Firmware Interface (Errata
ABI) [1]. This provides an interface for the kernel to query the status
of an erratum workaround.
Some errata may be mitigated depending on the other hardware in a SoC,
e.g. Cortex-A78 erratum 2712571 is not affected in systems that use
an Arm interconnect. As there may not be a way for the kernel to know
if this is the case then it would have to implement the workaround
even when not needed.
There are other cases where the needed workaround is implemented in
firmware and if not implemented then the kernel may decide to not use
a feature. In this case we can query the firmware before deciding if
we should use a feature or now.
There is a known issue with some firmware implementations of the Errata
ABI that incorrectly returns a status indicating the erratum is fully
mitigated by the firmware, however there is a kernel component needed,
e.g. Neoverse-N1 erratum 1542419. To handle this case we tell the
caller there is some workaround implemented in the firmware and it can
decide how to handle it. If this is fixed in a way we can detect we can
add a new erratum status value to indicate this.
[1] https://developer.arm.com/documentation/den0100/latest/
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D48055
|
|
|
|
|
| |
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47675
|
|
|
|
|
|
|
|
|
|
| |
The Arm True Random Number Generator Firmware Interface provides a way
to query the SMCCC firmware for up to 192 bits of entropy. Use it to
provide another source of randomness to the kernel.
Reviewed by: cem, markm
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D46989
|
|
|
|
|
|
|
| |
This will be used to create an integer with a given version. It can
then be used to check if the SMCCC version is late enough for a driver.
Sponsored by: Arm Ltd
|
|
|
|
|
|
|
|
| |
This will be used by other drivers that manage SMCCC firmware services
to use as an attachment point.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D46988
|
|
|
|
|
|
|
|
| |
Simplify the calls into the SMCCC firmware with the new
arm_smccc_invoke* macros.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D46987
|
|
|
|
|
|
|
|
|
|
|
|
| |
When calling into SMCCC functions we often only need a few arguments.
As the current function needs all 8 possible arguments to be set the
unused values will be zero.
Create a macro to pass in the used values, followed by enough zeros,
then the result pointer.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D46986
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
LLD has the -zbti-report=error argument to check if the BTI note is
present when linking. To allow for this to be used when linking the
kernel and modules:
- Add the BTI note to the remaining assembly files
- Mark ptrauth.c as protected by BTI
- Disable -zbti-report for vmm hypervisor switching code as it's not
used there.
The linux64 module doesn't build with the flag as it includes vdso code
that doesn't include the note.
Reviewed by: imp, kib, emaste
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D45466
|
|
|
|
|
|
| |
dd a missing underscore to arm_smccc_1_2_* to fix the GCC build.
Sponsored by: Arm Ltd
|
|
|
|
|
|
|
|
|
| |
When searching for the PSCI FDT node we only check a few compat strings.
Use the existing compat_data array to check all strings the driver may
attach to.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44913
|
|
|
|
|
|
|
| |
Priority of psci_reboot set so that it is run after shutdown_panic is
executed. This is to provide uniform experience with other platforms.
MFC after: 3 weeks
|
|
|
|
|
|
|
|
| |
Consider the PSCI missing if the FDT node status says it is not okay.
Reviewed by: andrew
Obtained from: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D43920
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
|
|
|
|
|
|
|
|
|
| |
Add asserts to check SMCCC has been initialised before callers try to
use it.
Reviewed by: emaste
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41917
|
|
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
|
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
|
|
|
|
|
|
|
| |
These can be returned from the PSCI AFFINITY_INFO call. This is not
marked as optional so bhyve will need to implement it & can use these
macros.
Sponsored by: Arm Ltd
|
|
|
|
|
|
|
| |
Add PSCI_VER that takes a major and minor version and builds the value
returned by the firmware. This will be used by bhyve.
Sponsored by: Arm Ltd
|
|
|
|
|
|
|
|
|
|
| |
Wrap parts of psci.h that aren't usable by userspace in _KERNEL checks.
This allows it to be used to implement PSCI and SMCCC by bhyve in
userspace.
Sponsored by: Arm Ltd
Sponsored by: Innovate UK
Sponsored by: The FreeBSD Foundation
|
|
|
|
|
|
|
|
|
| |
Jumping direct to ret was not restoring the saved value of x19 and was
also not adjusting sp to discard the two saved registers.
Reviewed by: andrew
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D37922
|
|
|
|
| |
We don't build the smccc code on arm so don't call into it there.
|
|
|
|
|
|
|
|
|
| |
To allow device drivers to call into SMCCC we need to initialise it
earlier. As it depends on PSCI, and that is detected via ACPI or FDT
move the call to smccc_init to the PSCI driver.
Add a function for drivers to read the smccc version, or 0 if smccc
is not present.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
psci_attach is way too late to provide the intended semantics for
psci_present. psci calls can be made immediately after psci_init(),
called way earlier at SI_SUB_CPU + SI_ORDER_FIRST, and we need it to
be valid as early as we can possibly call a psci function.
This fixes booting RPi3+4 with the in-review spintable patch;
rpi3-psci-monitor patches the FDT to add a PSCI node, but it doesn't
patch each cpus' enable-method. Because of this, we would stall the
boot while enabling CPU 1 as we saw a valid looking enable-method and
"no" functional PSCI and attempted to use the spintable rather than
simply not starting secondary APs.
Fixes: 2218070b2c3c32 ("psci: finish psci_present implementation")
Reported by: karels
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
HvCallGetVpRegisters
Enabling HvCallSetVpRegisters and HvCallGetVpRegisters for hypercalls to
read and write to specific MSRs. This is required for implementing wrmsr
and rdmsr, which is required for Hyper-V vmbus driver for ARM64.
Also we need to use arm smccc hvc 1.2 version as we need to access
registers beyond X0-X3 for HvCallGetVpRegisters. Currently scoping
it only for Hyper-V.
Reviewed by: lwhsu, andrew, whu
Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Signed-off-by: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D36256
|
|
|
|
|
|
|
|
| |
To simplify adding new handlers merge the common parts of the functions
used to call into the arm SMCCC firmware.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36297
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This was already declared in psci.h, but it was never defined/set. Do
this now, so we can use it to decide if enable-method in /cpus FDT nodes
should be inspected later on. While we're here, convert it to a
boolean.
Reviewed by: andrew (slightly earlier version)
Differential Revision: https://reviews.freebsd.org/D34553
|
|
|
|
| |
Notes:
svn path=/head/; revision=365173
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PSCI code to use it.
This interface will also be used by Intel Stratix 10 platform.
This was not tested on arm due to lack of PSCI-enabled arm hardware
lying around.
Reviewed by: andrew
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D21439
Notes:
svn path=/head/; revision=352301
|
|
|
|
|
|
|
|
|
|
|
| |
Minimalistic PSCI implementation in U-Boot doesn't implement get_version()
method for some SoC. In this case, use PSCI version declared by 'psci' node
in DT as fallback.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=345299
|
|
|
|
|
|
|
|
| |
Looks good from: andrew
Sponsored by: Rubicon Communications, LLC (Netgate)
Notes:
svn path=/head/; revision=337752
|
|
|
|
|
|
|
|
|
|
|
| |
not include the needed headers to get the bool definition.
Reported by: manu
Pointy hat to: andrew
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=336971
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This calls into the Arm Trusted Firmware to enable and disable the
workaround for the Speculative Store Bypass Disable (SSBD) issue, also
known as Spectre Variant 4.
As this may have a large performance overhead, and how exploitable SSBD is
is unknown we follow the Linux lead of allowing the administrator to select
between always on, always off, or only enabled in the kernel, with the
latter being the default.
PR: 228955
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15819
Notes:
svn path=/head/; revision=336967
|
|
|
|
|
|
|
|
| |
Add a \n at the end of the printf if no PSCI function was found otherwise
it mess up the console log.
Notes:
svn path=/head/; revision=336037
|
|
|
|
|
|
|
| |
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=335439
|
|
|
|
|
|
|
|
|
| |
version detection.
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=335438
|
|
|
|
|
|
|
|
|
| |
While here add a comment with the document the function IDs come from.
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=335063
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to call into the firmware in a similar way to the existing PSCI, and used
PSCI to detect when SMCCC is enabled.
There is a function ID space we can use. Currently we only support 3
functions in the ARM Architecture Calls region, however it is expected we
will expend these in the future.
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=335062
|
|
|
|
|
|
|
|
|
| |
communicate with the firmware.
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=335061
|
|
|
|
|
|
|
|
|
| |
check for this, returning an error if the version is too old.
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=335056
|
|
|
|
|
|
|
| |
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=335055
|
|
|
|
|
|
|
|
|
| |
to query if a given function is implemented and its features.
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=335054
|
|
|
|
|
|
|
|
|
|
|
| |
This is in preperation for supporting newer smccc functions that also use
the same call method.
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D15745
Notes:
svn path=/head/; revision=334999
|
|
|
|
|
|
|
|
|
|
| |
outside the PSCI driver.
MFC after: 1 week
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=327728
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to r324754 we treated PSCI 0.2 and 1.0 as identical, and r324754
extended that to include all PSCI 1.x revisions. Change the string
emitted under bootverbose to reference '0.2 compatible' to avoid
confusion when the system includes a later PSCI rev.
Discussed with: andrew
Sponsored by: The FreeBSD Foundation
Notes:
svn path=/head/; revision=324758
|
|
|
|
|
|
|
|
|
|
|
| |
reports version 1.1 so the check was failing. As thjis is a minor change
from 1.0, and future 1.x revisions are also expected to be backwards
compatible just ignore the minor revision in the init handler.
Sponsored by: DARPA, AFRL
Notes:
svn path=/head/; revision=324754
|