Skip to content

Commit d4d215e

Browse files
Fuad TabbaMarc Zyngier
authored andcommitted
KVM: arm64: Fix __deactivate_fgt macro parameter typo
__deactivate_fgt() declares its first parameter as "htcxt" but the body references "hctxt". The parameter is unused; the macro silently captures "hctxt" from the enclosing scope. Both existing callers (__deactivate_traps_hfgxtr() and __deactivate_traps_ich_hfgxtr()) happen to define a local "struct kvm_cpu_context *hctxt", so the macro works by coincidence. A future caller without an "hctxt" local in scope, or naming it differently, would compile but bind to the wrong context. Align the parameter name with the sibling __activate_fgt() macro. The "vcpu" parameter remains unused in the body, kept for API symmetry with __activate_fgt() (which uses it). Fixes: f5a5a40 ("KVM: arm64: Propagate and handle Fine-Grained UNDEF bits") Assisted-by: Gemini:gemini-3.1-pro review-prompts Signed-off-by: Fuad Tabba <tabba@google.com> Link: https://patch.msgid.link/20260501112149.2824881-4-tabba@google.com Signed-off-by: Marc Zyngier <maz@kernel.org>
1 parent 300fac4 commit d4d215e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/arm64/kvm/hyp/include/hyp/switch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static inline void __activate_traps_ich_hfgxtr(struct kvm_vcpu *vcpu)
245245
__activate_fgt(hctxt, vcpu, ICH_HFGITR_EL2);
246246
}
247247

248-
#define __deactivate_fgt(htcxt, vcpu, reg) \
248+
#define __deactivate_fgt(hctxt, vcpu, reg) \
249249
do { \
250250
write_sysreg_s(ctxt_sys_reg(hctxt, reg), \
251251
SYS_ ## reg); \

0 commit comments

Comments
 (0)