Skip to content

virt: add opt-in Aura PV discovery client - #778

Open
DjDeveloperr wants to merge 2 commits into
integration/aurorafrom
codex/aura-pv
Open

DjDeveloperr wants to merge 2 commits into
integration/aurorafrom
codex/aura-pv

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

What changed

  • add the opt-in Aura PV discovery client (CONFIG_AURA_PV) and ABI 0.1 UAPI
  • expose bounded discovery and arithmetic self-test ioctls through /dev/aura-pv
  • add the executable selftest and document the ABI and explicit limitations

Validation

  • drivers/virt/aura_pv.o builds with CONFIG_AURA_PV=m
  • selftest compiles and exits 4 when /dev/aura-pv is unavailable, as expected
  • m1n1 host endpoint default-off/opt-in build and contract checks pass

This PR intentionally does not claim /dev/kvm guest-run, EL1 entry, stage-2 translation, virtual interrupts, timers, or nested guest context switching. The current m1n1 host has one global stage-2/VTTBR context, so a safe per-VM protocol is still required before ABI 0.2 guest execution.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Review, not merged yet. It builds in a test merge on integration/aurora 86cb1c3 (with 731 and 856), and the header passes HDRTEST. A few things to fix first:

  1. include/uapi/linux/aura_pv.h uses BIT_ULL() from <linux/bits.h>. The uapi linux/bits.h only has __GENMASK, so userspace that uses AURA_PV_FEATURE_* or AURA_PV_OUTPUT_* won't compile. HDRTEST doesn't catch it because nothing expands the macros. _BITULL() from <linux/const.h> works in both.
  2. aura_pv_hvc() is hand-rolled and doesn't list x4 to x17 as clobbered. That's only safe if Aura promises SMCCC 1.1 register preservation for these function IDs. arm_smccc_1_1_hvc() would cover it, or the asm needs the clobbers. If the x19/x20 sentinels are there to check that Aura preserves callee-saved registers, the client never compares them after the call.
  3. .compat_ioctl = aura_pv_ioctl passes a 32-bit pointer through unchanged. compat_ptr_ioctl is the usual fix.
  4. There's no module_exit, so the module can't be unloaded, and with no modalias it never autoloads. That's fine for a diagnostic, but the docs should say it has to be loaded by hand.
  5. asahi.config turns it on as =m for every distro kernel. It's harmless without the DT node, but the Aura side that publishes aurora,aura-kvm-pv-0 isn't merged yet (aura PR 33 is still a draft). Until it is, this would ship a module nothing can bind.

I'd hold it until the Aura host side lands and one guest run has passed on the Neo. Happy to re-run the build once it's updated.

@DjDeveloperr DjDeveloperr mentioned this pull request Nov 9, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Heads-up: #1363 (merged as 8484356) removed APIF from integration/aurora, including tools/testing/selftests/aurora-apif/. This PR still adds a test under that directory, so it needs a small fixup on rebase: move the test, or drop it if it's APIF-only.

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.

2 participants