38dd0c29 | 05-Oct-2023 |
Sudeep Holla <sudeep.holla@arm.com> |
firmware: arm_ffa: Allow the FF-A drivers to use 32bit mode of messaging
[ Upstream commit 2d698e8b4fd22374dac0a2d5150ab24d57a222ab ]
An FF-A ABI could support both the SMC32 and SMC64 conventions.
firmware: arm_ffa: Allow the FF-A drivers to use 32bit mode of messaging
[ Upstream commit 2d698e8b4fd22374dac0a2d5150ab24d57a222ab ]
An FF-A ABI could support both the SMC32 and SMC64 conventions. A callee that runs in the AArch64 execution state and implements such an ABI must implement both SMC32 and SMC64 conventions of the ABI.
So the FF-A drivers will need the option to choose the mode irrespective of FF-A version and the partition execution mode flag in the partition information.
Let us remove the check on the FF-A version for allowing the selection of 32bit mode of messaging. The driver will continue to set the 32-bit mode if the partition execution mode flag specified that the partition supports only 32-bit execution.
Fixes: 106b11b1ccd5 ("firmware: arm_ffa: Set up 32bit execution mode flag using partiion property") Link: https://lore.kernel.org/r/20231005142823.278121-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
3aa0519a | 01-Jun-2023 |
Balint Dobszay <balint.dobszay@arm.com> |
firmware: arm_ffa: Set handle field to zero in memory descriptor
As described in the commit 111a833dc5cb ("firmware: arm_ffa: Set reserved/MBZ fields to zero in the memory descriptors") some fields
firmware: arm_ffa: Set handle field to zero in memory descriptor
As described in the commit 111a833dc5cb ("firmware: arm_ffa: Set reserved/MBZ fields to zero in the memory descriptors") some fields in the memory descriptor have to be zeroed explicitly. The handle field is one of these, but it was left out from that change, fix this now.
Fixes: 111a833dc5cb ("firmware: arm_ffa: Set reserved/MBZ fields to zero in the memory descriptors") Reported-by: Imre Kis <imre.kis@arm.com> Signed-off-by: Balint Dobszay <balint.dobszay@arm.com> Link: https://lore.kernel.org/r/20230601140749.93812-1-balint.dobszay@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|
111a833d | 03-May-2023 |
Sudeep Holla <sudeep.holla@arm.com> |
firmware: arm_ffa: Set reserved/MBZ fields to zero in the memory descriptors
The transmit buffers allocated by the driver can be used to transmit data by any messages/commands needing the buffer. Ho
firmware: arm_ffa: Set reserved/MBZ fields to zero in the memory descriptors
The transmit buffers allocated by the driver can be used to transmit data by any messages/commands needing the buffer. However, it is not guaranteed to have been zero-ed before every new transmission and hence it will just contain residual value from the previous transmission. There are several reserved fields in the memory descriptors that must be zero(MBZ). The receiver can reject the transmission if any such MBZ fields are non-zero.
While we can set the whole page to zero, it is not optimal as most of the fields get initialised to the value required for the current transmission.
So, just set the reserved/MBZ fields to zero in the memory descriptors explicitly to honour the requirement and keep the receiver happy.
Fixes: cc2195fe536c ("firmware: arm_ffa: Add support for MEM_* interfaces") Reported-by: Marc Bonnici <marc.bonnici@arm.com> Link: https://lore.kernel.org/r/20230503131252.12585-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|
19b87664 | 20-Apr-2023 |
Sudeep Holla <sudeep.holla@arm.com> |
firmware: arm_ffa: Fix FFA device names for logical partitions
Each physical partition can provide multiple services each with UUID. Each such service can be presented as logical partition with a un
firmware: arm_ffa: Fix FFA device names for logical partitions
Each physical partition can provide multiple services each with UUID. Each such service can be presented as logical partition with a unique combination of VM ID and UUID. The number of distinct UUID in a system will be less than or equal to the number of logical partitions.
However, currently it fails to register more than one logical partition or service within a physical partition as the device name contains only VM ID while both VM ID and UUID are maintained in the partition information. The kernel complains with the below message:
| sysfs: cannot create duplicate filename '/devices/arm-ffa-8001' | CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.3.0-rc7 #8 | Hardware name: FVP Base RevC (DT) | Call trace: | dump_backtrace+0xf8/0x118 | show_stack+0x18/0x24 | dump_stack_lvl+0x50/0x68 | dump_stack+0x18/0x24 | sysfs_create_dir_ns+0xe0/0x13c | kobject_add_internal+0x220/0x3d4 | kobject_add+0x94/0x100 | device_add+0x144/0x5d8 | device_register+0x20/0x30 | ffa_device_register+0x88/0xd8 | ffa_setup_partitions+0x108/0x1b8 | ffa_init+0x2ec/0x3a4 | do_one_initcall+0xcc/0x240 | do_initcall_level+0x8c/0xac | do_initcalls+0x54/0x94 | do_basic_setup+0x1c/0x28 | kernel_init_freeable+0x100/0x16c | kernel_init+0x20/0x1a0 | ret_from_fork+0x10/0x20 | kobject_add_internal failed for arm-ffa-8001 with -EEXIST, don't try to | register things with the same name in the same directory. | arm_ffa arm-ffa: unable to register device arm-ffa-8001 err=-17 | ARM FF-A: ffa_setup_partitions: failed to register partition ID 0x8001
By virtue of being random enough to avoid collisions when generated in a distributed system, there is no way to compress UUID keys to the number of bits required to identify each. We can eliminate '-' in the name but it is not worth eliminating 4 bytes and add unnecessary logic for doing that. Also v1.0 doesn't provide the UUID of the partitions which makes it hard to use the same for the device name.
So to keep it simple, let us alloc an ID using ida_alloc() and append the same to "arm-ffa" to make up a unique device name. Also stash the id value in ffa_dev to help freeing the ID later when the device is destroyed.
Fixes: e781858488b9 ("firmware: arm_ffa: Add initial FFA bus support for device enumeration") Reported-by: Lucian Paul-Trifu <lucian.paul-trifu@arm.com> Link: https://lore.kernel.org/r/20230419-ffa_fixes_6-4-v2-3-d9108e43a176@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|
c6e04536 | 20-Apr-2023 |
Sudeep Holla <sudeep.holla@arm.com> |
firmware: arm_ffa: Fix usage of partition info get count flag
Commit bb1be7498500 ("firmware: arm_ffa: Add v1.1 get_partition_info support") adds support to discovery the UUIDs of the partitions or
firmware: arm_ffa: Fix usage of partition info get count flag
Commit bb1be7498500 ("firmware: arm_ffa: Add v1.1 get_partition_info support") adds support to discovery the UUIDs of the partitions or just fetch the partition count using the PARTITION_INFO_GET_RETURN_COUNT_ONLY flag.
However the commit doesn't handle the fact that the older version doesn't understand the flag and must be MBZ which results in firmware returning invalid parameter error. That results in the failure of the driver probe which is in correct.
Limit the usage of the PARTITION_INFO_GET_RETURN_COUNT_ONLY flag for the versions above v1.0(i.e v1.1 and onwards) which fixes the issue.
Fixes: bb1be7498500 ("firmware: arm_ffa: Add v1.1 get_partition_info support") Reported-by: Jens Wiklander <jens.wiklander@linaro.org> Reported-by: Marc Bonnici <marc.bonnici@arm.com> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Link: https://lore.kernel.org/r/20230419-ffa_fixes_6-4-v2-2-d9108e43a176@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|
5b0c6328 | 07-Sep-2022 |
Sudeep Holla <sudeep.holla@arm.com> |
firmware: arm_ffa: Split up ffa_ops into info, message and memory operations
In preparation to make memory operations accessible for a non ffa_driver/device, it is better to split the ffa_ops into d
firmware: arm_ffa: Split up ffa_ops into info, message and memory operations
In preparation to make memory operations accessible for a non ffa_driver/device, it is better to split the ffa_ops into different categories of operations: info, message and memory. The info and memory are ffa_device independent and can be used without any associated ffa_device from a non ffa_driver.
However, we don't export these info and memory APIs yet without the user. The first users of these APIs can export them.
Link: https://lore.kernel.org/r/20220907145240.1683088-11-sudeep.holla@arm.com Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|
106b11b1 | 07-Sep-2022 |
Sudeep Holla <sudeep.holla@arm.com> |
firmware: arm_ffa: Set up 32bit execution mode flag using partiion property
FF-A v1.1 adds a flag in the partition properties to indicate if the partition runs in the AArch32 or AArch64 execution st
firmware: arm_ffa: Set up 32bit execution mode flag using partiion property
FF-A v1.1 adds a flag in the partition properties to indicate if the partition runs in the AArch32 or AArch64 execution state. Use the same to set-up the 32-bit execution flag mode in the ffa_dev automatically if the detected firmware version is above v1.0 and ignore any requests to do the same from the ffa_driver.
Link: https://lore.kernel.org/r/20220907145240.1683088-10-sudeep.holla@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|
bb1be749 | 07-Sep-2022 |
Sudeep Holla <sudeep.holla@arm.com> |
firmware: arm_ffa: Add v1.1 get_partition_info support
FF-A v1.1 adds support to discovery the UUIDs of the partitions that was missing in v1.0 and which the driver workarounds by using UUIDs suppli
firmware: arm_ffa: Add v1.1 get_partition_info support
FF-A v1.1 adds support to discovery the UUIDs of the partitions that was missing in v1.0 and which the driver workarounds by using UUIDs supplied by the ffa_drivers.
Add the v1.1 get_partition_info support and disable the workaround if the detected FF-A version is greater than v1.0.
Link: https://lore.kernel.org/r/20220907145240.1683088-9-sudeep.holla@arm.com Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|
7aa7a979 | 07-Sep-2022 |
Sudeep Holla <sudeep.holla@arm.com> |
firmware: arm_ffa: Rename ffa_dev_ops as ffa_ops
Except the message APIs, all other APIs are ffa_device independent and can be used without any associated ffa_device from a non ffa_driver.
In order
firmware: arm_ffa: Rename ffa_dev_ops as ffa_ops
Except the message APIs, all other APIs are ffa_device independent and can be used without any associated ffa_device from a non ffa_driver.
In order to reflect the same, just rename ffa_dev_ops as ffa_ops to avoid any confusion or to keep it simple.
Link: https://lore.kernel.org/r/20220907145240.1683088-8-sudeep.holla@arm.com Suggested-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|
8c3812c8 | 07-Sep-2022 |
Sudeep Holla <sudeep.holla@arm.com> |
firmware: arm_ffa: Make memory apis ffa_device independent
There is a requirement to make memory APIs independent of the ffa_device. One of the use-case is to have a common memory driver that manage
firmware: arm_ffa: Make memory apis ffa_device independent
There is a requirement to make memory APIs independent of the ffa_device. One of the use-case is to have a common memory driver that manages the memory for all the ffa_devices. That common memory driver won't be a ffa_driver or won't have any ffa_device associated with it. So having these memory APIs accessible without a ffa_device is needed and should be possible as most of these are handled by the partition manager(SPM or hypervisor).
Drop the ffa_device argument to the memory APIs and make them ffa_device independent.
Link: https://lore.kernel.org/r/20220907145240.1683088-7-sudeep.holla@arm.com Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|
e57fba91 | 07-Sep-2022 |
Sudeep Holla <sudeep.holla@arm.com> |
firmware: arm_ffa: Use FFA_FEATURES to detect if native versions are supported
Currently, the ffa_dev->mode_32bit is use to detect if the native 64-bit or 32-bit versions of FF-A ABI needs to be use
firmware: arm_ffa: Use FFA_FEATURES to detect if native versions are supported
Currently, the ffa_dev->mode_32bit is use to detect if the native 64-bit or 32-bit versions of FF-A ABI needs to be used. However for the FF-A memory ABIs, it is not dependent on the ffa_device(i.e. the partition) itself, but the partition manager(SPM).
So, the FFA_FEATURES can be use to detect if the native 64bit ABIs are supported or not and appropriate calls can be made based on that.
Use FFA_FEATURES to detect if native versions of MEM_LEND or MEM_SHARE are implemented and make of the same to use native memory ABIs later on.
Link: https://lore.kernel.org/r/20220907145240.1683088-6-sudeep.holla@arm.com Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|
cb1f4c2c | 07-Sep-2022 |
Sudeep Holla <sudeep.holla@arm.com> |
firmware: arm_ffa: Add support for querying FF-A features
Add support for FFA_FEATURES to discover properties supported at the FF-A interface. This interface can be used to query: - If an FF-A inte
firmware: arm_ffa: Add support for querying FF-A features
Add support for FFA_FEATURES to discover properties supported at the FF-A interface. This interface can be used to query: - If an FF-A interface is implemented by the component at the higher EL, - If an implemented FF-A interface also implements any optional features described in its interface definition, and - Any implementation details exported by an implemented FF-A interface as described in its interface definition.
Link: https://lore.kernel.org/r/20220907145240.1683088-5-sudeep.holla@arm.com Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|
55bf84fd | 07-Sep-2022 |
Sudeep Holla <sudeep.holla@arm.com> |
firmware: arm_ffa: Remove ffa_dev_ops_get()
The only user of this exported ffa_dev_ops_get() was OPTEE driver which now uses ffa_dev->ops directly, there are no other users for this.
Also, since an
firmware: arm_ffa: Remove ffa_dev_ops_get()
The only user of this exported ffa_dev_ops_get() was OPTEE driver which now uses ffa_dev->ops directly, there are no other users for this.
Also, since any ffa driver can use ffa_dev->ops directly, there will be no need for ffa_dev_ops_get(), so just remove ffa_dev_ops_get().
Link: https://lore.kernel.org/r/20220907145240.1683088-4-sudeep.holla@arm.com Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|
00512d29 | 29-Apr-2022 |
Sudeep Holla <sudeep.holla@arm.com> |
firmware: arm_ffa: Remove incorrect assignment of driver_data
The ffa core driver currently assigns its own driver information to individual ffa device driver_data which is wrong. Firstly, it leaks
firmware: arm_ffa: Remove incorrect assignment of driver_data
The ffa core driver currently assigns its own driver information to individual ffa device driver_data which is wrong. Firstly, it leaks this core driver information to individual ffa_device and hence to ffa_driver. Secondly the ffa_device driver_data is for use by individual ffa_driver and not for this core driver managing all those devices.
Link: https://lore.kernel.org/r/20220429113946.2087145-2-sudeep.holla@arm.com Fixes: d0c0bce83122 ("firmware: arm_ffa: Setup in-kernel users of FFA partitions") Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|
f3c45c04 | 29-Apr-2022 |
Sudeep Holla <sudeep.holla@arm.com> |
firmware: arm_ffa: Fix uuid parameter to ffa_partition_probe
While we pass uuid_null intentionally to ffa_partition_probe in ffa_setup_partitions to get the count of the partitions, it must not be u
firmware: arm_ffa: Fix uuid parameter to ffa_partition_probe
While we pass uuid_null intentionally to ffa_partition_probe in ffa_setup_partitions to get the count of the partitions, it must not be uuid_null in ffa_partition_info_get which is used by the ffa_drivers to fetch the specific partition info passing the UUID of the partition.
Fix ffa_partition_info_get by passing the received uuid down to ffa_partition_probe so that the correct partition information is fetched.
Link: https://lore.kernel.org/r/20220429113946.2087145-1-sudeep.holla@arm.com Fixes: d0c0bce83122 ("firmware: arm_ffa: Setup in-kernel users of FFA partitions") Reported-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|
01537a07 | 26-Oct-2021 |
Arnd Bergmann <arnd@arndb.de> |
firmware: arm_ffa: Remove unused 'compat_version' variable
The newly added ffa_compatible_version_find() function causes a build warning because of a variable that is never used:
drivers/firmware/a
firmware: arm_ffa: Remove unused 'compat_version' variable
The newly added ffa_compatible_version_find() function causes a build warning because of a variable that is never used:
drivers/firmware/arm_ffa/driver.c:180:6: error: unused variable 'compat_version' [-Werror,-Wunused-variable] u32 compat_version;
Link: https://lore.kernel.org/r/20211026083400.3444946-1-arnd@kernel.org Fixes: 8e3f9da608f1 ("firmware: arm_ffa: Handle compatibility with different firmware versions") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|
82a8daae | 15-Oct-2021 |
Marc Bonnici <marc.bonnici@arm.com> |
firmware: arm_ffa: Add support for MEM_LEND
As part of the FF-A spec, an endpoint is allowed to transfer access of, or lend, a memory region to one or more borrowers.
Extend the existing memory sha
firmware: arm_ffa: Add support for MEM_LEND
As part of the FF-A spec, an endpoint is allowed to transfer access of, or lend, a memory region to one or more borrowers.
Extend the existing memory sharing implementation to support FF-A MEM_LEND functionality and expose this to other kernel drivers.
Note that upon a successful MEM_LEND request the caller must ensure that the memory region specified is not accessed until a successful MEM_RECALIM call has been made. On systems with a hypervisor present this will been enforced, however on systems without a hypervisor the responsibility falls to the calling kernel driver to prevent access.
Link: https://lore.kernel.org/r/20211015165742.2513065-1-marc.bonnici@arm.com Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Marc Bonnici <marc.bonnici@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|
8e3f9da6 | 13-Oct-2021 |
Sudeep Holla <sudeep.holla@arm.com> |
firmware: arm_ffa: Handle compatibility with different firmware versions
The driver currently just support v1.0 of Arm FFA specification. It also expects the firmware implementation to match the sam
firmware: arm_ffa: Handle compatibility with different firmware versions
The driver currently just support v1.0 of Arm FFA specification. It also expects the firmware implementation to match the same and bail out if it doesn't match. This is causing issue when running with higher version of firmware implementation(e.g. v1.1 which will released soon).
In order to support compatibility with different firmware versions, let us add additional checks and find the compatible version the driver can work with.
Link: https://lore.kernel.org/r/20211013091127.990992-1-sudeep.holla@arm.com Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
show more ...
|