Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tharit Tangkijwanichakul" <tharitt97@gmail.com>
Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev,
	"Oliver Upton" <oupton@kernel.org>,
	"Marc Zyngier" <maz@kernel.org>
Subject: Re: [PATCH 1/5] KVM: selftests: Introduce a shared base for test memslots
Date: Sat, 17 Oct 2026 11:14:17 +0000	[thread overview]
Message-ID: <sashiko-outbox-175484@kernel.org> (raw)
In-Reply-To: <20261017110213.46199-2-tharitt97@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] KVM: selftests: missing TEST_MEM_SLOT_BASE conversion in arm64/vgic_v5.c
--

commit ad2bd092653828da36ea26266908671dbd05d3f3
Author: Tharit Tangkijwanichakul <tharitt97@gmail.com>

KVM: selftests: Introduce a shared base for test memslots

This commit introduces TEST_MEM_SLOT_BASE and replaces hardcoded memslot 1
assignments across KVM selftests to prepare for reserving slot 1 for library
use.

[ ... ]

> diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h
> index 5a7a455b53875..759d604d44ce9 100644
> --- a/tools/testing/selftests/kvm/include/kvm_util.h
> +++ b/tools/testing/selftests/kvm/include/kvm_util.h
> @@ -30,6 +30,7 @@
>  
>  #define KVM_DEV_PATH "/dev/kvm"
>  #define KVM_MAX_VCPUS 512
> +#define TEST_MEM_SLOT_BASE 1
>  
>  #define NSEC_PER_SEC 1000000000L
>  

[Severity: Medium]
Should tools/testing/selftests/kvm/arm64/vgic_v5.c also be updated to use
TEST_MEM_SLOT_BASE?

Currently it defines VGIC_V5_LPI_MEMSLOT as 1:

tools/testing/selftests/kvm/arm64/vgic_v5.c:
    #define VGIC_V5_LPI_MEMSLOT	1

and in vgic_v5_lpi_ist_vm_create(), it creates the VM with __vm_create() and
adds the LPI IST memslot at VGIC_V5_LPI_MEMSLOT:

    v->vm = __vm_create(VM_SHAPE_DEFAULT, VGIC_V5_LPI_NR_VCPUS, 0);
    ...
    vm_userspace_mem_region_add(v->vm, VM_MEM_SRC_ANONYMOUS,
                                VGIC_V5_LPI_IST_BASE_GPA,
                                VGIC_V5_LPI_MEMSLOT,
                                nr_lpi_ist_pages, 0);

Once the follow-up commit ("KVM: selftests: Reserve memslot 1 for the ucall
MMIO address") reserves slot 1 (KVM_UCALL_MEMSLOT) inside __vm_create() when
KVM_CAP_READONLY_MEM is supported (which is unconditionally enabled on
arm64), won't test_vgic_v5_lpis() and test_vgic_v5_ist_save_restore()
collide on slot 1 and fail in vm_mem_add() with TEST_FAIL() because the
memslot already exists in vm->regions.slot_hash?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261017110213.46199-1-tharitt97@gmail.com?part=1

  reply	other threads:[~2026-10-17 11:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-17 11:02 [PATCH 0/5] KVM: selftests: Reserve memslot 1 for ucall MMIO Tharit Tangkijwanichakul
2026-10-17 11:02 ` [PATCH 1/5] KVM: selftests: Introduce a shared base for test memslots Tharit Tangkijwanichakul
2026-10-17 11:14   ` sashiko-bot [this message]
2026-10-17 11:02 ` [PATCH 2/5] KVM: selftests: Use the shared memslot base in memslot_perf_test Tharit Tangkijwanichakul
2026-10-17 11:02 ` [PATCH 3/5] KVM: selftests: Use the shared memslot base in memstress Tharit Tangkijwanichakul
2026-10-17 11:02 ` [PATCH 4/5] KVM: selftests: Reserve memslot 1 for the ucall MMIO address Tharit Tangkijwanichakul
2026-10-17 11:19   ` sashiko-bot
2026-10-17 11:02 ` [PATCH 5/5] KVM: selftests: Test protection of the ucall MMIO region Tharit Tangkijwanichakul
2026-10-17 11:16   ` sashiko-bot

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-175484@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=tharitt97@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox