Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riscv: hwprobe: do not produce frtace relocation #725

Closed
wants to merge 1 commit into from

Conversation

bjoto
Copy link

@bjoto bjoto commented Mar 13, 2024

Pull request for series with
subject: riscv: hwprobe: do not produce frtace relocation
version: 1
url: https://patchwork.kernel.org/project/linux-riscv/list/?series=834887

@bjoto
Copy link
Author

bjoto commented Mar 13, 2024

Upstream branch: 886516f
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=834887
version: 1

@bjoto
Copy link
Author

bjoto commented Mar 14, 2024

Upstream branch: 2b2ca35
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=834887
version: 1

@bjoto
Copy link
Author

bjoto commented Mar 15, 2024

Upstream branch: 0f0cd0e
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=834887
version: 1

@bjoto
Copy link
Author

bjoto commented Mar 20, 2024

Upstream branch: eeb7a89
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=834887
version: 1

@bjoto
Copy link
Author

bjoto commented Mar 21, 2024

Upstream branch: a9ad732
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=834887
version: 1

Such relocation causes crash of android linker similar to one
described in commit e05d57d
("riscv: Fixup __vdso_gettimeofday broke dynamic ftrace").

Looks like this relocation is added by CONFIG_DYNAMIC_FTRACE which is
disabled in the default android kernel.

Before:

readelf -rW arch/riscv/kernel/vdso/vdso.so:

Relocation section '.rela.dyn' at offset 0xd00 contains 1 entry:
    Offset             Info             Type
0000000000000d20  0000000000000003 R_RISCV_RELATIVE

objdump:
0000000000000c86 <__vdso_riscv_hwprobe@@LINUX_4.15>:
 c86:   0001                    nop
 c88:   0001                    nop
 c8a:   0001                    nop
 c8c:   0001                    nop
 c8e:   e211                    bnez    a2,c92 <__vdso_riscv_hwprobe...

After:
readelf -rW arch/riscv/kernel/vdso/vdso.so:

There are no relocations in this file.

objdump:
0000000000000c86 <__vdso_riscv_hwprobe@@LINUX_4.15>:
 c86:   e211                    bnez    a2,c8a <__vdso_riscv_hwprobe...
 c88:   c6b9                    beqz    a3,cd6 <__vdso_riscv_hwprobe...
 c8a:   e739                    bnez    a4,cd8 <__vdso_riscv_hwprobe...
 c8c:   ffffd797                auipc   a5,0xffffd

Also disable SCS since it also should not be available in vdso.

Fixes: aa5af0a ("RISC-V: Add hwprobe vDSO function and data")
Signed-off-by: Roman Artemev <roman.artemev@syntacore.com>
Signed-off-by: Vladimir Isaev <vladimir.isaev@syntacore.com>
Reviewed-by: Guo Ren <guoren@kernel.org>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
@bjoto
Copy link
Author

bjoto commented Mar 25, 2024

Upstream branch: 4cece76
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=834887
version: 1

@bjoto
Copy link
Author

bjoto commented Mar 26, 2024

At least one diff in series https://patchwork.kernel.org/project/linux-riscv/list/?series=834887 irrelevant now. Closing PR.

@bjoto bjoto added accepted and removed new labels Mar 26, 2024
@bjoto bjoto closed this Mar 26, 2024
@bjoto bjoto deleted the series/834887=>for-next branch March 26, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants