roms: omit the git reference to h2
v2 cover roms: omit the git reference to h2
Using git rev-parse doesn't make any sense for a source tarball distribution.
Switch to the process used by edk2: capture the version in a makefile instead.
v1: https://lore.kernel.org/qemu-devel/[email protected]/
Brian Cain (2):
roms: record the H2 commit in a file
pc-bios: rebuild H2 firmware
MAINTAINERS | 1 + pc-bios/README | 7 +++---- pc-bios/hexagon_booter_qcs6490_cdsp | Bin 285292 -> 285292 bytes pc-bios/hexagon_booter_sa8775p_cdsp | Bin 281224 -> 281224 bytes pc-bios/hexagon_booter_sa8797p_nsp0 | Bin 288904 -> 288904 bytes pc-bios/hexagon_booter_sc8480xp_nsp0 | Bin 288908 -> 288908 bytes pc-bios/hexagon_booter_sm8975_nsp | Bin 288900 -> 288900 bytes pc-bios/hexagon_loadlinux_qcs6490_cdsp | Bin 200428 -> 200428 bytes pc-bios/hexagon_loadlinux_sa8775p_cdsp | Bin 200456 -> 200456 bytes pc-bios/hexagon_loadlinux_sa8797p_nsp0 | Bin 208136 -> 208136 bytes pc-bios/hexagon_loadlinux_sc8480xp_nsp0 | Bin 208140 -> 208140 bytes pc-bios/hexagon_loadlinux_sm8975_nsp | Bin 208132 -> 208132 bytes roms/Makefile | 22 ++++++++++++++++++---- roms/hexagon-hypervisor-version | 1 + 14 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 roms/hexagon-hypervisor-version
Signature · 1 line
2.34.1
PATCH v2 1/2 roms: record the H2 commit in a file
The H2 build ID was derived by running git rev-parse, which fails when building from a source tarball. Leaving H2K_GIT_COMMIT as "0x" does not compile.
Instead, keep the commit in a tracked file and always build from it. When the submodule is checked out, fail the H2 build if its HEAD does not match the recorded commit, so a submodule update without a matching update of the file is caught.
--- MAINTAINERS | 1 + roms/Makefile | 22 ++++++++++++++++++---- roms/hexagon-hypervisor-version | 1 + 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 roms/hexagon-hypervisor-version
MAINTAINERS +1 -0
@@ -1400,6 +1400,7 @@ F: tests/qtest/qcom-dsp-test.c F: docs/devel/hexagon-sys.rst F: pc-bios/hexagon* F: roms/hexagon-hypervisor +F: roms/hexagon-hypervisor-version LoongArch Machines ------------------
roms/Makefile +18 -4
@@ -226,11 +226,25 @@ hexagon_h2_booters := hexagon-booter-qcs6490-cdsp \ hexagon_h2_loadlinux := hexagon-loadlinux-qcs6490-cdsp \ hexagon-loadlinux-sm8975-nsp hexagon-loadlinux-sa8775p-cdsp \ hexagon-loadlinux-sc8480xp-nsp0 hexagon-loadlinux-sa8797p-nsp0 +include hexagon-hypervisor-version + +.PHONY: hexagon-hypervisor-check +hexagon-hypervisor-check: + @if test -e hexagon-hypervisor/.git; then \ + h2_head=$$(git -C hexagon-hypervisor rev-parse HEAD); \ + if test "$$h2_head" != "$(H2K_COMMIT)"; then \ + echo "hexagon-hypervisor is at $$h2_head, but" \ + "roms/hexagon-hypervisor-version has" \ + "$(H2K_COMMIT)" >&2; \ + exit 1; \ + fi; \ + fi + hexagon_h2_common_flags = USE_PKW=0 TARGET=opt NULL_ANGEL_TRAP=1 \ HMX_HLX_SUPPORT=1 \ H2K_LOAD_ADDR=0x9b800000 H2K_GUEST_START=0xa2000000 \ - H2K_GIT_COMMIT=0x$(shell git -C hexagon-hypervisor rev-parse --short=8 HEAD) \ - H2K_GIT_COMMIT_LONG=0x$(shell git -C hexagon-hypervisor rev-parse HEAD) \ + H2K_GIT_COMMIT=0x$(shell echo $(H2K_COMMIT) | cut -c1-8) \ + H2K_GIT_COMMIT_LONG=0x$(H2K_COMMIT) \ JFLAG=-j$(shell nproc) .PHONY: hexagon-qcs6490-cdsp hexagon-sm8975-nsp \
@@ -264,7 +278,7 @@ hexagon-loadlinux-sm8975-nsp hexagon-loadlinux-sa8775p-cdsp \ hexagon-loadlinux-sc8480xp-nsp0 hexagon-loadlinux-sa8797p-nsp0: \ hexagon_h2_linux_flags = LINUX_LINK_ADDR=0xa0000000 -$(hexagon_h2_booters): hexagon-booter-%: +$(hexagon_h2_booters): hexagon-booter-%: hexagon-hypervisor-check rm -rf $(hexagon_h2_out)/booter-$* $(MAKE) -C hexagon-hypervisor $(hexagon_h2_common_flags) \ $(hexagon_h2_machine_flags) \
@@ -273,7 +287,7 @@ $(hexagon_h2_booters): hexagon-booter-%: $(hexagon_h2_build)/booter-$*/install/bin/booter chmod -x ../pc-bios/hexagon_booter_$(subst -,_,$*) -$(hexagon_h2_loadlinux): hexagon-loadlinux-%: +$(hexagon_h2_loadlinux): hexagon-loadlinux-%: hexagon-hypervisor-check rm -rf $(hexagon_h2_out)/loadlinux-$* $(MAKE) -C hexagon-hypervisor $(hexagon_h2_common_flags) \ $(hexagon_h2_machine_flags) \
roms/hexagon-hypervisor-version new file +1 -0
@@ -0,0 +1 @@ +H2K_COMMIT = 23d5bde4313c1e63ba64dd5d7f542b1055188ef8
Signature · 1 line
2.34.1
Re: [PATCH v2 1/2] roms: record the H2 commit in a file
Quoted 9 lines · Brian Cain
The H2 build ID was derived by running
git rev-parse, which fails when building from a source tarball. LeavingH2K_GIT_COMMITas "0x" does not compile.Instead, keep the commit in a tracked file and always build from it. When the submodule is checked out, fail the H2 build if its HEAD does not match the recorded commit, so a submodule update without a matching update of the file is caught.
Quoted 8 lines
Signed-off-by Brian Cain <[email protected]>--- MAINTAINERS | 1 + roms/Makefile | 22 ++++++++++++++++++---- roms/hexagon-hypervisor-version | 1 + 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 roms/hexagon-hypervisor-version
Re: [PATCH v2 1/2] roms: record the H2 commit in a file
In reply to Brian CainQuoted 10 lines · Brian Cain
The H2 build ID was derived by running
git rev-parse, which fails when building from a source tarball. LeavingH2K_GIT_COMMITas "0x" does not compile.Instead, keep the commit in a tracked file and always build from it. When the submodule is checked out, fail the H2 build if its HEAD does not match the recorded commit, so a submodule update without a matching update of the file is caught.
Signed-off-by Brian Cain <[email protected]>
Thank you for the work and the update!
/mjt
Quoted 75 lines
MAINTAINERS | 1 + roms/Makefile | 22 ++++++++++++++++++---- roms/hexagon-hypervisor-version | 1 + 3 files changed, 20 insertions(+), 4 deletions(-)create mode 100644 roms/hexagon-hypervisor-version
MAINTAINERS +1
-0@@ -1400,6 +1400,7 @@ F: tests/qtest/qcom-dsp-test.c F: docs/devel/hexagon-sys.rst F: pc-bios/hexagon* F: roms/hexagon-hypervisor +F: roms/hexagon-hypervisor-version LoongArch Machines ------------------roms/Makefile +18
-4@@ -226,11 +226,25 @@ hexagon_h2_booters := hexagon-booter-qcs6490-cdsp \ hexagon_h2_loadlinux := hexagon-loadlinux-qcs6490-cdsp \ hexagon-loadlinux-sm8975-nsp hexagon-loadlinux-sa8775p-cdsp \ hexagon-loadlinux-sc8480xp-nsp0 hexagon-loadlinux-sa8797p-nsp0 +include hexagon-hypervisor-version + +.PHONY: hexagon-hypervisor-check +hexagon-hypervisor-check: + @if test -e hexagon-hypervisor/.git; then \ + h2_head=$$(git -C hexagon-hypervisor rev-parse HEAD); \ + if test "$$h2_head" != "$(H2K_COMMIT)"; then \ + echo "hexagon-hypervisor is at $$h2_head, but" \ + "roms/hexagon-hypervisor-version has" \ + "$(H2K_COMMIT)" >&2; \ + exit 1; \ + fi; \ + fi + hexagon_h2_common_flags = USE_PKW=0 TARGET=opt NULL_ANGEL_TRAP=1 \ HMX_HLX_SUPPORT=1 \ H2K_LOAD_ADDR=0x9b800000 H2K_GUEST_START=0xa2000000 \ - H2K_GIT_COMMIT=0x$(shell git -C hexagon-hypervisor rev-parse --short=8 HEAD) \ - H2K_GIT_COMMIT_LONG=0x$(shell git -C hexagon-hypervisor rev-parse HEAD) \ + H2K_GIT_COMMIT=0x$(shell echo $(H2K_COMMIT) | cut -c1-8) \ + H2K_GIT_COMMIT_LONG=0x$(H2K_COMMIT) \ JFLAG=-j$(shell nproc) .PHONY: hexagon-qcs6490-cdsp hexagon-sm8975-nsp \@@ -264,7 +278,7 @@ hexagon-loadlinux-sm8975-nsp hexagon-loadlinux-sa8775p-cdsp \ hexagon-loadlinux-sc8480xp-nsp0 hexagon-loadlinux-sa8797p-nsp0: \ hexagon_h2_linux_flags = LINUX_LINK_ADDR=0xa0000000 -$(hexagon_h2_booters): hexagon-booter-%: +$(hexagon_h2_booters): hexagon-booter-%: hexagon-hypervisor-check rm -rf $(hexagon_h2_out)/booter-$* $(MAKE) -C hexagon-hypervisor $(hexagon_h2_common_flags) \ $(hexagon_h2_machine_flags) \@@ -273,7 +287,7 @@ $(hexagon_h2_booters): hexagon-booter-%: $(hexagon_h2_build)/booter-$*/install/bin/booter chmod -x ../pc-bios/hexagon_booter_$(subst -,_,$*) -$(hexagon_h2_loadlinux): hexagon-loadlinux-%: +$(hexagon_h2_loadlinux): hexagon-loadlinux-%: hexagon-hypervisor-check rm -rf $(hexagon_h2_out)/loadlinux-$* $(MAKE) -C hexagon-hypervisor $(hexagon_h2_common_flags) \ $(hexagon_h2_machine_flags) \roms/hexagon-hypervisor-version new file +1
-0@@ -0,0 +1 @@ +H2K_COMMIT = 23d5bde4313c1e63ba64dd5d7f542b1055188ef8
PATCH v2 2/2 pc-bios: rebuild H2 firmware
In reply to Brian CainRebuild the H2 images with the updated roms/Makefile. The H2 sources and build ID are unchanged.
--- pc-bios/README | 7 +++---- pc-bios/hexagon_booter_qcs6490_cdsp | Bin 285292 -> 285292 bytes pc-bios/hexagon_booter_sa8775p_cdsp | Bin 281224 -> 281224 bytes pc-bios/hexagon_booter_sa8797p_nsp0 | Bin 288904 -> 288904 bytes pc-bios/hexagon_booter_sc8480xp_nsp0 | Bin 288908 -> 288908 bytes pc-bios/hexagon_booter_sm8975_nsp | Bin 288900 -> 288900 bytes pc-bios/hexagon_loadlinux_qcs6490_cdsp | Bin 200428 -> 200428 bytes pc-bios/hexagon_loadlinux_sa8775p_cdsp | Bin 200456 -> 200456 bytes pc-bios/hexagon_loadlinux_sa8797p_nsp0 | Bin 208136 -> 208136 bytes pc-bios/hexagon_loadlinux_sc8480xp_nsp0 | Bin 208140 -> 208140 bytes pc-bios/hexagon_loadlinux_sm8975_nsp | Bin 208132 -> 208132 bytes 11 files changed, 3 insertions(+), 4 deletions(-)
pc-bios/README +3 -4
@@ -3,10 +3,9 @@ - hexagon_booter_<machine> and hexagon_loadlinux_<machine> are the H2 hypervisor firmware for the Hexagon machines. The sources are at - https://gitlab.com/qemu-project/hexagon-hypervisor, built from commit - 23d5bde4313c1e63ba64dd5d7f542b1055188ef8 with Hexagon SDK 6.7.0.0 - via "make -C roms hexagon-<machine>". H2 is distributed under the terms - given in "hexagon-hypervisor-license.txt". + https://gitlab.com/qemu-project/hexagon-hypervisor + built with Hexagon SDK 6.7.0.0 via "make -C roms hexagon-<machine>". + H2 is distributed under the terms given in "hexagon-hypervisor-license.txt". - The VGA BIOS and the Cirrus VGA BIOS come from the LGPL VGA bios project (http://www.nongnu.org/vgabios/).
pc-bios/hexagon_booter_qcs6490_cdsp binary +0 -0
pc-bios/hexagon_booter_sa8775p_cdsp binary +0 -0
pc-bios/hexagon_booter_sa8797p_nsp0 binary +0 -0
pc-bios/hexagon_booter_sc8480xp_nsp0 binary +0 -0
pc-bios/hexagon_booter_sm8975_nsp binary +0 -0
pc-bios/hexagon_loadlinux_qcs6490_cdsp binary +0 -0
pc-bios/hexagon_loadlinux_sa8775p_cdsp binary +0 -0
pc-bios/hexagon_loadlinux_sa8797p_nsp0 binary +0 -0
pc-bios/hexagon_loadlinux_sc8480xp_nsp0 binary +0 -0
pc-bios/hexagon_loadlinux_sm8975_nsp binary +0 -0
Signature · 1 line
2.34.1
Re: [PATCH v2 2/2] pc-bios: rebuild H2 firmware
Quoted 4 lines · Brian Cain
Rebuild the H2 images with the updated roms/Makefile. The H2 sources and build ID are unchanged.
Signed-off-by Brian Cain <[email protected]>
Quoted 14 lines
--- pc-bios/README | 7 +++---- pc-bios/hexagon_booter_qcs6490_cdsp | Bin 285292 -> 285292 bytes pc-bios/hexagon_booter_sa8775p_cdsp | Bin 281224 -> 281224 bytes pc-bios/hexagon_booter_sa8797p_nsp0 | Bin 288904 -> 288904 bytes pc-bios/hexagon_booter_sc8480xp_nsp0 | Bin 288908 -> 288908 bytes pc-bios/hexagon_booter_sm8975_nsp | Bin 288900 -> 288900 bytes pc-bios/hexagon_loadlinux_qcs6490_cdsp | Bin 200428 -> 200428 bytes pc-bios/hexagon_loadlinux_sa8775p_cdsp | Bin 200456 -> 200456 bytes pc-bios/hexagon_loadlinux_sa8797p_nsp0 | Bin 208136 -> 208136 bytes pc-bios/hexagon_loadlinux_sc8480xp_nsp0 | Bin 208140 -> 208140 bytes pc-bios/hexagon_loadlinux_sm8975_nsp | Bin 208132 -> 208132 bytes 11 files changed, 3 insertions(+), 4 deletions(-)
Re: [PATCH v2 2/2] pc-bios: rebuild H2 firmware
In reply to Brian CainQuoted 2 lines · Brian Cain
Rebuild the H2 images with the updated roms/Makefile. The H2 sources and build ID are unchanged.
Do we really need this second commit when nothing really changed besides the way where we're getting the commit ID?
Not that I'm opposing or something, it just feels unnecessary (the binaries changes that is, not the change to README).
BTW, it looks like the firmware files aren't reproducible too, just like many other firmware files (since a rebuild makes them differ). But it's an entirely different, separate, much larger question than the scope of this change.
Thanks,
/mjt
Re: [PATCH v2 2/2] pc-bios: rebuild H2 firmware
Quoted 10 lines · Michael Tokarev
Quoted 2 lines · Brian Cain
Rebuild the H2 images with the updated roms/Makefile. The H2 sources and build ID are unchanged.
Do we really need this second commit when nothing really changed besides the way where we're getting the commit ID?
Not that I'm opposing or something, it just feels unnecessary (the binaries changes that is, not the change to README).
It felt appropriate to re-build h2 because the makefile changed - so that there'd be no confusion about the inputs to h2 when it was built.
But if you prefer, we can drop this commit.
Quoted 8 lines
BTW, it looks like the firmware files aren't reproducible too, just like many other firmware files (since a rebuild makes them differ). But it's an entirely different, separate, much larger question than the scope of this change.
Thanks,
/mjt