All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v4 1/3] KVM: PPC: selftests: add support for powerpc
Date: Fri, 11 Sep 2026 05:06:51 +0000	[thread overview]
Message-ID: <20260911050651.A81181F000FF@smtp.kernel.org> (raw)
In-Reply-To: <4120e30a5f69e6480738f60d113033921579c32c.1789097569.git.ritesh.list@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The patch relies on a missing KVM selftests core infrastructure patch, leading to undefined function calls and a build failure.
--

commit abd17de4492c780fa3b8540774bca368e3f9baa2
Author: Nicholas Piggin <npiggin@gmail.com>

KVM: PPC: selftests: add support for powerpc

This commit implements KVM selftests support for powerpc (Book3S-64),
including virtual memory for the radix MMU and guest interrupt handling
in real-mode. It also updates various types and adapts to the new page
table allocator APIs.

Link: https://lore.kernel.org/linuxppc-dev/cover.1781093720.git.ritesh.list@gmail.com/

> diff --git a/tools/testing/selftests/kvm/lib/powerpc/processor.c b/tools/testing/selftests/kvm/lib/powerpc/processor.c
> new file mode 100644
> index 0000000000000..57f8d90b55e3d
> --- /dev/null
> +++ b/tools/testing/selftests/kvm/lib/powerpc/processor.c

[ ... ]

> +void virt_arch_pgd_alloc(struct kvm_vm *vm)
> +{
> +	struct kvm_ppc_mmuv3_cfg mmu_cfg;
> +	gpa_t prtb, pgtb;
> +	size_t pgd_pages;
> +
> +	TEST_ASSERT((vm->mode == VM_MODE_P52V52_4K) ||
> +		    (vm->mode == VM_MODE_P52V52_64K),
> +		    "Unsupported guest mode, mode: 0x%x", vm->mode);
> +
> +	if (vm->mmu.pgd_created)
> +		return;
> +
> +	prtb = vm_alloc_page_table(vm);
> +	vm->arch.prtb = prtb;
> +
> +	pgd_pages = (1UL << (RADIX_PGD_INDEX_SIZE + 3)) >> vm->page_shift;
> +	if (!pgd_pages)
> +		pgd_pages = 1;
> +	pgtb = vm_alloc_page_table_pages(vm, pgd_pages);

[Severity: Low]
Are we missing a prerequisite patch for the selftests core infrastructure?
Building the tests for powerpc fails in virt_arch_pgd_alloc() because
vm_alloc_page_table_pages() is undefined.

> +	vm->mmu.pgd = pgtb;
> +
> +	/* Set the base page directory in the proc table */
> +	set_radix_proc_table(vm, 0, pgtb);

[ ... ]

> +static gpa_t __vm_alloc_pt(struct kvm_vm *vm, u64 pt_shift)
> +{
> +	gpa_t pt;
> +
> +	if (pt_shift >= vm->page_shift) {
> +		size_t pt_pages = 1ULL << (pt_shift - vm->page_shift);
> +
> +		pt = vm_alloc_page_table_pages(vm, pt_pages);

[Severity: Low]
Is the definition for vm_alloc_page_table_pages() missing from the tree?
Calling this in __vm_alloc_pt() leads to an undefined function build failure.

> +	} else {
> +		struct vm_pt_frag_cache *pt_frag_cache;

[ ... ]

> +void kvm_arch_vm_post_create(struct kvm_vm *vm, unsigned int nr_vcpus)
> +{
> +	size_t excp_size = __interrupts_end - __interrupts_start;
> +	size_t excp_pages = (excp_size + vm->page_size - 1) / vm->page_size;
> +	gpa_t excp_paddr;
> +	void *mem;
> +
> +	/*
> +	 * Guest interrupts are taken in real-mode, i.e. the vectors must live
> +	 * at gPA 0.  Use the innermost allocator to override the minimum GPA
> +	 * that MEM_REGION_DATA would otherwise impose.
> +	 */
> +	excp_paddr = ____vm_phy_pages_alloc(vm, excp_pages, 0,
> +					    vm->memslots[MEM_REGION_DATA],
> +					    vm_arch_has_protected_memory(vm),
> +					    false);

[Severity: Low]
Is the definition for ____vm_phy_pages_alloc() with 6 arguments missing?
Calling this undefined function in kvm_arch_vm_post_create() causes a build
failure when compiling the powerpc KVM selftests.

> +
> +	TEST_ASSERT(excp_paddr == 0,
> +		    "Interrupt vectors not allocated at gPA address 0: (0x%lx)",
> +		    excp_paddr);
> +
> +	mem = addr_gpa2hva(vm, excp_paddr);
> +	memcpy(mem, __interrupts_start, excp_size);
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1789097569.git.ritesh.list@gmail.com?part=1

  reply	other threads:[~2026-09-11  5:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11  4:48 [PATCH v4 0/3] KVM: selftests: add powerpc support Ritesh Harjani (IBM)
2026-09-11  4:48 ` [PATCH v4 1/3] KVM: PPC: selftests: add support for powerpc Ritesh Harjani (IBM)
2026-09-11  5:06   ` sashiko-bot [this message]
2026-09-11  4:48 ` [PATCH v4 2/3] KVM: selftests: Enable kvm_create_max_vcpus test " Ritesh Harjani (IBM)
2026-09-11  4:48 ` [PATCH v4 3/3] KVM: selftests: Don't limit LE dirty-bitmap bitops to s390x Ritesh Harjani (IBM)

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=20260911050651.A81181F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=ritesh.list@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.