Skip to content

Commit 836b5b9

Browse files
nathanlynchmpe
authored andcommitted
powerpc/rtas: ensure 4KB alignment for rtas_data_buf
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 033ef33 ("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 <[email protected]> Fixes: 033ef33 ("powerpc: Merge rtas.c into arch/powerpc/kernel") Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b7d5333 commit 836b5b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/kernel/rtas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static struct rtas_args rtas_args;
7575
DEFINE_SPINLOCK(rtas_data_buf_lock);
7676
EXPORT_SYMBOL_GPL(rtas_data_buf_lock);
7777

78-
char rtas_data_buf[RTAS_DATA_BUF_SIZE] __cacheline_aligned;
78+
char rtas_data_buf[RTAS_DATA_BUF_SIZE] __aligned(SZ_4K);
7979
EXPORT_SYMBOL_GPL(rtas_data_buf);
8080

8181
unsigned long rtas_rmo_buf;

0 commit comments

Comments
 (0)