Patch "powerpc/rtas: ensure 4KB alignment for rtas_data_buf" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    powerpc/rtas: ensure 4KB alignment for rtas_data_buf

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     powerpc-rtas-ensure-4kb-alignment-for-rtas_data_buf.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2e2d23af680231c7db1a15cce19e08f91223bfa3
Author: Nathan Lynch <nathanl@xxxxxxxxxxxxx>
Date:   Fri Feb 10 12:41:54 2023 -0600

    powerpc/rtas: ensure 4KB alignment for rtas_data_buf
    
    [ Upstream commit 836b5b9fcc8e09cea7e8a59a070349a00e818308 ]
    
    Some RTAS functions that have work area parameters impose alignment
    requirements on the work area passed to them by the OS. Examples
    include:
    
    - ibm,configure-connector
    - ibm,update-nodes
    - ibm,update-properties
    
    4KB is the greatest alignment required by PAPR for such
    buffers. rtas_data_buf used to have a __page_aligned attribute in the
    arch/ppc64 days, but that was changed to __cacheline_aligned for
    unknown reasons by commit 033ef338b6e0 ("powerpc: Merge rtas.c into
    arch/powerpc/kernel"). That works out to 128-byte alignment
    on ppc64, which isn't right.
    
    This was found by inspection and I'm not aware of any real problems
    caused by this. Either current RTAS implementations don't enforce the
    alignment constraints, or rtas_data_buf is always being placed at a
    4KB boundary by accident (or both, perhaps).
    
    Use __aligned(SZ_4K) to ensure the rtas_data_buf has alignment
    appropriate for all users.
    
    Signed-off-by: Nathan Lynch <nathanl@xxxxxxxxxxxxx>
    Fixes: 033ef338b6e0 ("powerpc: Merge rtas.c into arch/powerpc/kernel")
    Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230125-b4-powerpc-rtas-queue-v3-6-26929c8cce78@xxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 07d1ef762936d..7c7648e6f1c22 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -56,7 +56,7 @@ EXPORT_SYMBOL(rtas);
 DEFINE_SPINLOCK(rtas_data_buf_lock);
 EXPORT_SYMBOL_GPL(rtas_data_buf_lock);
 
-char rtas_data_buf[RTAS_DATA_BUF_SIZE] __cacheline_aligned;
+char rtas_data_buf[RTAS_DATA_BUF_SIZE] __aligned(SZ_4K);
 EXPORT_SYMBOL_GPL(rtas_data_buf);
 
 unsigned long rtas_rmo_buf;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux