boot-qemu.sh: arm64: Pass 'lpa2=off' when necessary#58
Merged
Conversation
Comment on lines
+132
to
+133
| IFS=. read -ra QEMU_VER <<<"${QEMU_VER}" | ||
| printf "%d%02d%02d" "${QEMU_VER[@]}" |
Member
Author
There was a problem hiding this comment.
I could spell this out as:
printf "%d%02d%03d" "${VER_CODE[0]}" "${VER_CODE[1]}" "${VER_CODE[2]}"
?
Member
There was a problem hiding this comment.
We'd still need the read though?
Member
Author
There was a problem hiding this comment.
Correct, I don't think I can use printf without splitting the version somehow. This was the cleanest way I could think of.
8270137 to
5e8200f
Compare
5e8200f to
a6aeb89
Compare
nickdesaulniers
approved these changes
Mar 17, 2022
We will need to make some QEMU argument choices based on the kernel version, which we can only get reliably from the kernel image itself, which means we need to call this block in the case statement above. Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Similar to the Linux kernel's representation of compiler versions, add the ability to get the version of a QEMU as a five or six digit number to make decisions based on what version of QEMU is being used. Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Similar to the Linux kernel's representation of compiler versions, add the ability to get the version of the kernel being booted as a six or seven digit number to make decisions based on that number. To do this, we need a decompressed kernel image, so that we can use "strings" + "grep". The arguments to the function are the command to dump the decompressed kernel image to stdout. For example, if the kernel image is Image.gz, the command would be "gzip -c -d ...". Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Refactor get_{lnx,qemu}_ver_code to share splitting the version into an
array and printing it as a six or seven digit number. The QEMU sublevel
is never more than 100 but that does not matter much.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Starting with QEMU commit 69b2265d5fe8e, aarch64 kernels older than 5.12.0 do not boot without "lpa2=off". Add this parameter when booting a kernel older than this version using a version of QEMU that has this commit. We cannot universally pass this for all QEMU versions because the property is not recognized on older version: qemu-system-aarch64: can't apply global max-arm-cpu.lpa2=off: Property 'max-arm-cpu.lpa2' not found We could pass this for all kernel versions but we miss out on testing a default QEMU change. Link: https://gitlab.com/qemu-project/qemu/-/commit/69b2265d5fe8e0f401d75e175e0a243a7d505e53 Signed-off-by: Nathan Chancellor <nathan@kernel.org>
a6aeb89 to
11d3e43
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Starting with QEMU commit 69b2265d5fe8e, aarch64 kernels older than
5.12.0 do not boot without "lpa2=off". Add this parameter when booting a
kernel older than this version using a version of QEMU that has this
commit.
We cannot universally pass this for all QEMU versions because the
property is not recognized on older version:
qemu-system-aarch64: can't apply global max-arm-cpu.lpa2=off: Property 'max-arm-cpu.lpa2' not found
We could pass this for all kernel versions but we miss out on testing a
default QEMU change.
The first three commits add the individual functions that are needed by the
last commit for ease of reviewing.
Link: https://gitlab.com/qemu-project/qemu/-/commit/69b2265d5fe8e0f401d75e175e0a243a7d505e53