All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Steven Price" <steven.price@arm.com>,
	kvm@vger.kernel.org, kvmarm@lists.linux.dev
Cc: "Oliver Upton" <oupton@kernel.org>, "Marc Zyngier" <maz@kernel.org>
Subject: Re: [PATCH v6 04/11] KVM: arm64: CCA: Add basic infrastructure for creating a realm
Date: Fri, 04 Dec 2026 12:15:50 +0000	[thread overview]
Message-ID: <sashiko-outbox-249773@kernel.org> (raw)
In-Reply-To: <20261204115725.45272-5-steven.price@arm.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] KVM: arm64: missing GFP_KERNEL_ACCOUNT for realm->sro in
  kvm_init_realm()
--

commit c9247832a90b04b03d28464012e13d88047af6a2
Author: Steven Price <steven.price@arm.com>

KVM: arm64: CCA: Add basic infrastructure for creating a realm

This commit adds skeleton realm creation and teardown helpers along with
RMM IPA limit checking during stage-2 MMU initialization.

> diff --git a/arch/arm64/kvm/rmi.c b/arch/arm64/kvm/rmi.c
> new file mode 100644
> index 0000000000000..6a8bff1d8d467
> --- /dev/null
> +++ b/arch/arm64/kvm/rmi.c

[ ... ]

> +int kvm_init_realm(struct kvm *kvm)
> +{
> +	struct realm *realm = &kvm->arch.realm;
> +
> +	realm->ia_bits = VTCR_EL2_IPA(kvm->arch.mmu.vtcr);
> +	realm->start_level = 4 - VTCR_EL2_LVLS(kvm->arch.mmu.vtcr);
> +	realm->sro = kmalloc_obj(*realm->sro);
> +	if (!realm->sro)
> +		return -ENOMEM;

[Severity: Low]
Should realm->sro be allocated with GFP_KERNEL_ACCOUNT?

kmalloc_obj(*realm->sro) defaults to GFP_KERNEL, so each Realm VM's
struct rmi_sro_state (over 2 KiB, backed by a 4 KiB slab object) bypasses
the memcg accounting used by sibling per-VM allocations on the
kvm_arch_init_vm() path, such as supported_cpus and pgt.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204115725.45272-1-steven.price@arm.com?part=4

  reply	other threads:[~2026-12-04 12:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 11:57 [PATCH v6 00/11] KVM: arm64: CCA: Prepare Realm memory management Steven Price
2026-12-04 11:57 ` [PATCH v6 01/11] KVM: arm64: CCA: Introduce Realms Steven Price
2026-12-04 16:07   ` Kohei Enju
2026-12-04 17:05     ` Steven Price
2026-12-04 11:57 ` [PATCH v6 02/11] KVM: arm64: Pass range filter to stage2_unmap_range Steven Price
2026-12-04 11:57 ` [PATCH v6 03/11] KVM: arm64: Dispatch stage-2 destruction by VM flavor Steven Price
2026-12-04 11:57 ` [PATCH v6 04/11] KVM: arm64: CCA: Add basic infrastructure for creating a realm Steven Price
2026-12-04 12:15   ` sashiko-bot [this message]
2026-12-04 11:57 ` [PATCH v6 05/11] KVM: arm64: CCA: Add Realm RTT mapping and invalidation helpers Steven Price
2026-12-04 12:28   ` sashiko-bot
2026-12-05 11:51     ` Suzuki K Poulose
2026-12-04 11:57 ` [PATCH v6 06/11] KVM: arm64: CCA: Destroy RTTs Steven Price
2026-12-04 12:28   ` sashiko-bot
2026-12-04 11:57 ` [PATCH v6 07/11] KVM: arm64: CCA: Restrict Realm memslots to the lower IPA half Steven Price
2026-12-04 15:48   ` Kohei Enju
2026-12-04 16:27     ` Steven Price
2026-12-04 11:57 ` [PATCH v6 08/11] KVM: arm64: CCA: Advertise private memory support for Realms Steven Price
2026-12-04 12:23   ` sashiko-bot
2026-12-04 11:57 ` [PATCH v6 09/11] KVM: arm64: Select protected VM behaviour by VM flavour Steven Price
2026-12-04 13:21   ` Fuad Tabba
2026-12-04 11:57 ` [PATCH v6 10/11] KVM: arm64: CCA: Support runtime faulting of memory Steven Price
2026-12-04 12:39   ` sashiko-bot
2026-12-04 15:32   ` Kohei Enju
2026-12-04 16:27     ` Steven Price
2026-12-04 11:57 ` [PATCH v6 11/11] KVM: arm64: CCA: Add Realm stage-2 MMU operations Steven Price
2026-12-04 12:44   ` sashiko-bot
2026-12-04 16:30 ` [PATCH v6 00/11] KVM: arm64: CCA: Prepare Realm memory management Kohei Enju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-249773@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=steven.price@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.