mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 12:14:06 +00:00
Arm FF-A fix for v6.6
It has been reported that the driver sets the memory region attributes for MEM_LEND operation when the specification clearly states not to. The fix here addresses the issue by ensuring the memory region attributes are cleared for the memory lending operation. -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEunHlEgbzHrJD3ZPhAEG6vDF+4pgFAmUUG70ACgkQAEG6vDF+ 4pg0Og//dteLTtj/mHej4fIL3ih0qNN6Ih1NXlqfcgc4Yw7EcLhnKZabwGy3Ybdq 4egdPwHXLPMS7XAxg7y2WWoMA7+raFYp8vYOWOjHdTPmgDjzxHMybMP3J31RSjfL gi4DoF8g2EF0bwtMvk0A3pTqgQG3YOfMupf9CLPZg5XOmPVDAq5R1zn3hu/Dz/ic 5nkJNkA3VCmLrSzfSEQtC8vDPT0pNID6sLCgByJvx6qqPKAlO6Mhpe1f93N2BMsK Z24SjevzPHjGFS4MwaW8evDpdTuESUd0MQBV5/yCha8gvJOK2Q0629qLM5fpii7j ZxHkGaj1pSj9zqCCKOxJVFanxTEJQo8dAbzz446jB7pBkeT4T4sIAsHe+Jw7QIOS kFT3xOfZwYpCU7nJWEgOaDuNBlHFD5ZiP922tXatX6nj7gEopVpUSg0u1R9/BMHa DLK3xaF/Gd38KFN52WBV98+jFyE9dUYVu1PLG+uJDvKyS6PoKKmRckNxdtPDpEeH Lsez4ES9dbb2c+nCrAseUeuFW1D8HBEHo705MIGsefqfqISOrh1A3oj7gEwnv6ho ZOLKbSHX3ufx3WOm4R8aFtRafP7ZL8X6ovQDCzzYhAitnF2bp+zfjJOkJv4X7OLV jz8AtdwCT6qW5rg0PCDNo8CrAYN1GA0/+ria17JpKF37Pk5hdjQ= =Flo6 -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmUVJ9oACgkQYKtH/8kJ UidcBRAApJskT2y1BVlZZTtyUuu9cck/dfGfzhP50XiO6m0YYr6W+RnLjWj4o/oc 5Ct7eJsqh8jZ2XbZQfXY/eojts/xyfFq48MBWBkuMECE3M5rsjkPTu1N+WOJiVUt BlbLmwx5xNuK2JbSdHN/Et4xguau6ZbhZ08nW8+uHOJtxquUjCapWqN9r5cYki8V NQhdaaT0/YlA4sMPsCN9HkEVR0VYlHkcQo9f8onXg93rUpK3p7hWhz5pUZDJEwZE CSb+is4ADsNAzioLCTZh9MDMQoaduxQXzw8QjYKY6mxK1VIFDmDmblMl7UFARQs7 ufvqzGZpCqVNrjQK7+vHXakrG5hOA2VmMRhMt60KrY4AVTgpZYNzGqpIz7dlOuxd 8FDwjHEeYZXgtfUA6dxD19oRi49shO3HB34YrTbGi7GOOjuWJl4c3wJtR/Ps1vha GFnggmOqjRFYi+YBzShCn/pZGgcAHWadcLn3zklCcnNaRj+2voXyqKOkDbuhteFs 4zt1ggvykeAQ8mU9+HwiwIZek9X7hsKI7bz2jKTV8uugqr5DDTnY7vwOtGvZochk GBpEZH12e5Cf9QO74Nam5kvLJqpj3orhSul0jnWZ1R8n9Obv0IH/ytthctDnP4Ek XFqGiBoQzDTNIjANcmr0UG46l+95J9Lbi7iyk+tX7z5+wVxkQ7U= =MdPT -----END PGP SIGNATURE----- Merge tag 'ffa-fix-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes Arm FF-A fix for v6.6 It has been reported that the driver sets the memory region attributes for MEM_LEND operation when the specification clearly states not to. The fix here addresses the issue by ensuring the memory region attributes are cleared for the memory lending operation. * tag 'ffa-fix-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_ffa: Don't set the memory region attributes for MEM_LEND Link: https://lore.kernel.org/r/20230927121555.158619-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
commit
79684f2ea3
1 changed files with 14 additions and 2 deletions
|
@ -397,6 +397,19 @@ static u32 ffa_get_num_pages_sg(struct scatterlist *sg)
|
|||
return num_pages;
|
||||
}
|
||||
|
||||
static u8 ffa_memory_attributes_get(u32 func_id)
|
||||
{
|
||||
/*
|
||||
* For the memory lend or donate operation, if the receiver is a PE or
|
||||
* a proxy endpoint, the owner/sender must not specify the attributes
|
||||
*/
|
||||
if (func_id == FFA_FN_NATIVE(MEM_LEND) ||
|
||||
func_id == FFA_MEM_LEND)
|
||||
return 0;
|
||||
|
||||
return FFA_MEM_NORMAL | FFA_MEM_WRITE_BACK | FFA_MEM_INNER_SHAREABLE;
|
||||
}
|
||||
|
||||
static int
|
||||
ffa_setup_and_transmit(u32 func_id, void *buffer, u32 max_fragsize,
|
||||
struct ffa_mem_ops_args *args)
|
||||
|
@ -413,8 +426,7 @@ ffa_setup_and_transmit(u32 func_id, void *buffer, u32 max_fragsize,
|
|||
mem_region->tag = args->tag;
|
||||
mem_region->flags = args->flags;
|
||||
mem_region->sender_id = drv_info->vm_id;
|
||||
mem_region->attributes = FFA_MEM_NORMAL | FFA_MEM_WRITE_BACK |
|
||||
FFA_MEM_INNER_SHAREABLE;
|
||||
mem_region->attributes = ffa_memory_attributes_get(func_id);
|
||||
ep_mem_access = &mem_region->ep_mem_access[0];
|
||||
|
||||
for (idx = 0; idx < args->nattrs; idx++, ep_mem_access++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue