From b0150bb650644a5f96ed1c40d617deb5d308ef95 Mon Sep 17 00:00:00 2001 From: Vincent Donnefort Date: Tue, 18 Feb 2025 10:07:59 +0000 Subject: [PATCH] ANDROID: KVM: arm64: Fix pKVM module handler registration A typo in cmpxchg inverted the old and new value. The registration is silently failing. Fix this. Bug: 357781595 Bug: 382397533 Bug: 397325645 Fixes: 0a901ecd7f9f ("ANDROID: KVM: arm64: Rework pKVM module fault handler") Change-Id: I442aebe4ec24a8dda09b64f3de1110511c4d5d84 Signed-off-by: Vincent Donnefort --- arch/arm64/kvm/hyp/nvhe/modules.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/hyp/nvhe/modules.c b/arch/arm64/kvm/hyp/nvhe/modules.c index 3870aa4972d4..c28d49126ffb 100644 --- a/arch/arm64/kvm/hyp/nvhe/modules.c +++ b/arch/arm64/kvm/hyp/nvhe/modules.c @@ -144,7 +144,7 @@ static int mod_handler_register(enum mod_handler_type type, void *handler) int i; for (i = 0; i < MAX_MOD_HANDLERS; i++) { - if (!cmpxchg64_release(&mod_handlers[type][i], handler, NULL)) + if (!cmpxchg64_release(&mod_handlers[type][i], NULL, handler)) return 0; }