Re: [PATCH v1 01/10] KVM: arm64: Don't WARN on SMCCC filter reserved range allocation failure
From: Oliver Upton
Date: Mon Sep 28 2026 - 12:02:07 EST
Hi Fuad,
On Mon, Sep 28, 2026 at 04:24:58PM +0100, Fuad Tabba wrote:
> The first time userspace sets an SMCCC filter, kvm_smccc_set_filter()
> inserts the reserved architecture ranges into the maple tree and WARNs
> if that fails. The tree is empty and config_lock is held, so the only
> way it can fail is -ENOMEM. The allocation is GFP_KERNEL_ACCOUNT, so a
> memory cgroup limit is enough to hit the WARN from userspace.
>
> The WARN goes back to when the ranges were inserted at VM creation and
> the error was dropped. Since commit d34b76489ea0c ("KVM: arm64: Only
> insert reserved ranges when SMCCC filter is used") the tree is emptied
> on failure and the error reaches userspace. Drop the WARN.
Eh, the warn is still useful. You could potentially add a check for
-ENOMEM but any other return value is a sign of something wrong in
KVM.
Thanks,
Oliver