[PATCH v1 2/2] KVM: arm64: Fix bpages backing allocation size in hyp_trace

Fuad Tabba fuad.tabba at linux.dev
Thu Oct 8 12:13:29 PDT 2026


On Thu, 8 Oct 2026 at 11:42, Vincent Donnefort <vdonnefort at google.com> wrote:
>
> hyp_trace_buffer_alloc_bpages_backing() computes nr_bpages as
> (PAGE_ALIGN(size) / PAGE_SIZE) + 1, whereas trace_remote_alloc_buffer()
> takes into account the buffer page header.
>
> Align the bpages backing allocation by using
> __calc_nr_pages_ring_buffer_desc(). There's no need to validate
> nr_bpages again, it has been before with trace_buffer_desc_size().
>
> Fixes: 3aed038aac8d ("KVM: arm64: Add trace remote for the nVHE/pKVM hyp")

Should this have Cc: stable too, like patch 1? The undercount is there
since 3aed038aac8d for small buffers, and 442ffa742daa6
("tracing/remotes: Account for ring buffer page header in size
calculation") makes it reachable at ordinary sizes.

Reviewed-by: Fuad Tabba <fuad.tabba at linux.dev>
Tested-by: Fuad Tabba <fuad.tabba at linux.dev>

Cheers,
/fuad



More information about the linux-arm-kernel mailing list