Skip to content

avz: guard the S3C/capsule cases in the dcache-flush switch with CONFIG_SOO#275

Merged
daniel-rossier merged 1 commit into
mainfrom
fix/avz-hypercalls-non-soo-build
Jul 9, 2026
Merged

avz: guard the S3C/capsule cases in the dcache-flush switch with CONFIG_SOO#275
daniel-rossier merged 1 commit into
mainfrom
fix/avz-hypercalls-non-soo-build

Conversation

@daniel-rossier

Copy link
Copy Markdown
Contributor

The issue #274 dcache-flush optimization listed AVZ_INJECT_CAPSULE,
AVZ_S3C_{READ,WRITE}_SNAPSHOT, AVZ_KILL_S3C and AVZ_GRANT_TABLE_OP in the
flush switch outside #ifdef CONFIG_SOO, but those command macros are only
defined via <soo/uapi/soo.h>, whose include is itself CONFIG_SOO-gated.

A non-SOO AVZ build (e.g. the virt64_avz_defconfig / e1c-capsule config used
by edge-m1) therefore failed to compile:

avz/kernel/hypercalls.c:233: error: 'AVZ_INJECT_CAPSULE' undeclared
avz/kernel/hypercalls.c:234: error: 'AVZ_S3C_READ_SNAPSHOT' undeclared
...
make: *** [Makefile:493: avz] Error 2

These hypercalls are never issued without CONFIG_SOO (their handlers in the
first switch are already guarded), so move the whole case group — flush body
included — inside the existing #ifdef CONFIG_SOO. Keeping the body inside the
guard also avoids the -Wswitch-unreachable warning that guarding only the
labels would leave.

Validation

Builds clean both ways with the aarch64 cross toolchain:

  • virt64_avz_defconfig (CONFIG_SOO off) → hypercalls.o compiles, no error, no warning.
  • virt64_avz_soo_defconfig (CONFIG_SOO on) → compiles, SOO path unaffected.

…IG_SOO

The issue #274 dcache-flush optimization listed AVZ_INJECT_CAPSULE,
AVZ_S3C_{READ,WRITE}_SNAPSHOT, AVZ_KILL_S3C and AVZ_GRANT_TABLE_OP in the
flush switch outside #ifdef CONFIG_SOO, but those command macros are only
defined via <soo/uapi/soo.h>, whose include is itself CONFIG_SOO-gated. A
non-SOO AVZ build (e.g. the e1c-capsule config used by edge-m1) then failed
to compile with "'AVZ_INJECT_CAPSULE' undeclared".

These hypercalls are never issued without CONFIG_SOO (their handlers in the
first switch are already guarded), so move the whole case group -- flush body
included -- inside the existing #ifdef CONFIG_SOO. This also avoids the
-Wswitch-unreachable warning that guarding only the labels would leave.

Builds clean both ways: virt64_avz_defconfig (SOO off) and
virt64_avz_soo_defconfig (SOO on).
@daniel-rossier daniel-rossier merged commit c4cddac into main Jul 9, 2026
6 checks passed
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