On 2/15/24 08:51, John David Anglin wrote:In the above call, syscall_exit is treated as a function pointer. It points to an 8-byte aligned
On 2024-02-15 10:44 a.m., Guenter Roeck wrote:
On 2/15/24 02:27, David Laight wrote:This looks wrong to me. Function descriptors should always be 8-byte aligned. I think this
...
It would be worthwhile tracking this down since there are
lots of unaligned data accesses (8-byte accesses on 4-byte aligned addresses)
when running the kernel in 64-bit mode.
Hmmm....
For performance reasons you really don't want any of them.
The misaligned 64bit fields need an __attribute((aligned(4)) marker.
If the checksum code can do them it really needs to detect
and handle the misalignment.
The misaligned trap handler probably ought to contain a
warn_on_once() to dump stack on the first such error.
They can then be fixed one at a time.
Unaligned LDD at unwind_once+0x4a8/0x5e0
Decoded:
Unaligned LDD at unwind_once (arch/parisc/kernel/unwind.c:212 arch/parisc/kernel/unwind.c:243 arch/parisc/kernel/unwind.c:371 arch/parisc/kernel/unwind.c:445)
Source:
static bool pc_is_kernel_fn(unsigned long pc, void *fn)
{
return (unsigned long)dereference_kernel_function_descriptor(fn) == pc;
routine should return false if fn isn't 8-byte aligned.
Below you state "Code entry points only need 4-byte alignment."
I think that contradicts each other. Also, the calling code is,
for example,
pc_is_kernel_fn(pc, syscall_exit)
I fail to see how this can be consolidated if it is ok
that syscall_exit is 4-byte aligned but, at the same time,
must be 8-byte aligned to be considered to be a kernel function.