diff options
| author | Fuad Tabba <fuad.tabba@linux.dev> | 2026-09-01 15:03:25 +0100 |
|---|---|---|
| committer | Marc Zyngier <maz@kernel.org> | 2026-09-14 11:26:51 +0100 |
| commit | ab31289483f54892dc6204a6ce2015420d0d5213 (patch) | |
| tree | d39a97b1ae1f3e08672fcca6f2017b9e0e8aceed /tools/perf/scripts/python | |
| parent | db89e04ddbb7838b40f7d7b59b69220212678702 (diff) | |
KVM: arm64: nVHE: Check hypercall handlers against the declared ABI
Each hypercall handler unmarshals its arguments from the host context
with hand-written DECLARE_REG() casts that nothing ties to what the
caller passed: a handler can disagree with its caller in argument type,
count or register index without a diagnostic.
Generate the unmarshalling instead. DEFINE_KVM_HOST_HCALL() expands to
the handle_<name>() glue, modelled on the syscall wrappers, and checks
the handler's parameter list against the signature declared in
kvm_hcall.h, so both ends of every hypercall are now compiled against
the same declaration. Handler bodies keep their logic and lose the
DECLARE_REG() and return-register boilerplate. The two
get_host_hyp_vcpus() macros existed only to wrap DECLARE_REG(), so one
is dropped and the other becomes a function. The compiled handlers are
instruction-for-instruction identical, apart from flush_hyp_vcpu() and
sync_hyp_vcpu() now being inlined into their only caller.
The return-register store is picked by the declared return type, so a
void handler needs no macro of its own. The type is pasted into the
store's name, which has to be a single word, so
__pkvm_create_private_mapping is declared ulong.
Assisted-by: Antigravity:gemini-3.1-pro
Reviewed-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
Link: https://patch.msgid.link/20260901140326.3812068-11-fuad.tabba@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
