Skip to content

[PW_SID:967717] fix riscv runtime constant support#457

Closed
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw967717
Closed

[PW_SID:967717] fix riscv runtime constant support#457
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw967717

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 967717 applied to workflow__riscv__fixes

Name: fix riscv runtime constant support
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=967717
Version: 1

the `__runtime_fixup_32` function does not handle the case where `val` is
zero correctly (as might occur when patching a nommu kernel and referring
to a physical address below the 4GiB boundary whose upper 32 bits are all
zero) because nothing in the existing logic prevents the code from taking
the `else` branch of both nop-checks and emitting two `nop` instructions.

This leaves random garbage in the register that is supposed to receive the
upper 32 bits of the pointer instead of zero that when combined with the
value for the lower 32 bits yields an invalid pointer and causes a kernel
panic when that pointer is eventually accessed.

The author clearly considered the fact that if the `lui` is converted into
a `nop` that the second instruction needs to be adjusted to become an `li`
instead of an `addi`, hence introducing the `addi_insn_mask` variable, but
didn't follow that logic through fully to the case where the `else` branch
executes. To fix it just adjust the logic to ensure that the second `else`
branch is not taken if the first instruction will be patched to a `nop`.

Fixes: a44fb57 ("riscv: Add runtime constant support")

Signed-off-by: Charles Mirabile <cmirabil@redhat.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/1] riscv: fix runtime constant support for nommu kernels"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 108.08 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/1] riscv: fix runtime constant support for nommu kernels"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1005.03 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/1] riscv: fix runtime constant support for nommu kernels"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1283.48 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/1] riscv: fix runtime constant support for nommu kernels"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.58 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/1] riscv: fix runtime constant support for nommu kernels"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 21.59 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/1] riscv: fix runtime constant support for nommu kernels"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.74 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/1] riscv: fix runtime constant support for nommu kernels"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 66.99 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/1] riscv: fix runtime constant support for nommu kernels"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/1] riscv: fix runtime constant support for nommu kernels"
kdoc
Desc: Detects for kdoc errors
Duration: 0.93 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/1] riscv: fix runtime constant support for nommu kernels"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/1] riscv: fix runtime constant support for nommu kernels"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 1.10 seconds
Result: ERROR
Output:

Commit: 105b77feb6340 ("riscv: fix runtime constant support for nommu kernels")
	Fixes tag: Fixes: a44fb5722199 ("riscv: Add runtime constant support")
	Has these problem(s):
		- empty lines surround the Fixes tag
Problems with Fixes tag: 1


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/1] riscv: fix runtime constant support for nommu kernels"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.29 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw967717 branch June 7, 2025 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant