-
Notifications
You must be signed in to change notification settings - Fork 41
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
Create kernel_qemu_aarch64_run rule #1060
base: master
Are you sure you want to change the base?
Create kernel_qemu_aarch64_run rule #1060
Conversation
bazel/linux/runner.bzl
Outdated
@@ -195,6 +201,13 @@ def create_runner(ctx, archs, code, runfiles = None, extra = {}): | |||
), | |||
) | |||
|
|||
if ki.arch == "aarch64": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a dumb note, nothing to do --- the compiler and bazel both use aarch64
, but the Linux kernel uses arm64
. it so dumb these are different in different places... i think what you have here is correct. when writing anything bazel use aarch64
.
47b86b2
to
75375ab
Compare
Rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good to me. Just a few minor nits that you could ignore.
c3d9764
to
7a010db
Compare
7a010db
to
ff91d66
Compare
bazel/linux/qemu.bzl
Outdated
echo 1>&2 '$' "$QEMU_BINARY" "${{QEMU_FLAGS[@]}}" "${{WRAPPER_OPTS[@]}}" | ||
if [ -z "$INTERACTIVE" -a -z "$SINGLE" ]; then | ||
"$QEMU_BINARY" "${{QEMU_FLAGS[@]}}" "${{WRAPPER_OPTS[@]}}" </dev/null | tee "$OUTPUT_FILE" | ||
"$QEMU_BINARY" "${{QEMU_FLAGS[*]}}" "${{KERNEL_FLAGS[*]}}" "${{WRAPPER_OPTS[*]}}" </dev/null | tee "$OUTPUT_FILE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original code had:
QEMU_FLAGS+=("-append" "${{KERNEL_FLAGS[*]}} ${{KERNEL_OPTS[*]}}")
... what happened to KERNEL_OPTS in the new code? Can't find anywhere the -append, and handling of KERNEL_OPTS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ccontavalli Very sorry. Seems like I dropped KERNEL_OPTS when I mucked with args. As for -append I pass all the args (kernel/qemu and wrapper args) separately to the model-wrapper-socket script in internal repo and do the append there (a different PR https://github.com/enfabrica/internal/pull/40251).
Any way thinking again, I went back the old way of doing things since if I do the above I realized there are other model-wrapper scripts which need to be changed too. So I just pass the arguments similar to how we use to do so before.
Also I just use the machine name now to know if the qemu to use is aarch64 or x86 one, instead of passing it as a wrapper option. That way do not have to muck with wrapper opts. If you rather have the arch passed as a wapper opts, I can change that. Please let me know.
Also to make it easy to read I am force pushing the diff. Please take a look again. Sorry again for the mess-up and thanks for finding the issue.
ff91d66
to
6db3c57
Compare
* For launching aarch64 qemu acf-machine a bootram image is needed. This image is loaded into SPS bootram and on qemu launch execution starts there. The actual image (bootloader + kernel + initramfs + devicetree) is loaded into DRAM. The bootram image does mimimal stuff and jumps to bootloader which continues rest of the boot. * This commit just creates a provider for the BootRam image.
* We want to be able to run a qemu machine emulating E1 system complex which connect to the SFA FE model via netpci for dev and testing. * So based on kernel_qemu_run which works for x86 arch, kernel_qemu_aarch64_run target is introduced which pretty much follows the same flow as kernel_qemu_run with changes needed for aarch64.
6db3c57
to
eb0565d
Compare
rebase |
), | ||
**{ | ||
"archs": attr.string_list( | ||
default = ["aarch64"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we are passing the archs, do we need a separate kernel_qemu_run rule ? Could we not just use the existing one ?
Create kernel_qemu_aarch64_run rule.
We want to be able to run a aarch64 qemu machine emulating E1 system complex which connect to the SFA FE model via netpci for dev and testing.
So based on kernel_qemu_run which works for x86 arch, kernel_qemu_aarch64_run target is introduced which pretty much follows the same flow as kernel_qemu_run with changes needed for aarch64.