linux-next: build failure after merge of the kvm-x86 tree

Mark Brown posted 1 patch 1 week, 1 day ago
tools/testing/selftests/kvm/arm64/vgic_its_save.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
linux-next: build failure after merge of the kvm-x86 tree
Posted by Mark Brown 1 week, 1 day ago
Hi all,

After merging the kvm-x86 tree, today's linux-next build
(arm64 kselftest) failed like this:

arm64/vgic_its_save.c: In function 'alloc_64k':
arm64/vgic_its_save.c:289:21: error: too many arguments to function
'vm_phy_pages_alloc'
  289 |         gpa_t gpa = vm_phy_pages_alloc(vm, nr * pages_per_64k, gpa_base,
      |                     ^~~~~~~~~~~~~~~~~~
In file included from arm64/vgic_its_save.c:24:
include/kvm_util.h:1062:21: note: declared here
 1062 | static inline gpa_t vm_phy_pages_alloc(struct kvm_vm *vm, size_t nr_pages,
      |                     ^~~~~~~~~~~~~~~~~~

Caused by commits

  36a062568ea80 (KVM: selftests: Take the memory region type, not memslot, in page allocators)
  6c28a0d7cf125 (KVM: selftests: Automatically pick min_gpa for allocations based on region type)

interacting with commit

  6f182db39fb00 (KVM: arm64: selftests: Add ITS table save tests)

from the kvm-arm tree.  I have applied the fixup below and can carry as
needed:

From ceedc17041d689c99453d14f867d6b0badc8da8b Mon Sep 17 00:00:00 2001
From: Mark Brown <broonie@kernel.org>
Date: Wed, 16 Sep 2026 14:18:38 +0100
Subject: [PATCH] KVM: selftests: Fix up phy_pages_alloc() API rework
 interaction

arm64/vgic_its_save.c: In function 'alloc_64k':
arm64/vgic_its_save.c:289:21: error: too many arguments to function
'vm_phy_pages_alloc'
  289 |         gpa_t gpa = vm_phy_pages_alloc(vm, nr * pages_per_64k, gpa_base,
      |                     ^~~~~~~~~~~~~~~~~~
In file included from arm64/vgic_its_save.c:24:
include/kvm_util.h:1062:21: note: declared here
 1062 | static inline gpa_t vm_phy_pages_alloc(struct kvm_vm *vm, size_t nr_pages,
      |                     ^~~~~~~~~~~~~~~~~~

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/kvm/arm64/vgic_its_save.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/kvm/arm64/vgic_its_save.c b/tools/testing/selftests/kvm/arm64/vgic_its_save.c
index 864da01539f3f..9a8a65fd7196b 100644
--- a/tools/testing/selftests/kvm/arm64/vgic_its_save.c
+++ b/tools/testing/selftests/kvm/arm64/vgic_its_save.c
@@ -286,8 +286,8 @@ static void setup_memslot(size_t sz)
 static gpa_t alloc_64k(size_t nr)
 {
 	size_t pages_per_64k = vm_calc_num_guest_pages(vm->mode, SZ_64K);
-	gpa_t gpa = vm_phy_pages_alloc(vm, nr * pages_per_64k, gpa_base,
-				       TEST_MEMSLOT_INDEX);
+	gpa_t gpa = vm_phy_pages_alloc(vm, nr * pages_per_64k,
+				       MEM_REGION_TEST_EXTRA);
 
 	TEST_ASSERT(IS_ALIGNED(gpa, SZ_64K),
 		    "Allocation at 0x%lx is not 64K aligned, GITS_BASER cannot address it",
-- 
2.47.3

Re: linux-next: build failure after merge of the kvm-x86 tree
Posted by Sean Christopherson 1 week, 1 day ago
On Wed, Sep 16, 2026, Mark Brown wrote:
> Hi all,
> 
> After merging the kvm-x86 tree, today's linux-next build
> (arm64 kselftest) failed like this:
> 
> arm64/vgic_its_save.c: In function 'alloc_64k':
> arm64/vgic_its_save.c:289:21: error: too many arguments to function
> 'vm_phy_pages_alloc'
>   289 |         gpa_t gpa = vm_phy_pages_alloc(vm, nr * pages_per_64k, gpa_base,
>       |                     ^~~~~~~~~~~~~~~~~~
> In file included from arm64/vgic_its_save.c:24:
> include/kvm_util.h:1062:21: note: declared here
>  1062 | static inline gpa_t vm_phy_pages_alloc(struct kvm_vm *vm, size_t nr_pages,
>       |                     ^~~~~~~~~~~~~~~~~~
> 
> Caused by commits
> 
>   36a062568ea80 (KVM: selftests: Take the memory region type, not memslot, in page allocators)
>   6c28a0d7cf125 (KVM: selftests: Automatically pick min_gpa for allocations based on region type)

In case anyone cares, I'm woefully behind on sending "thanks".  These came from
the prep series for enabling PPC selftests.

https://lore.kernel.org/all/20260826230511.972824-1-seanjc@google.com

> interacting with commit
> 
>   6f182db39fb00 (KVM: arm64: selftests: Add ITS table save tests)
> 
> from the kvm-arm tree.  I have applied the fixup below and can carry as
> needed:

Given that this is in "fixes", I assume the new test will land in 7.3?  If so,
this is mostly my problem to deal with when sending Paolo the selftests pull
(which, FWIW, I'm hoping to do this week so that it can be used as the base for
PPC selftests support). 

> diff --git a/tools/testing/selftests/kvm/arm64/vgic_its_save.c b/tools/testing/selftests/kvm/arm64/vgic_its_save.c
> index 864da01539f3f..9a8a65fd7196b 100644
> --- a/tools/testing/selftests/kvm/arm64/vgic_its_save.c
> +++ b/tools/testing/selftests/kvm/arm64/vgic_its_save.c
> @@ -286,8 +286,8 @@ static void setup_memslot(size_t sz)
>  static gpa_t alloc_64k(size_t nr)
>  {
>  	size_t pages_per_64k = vm_calc_num_guest_pages(vm->mode, SZ_64K);
> -	gpa_t gpa = vm_phy_pages_alloc(vm, nr * pages_per_64k, gpa_base,
> -				       TEST_MEMSLOT_INDEX);
> +	gpa_t gpa = vm_phy_pages_alloc(vm, nr * pages_per_64k,
> +				       MEM_REGION_TEST_EXTRA);

The test also needs to override/define the memory region.  Not fully tested, but
I think it's this:

diff --git a/tools/testing/selftests/kvm/arm64/vgic_its_save.c b/tools/testing/selftests/kvm/arm64/vgic_its_save.c
index 864da01539f3..fae8a6c45f88 100644
--- a/tools/testing/selftests/kvm/arm64/vgic_its_save.c
+++ b/tools/testing/selftests/kvm/arm64/vgic_its_save.c
@@ -279,15 +279,15 @@ static void setup_memslot(size_t sz)
 	size_t pages = sz / vm->page_size;
 
 	gpa_base = ((vm_compute_max_gfn(vm) + 1) * vm->page_size) - sz;
-	vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS, gpa_base,
-				    TEST_MEMSLOT_INDEX, pages, 0);
+	vm_override_mem_region(vm, MEM_REGION_TEST_EXTRA, VM_MEM_SRC_ANONYMOUS,
+			       gpa_base, TEST_MEMSLOT_INDEX, pages);
 }
 
 static gpa_t alloc_64k(size_t nr)
 {
 	size_t pages_per_64k = vm_calc_num_guest_pages(vm->mode, SZ_64K);
-	gpa_t gpa = vm_phy_pages_alloc(vm, nr * pages_per_64k, gpa_base,
-				       TEST_MEMSLOT_INDEX);
+	gpa_t gpa = vm_phy_pages_alloc(vm, nr * pages_per_64k,
+				       MEM_REGION_TEST_EXTRA);
 
 	TEST_ASSERT(IS_ALIGNED(gpa, SZ_64K),
 		    "Allocation at 0x%lx is not 64K aligned, GITS_BASER cannot address it",
Re: linux-next: build failure after merge of the kvm-x86 tree
Posted by Oliver Upton 1 week, 1 day ago
Hey,

On Wed, Sep 16, 2026 at 07:04:49AM -0700, Sean Christopherson wrote:
> On Wed, Sep 16, 2026, Mark Brown wrote:
> > Hi all,
> > 
> > After merging the kvm-x86 tree, today's linux-next build
> > (arm64 kselftest) failed like this:
> > 
> > arm64/vgic_its_save.c: In function 'alloc_64k':
> > arm64/vgic_its_save.c:289:21: error: too many arguments to function
> > 'vm_phy_pages_alloc'
> >   289 |         gpa_t gpa = vm_phy_pages_alloc(vm, nr * pages_per_64k, gpa_base,
> >       |                     ^~~~~~~~~~~~~~~~~~
> > In file included from arm64/vgic_its_save.c:24:
> > include/kvm_util.h:1062:21: note: declared here
> >  1062 | static inline gpa_t vm_phy_pages_alloc(struct kvm_vm *vm, size_t nr_pages,
> >       |                     ^~~~~~~~~~~~~~~~~~
> > 
> > Caused by commits
> > 
> >   36a062568ea80 (KVM: selftests: Take the memory region type, not memslot, in page allocators)
> >   6c28a0d7cf125 (KVM: selftests: Automatically pick min_gpa for allocations based on region type)
> 
> In case anyone cares, I'm woefully behind on sending "thanks".  These came from
> the prep series for enabling PPC selftests.
> 
> https://lore.kernel.org/all/20260826230511.972824-1-seanjc@google.com
> 
> > interacting with commit
> > 
> >   6f182db39fb00 (KVM: arm64: selftests: Add ITS table save tests)
> > 
> > from the kvm-arm tree.  I have applied the fixup below and can carry as
> > needed:
> 
> Given that this is in "fixes", I assume the new test will land in 7.3?  If so,
> this is mostly my problem to deal with when sending Paolo the selftests pull
> (which, FWIW, I'm hoping to do this week so that it can be used as the base for
> PPC selftests support). 

Yeah, aim here is to have the selftest go with the fix which I'll send to
Paolo this week. Sorry for the churn.

> diff --git a/tools/testing/selftests/kvm/arm64/vgic_its_save.c b/tools/testing/selftests/kvm/arm64/vgic_its_save.c
> index 864da01539f3..fae8a6c45f88 100644
> --- a/tools/testing/selftests/kvm/arm64/vgic_its_save.c
> +++ b/tools/testing/selftests/kvm/arm64/vgic_its_save.c
> @@ -279,15 +279,15 @@ static void setup_memslot(size_t sz)
>  	size_t pages = sz / vm->page_size;
>  
>  	gpa_base = ((vm_compute_max_gfn(vm) + 1) * vm->page_size) - sz;
> -	vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS, gpa_base,
> -				    TEST_MEMSLOT_INDEX, pages, 0);
> +	vm_override_mem_region(vm, MEM_REGION_TEST_EXTRA, VM_MEM_SRC_ANONYMOUS,
> +			       gpa_base, TEST_MEMSLOT_INDEX, pages);
>  }
>  
>  static gpa_t alloc_64k(size_t nr)
>  {
>  	size_t pages_per_64k = vm_calc_num_guest_pages(vm->mode, SZ_64K);
> -	gpa_t gpa = vm_phy_pages_alloc(vm, nr * pages_per_64k, gpa_base,
> -				       TEST_MEMSLOT_INDEX);
> +	gpa_t gpa = vm_phy_pages_alloc(vm, nr * pages_per_64k,
> +				       MEM_REGION_TEST_EXTRA);
>  
>  	TEST_ASSERT(IS_ALIGNED(gpa, SZ_64K),
>  		    "Allocation at 0x%lx is not 64K aligned, GITS_BASER cannot address it",

LGTM

Thanks,
Oliver
Re: linux-next: build failure after merge of the kvm-x86 tree
Posted by Sean Christopherson 1 week, 1 day ago
On Wed, Sep 16, 2026, Oliver Upton wrote:
> > In case anyone cares, I'm woefully behind on sending "thanks".  These came from
> > the prep series for enabling PPC selftests.
> > 
> > https://lore.kernel.org/all/20260826230511.972824-1-seanjc@google.com
> > 
> > > interacting with commit
> > > 
> > >   6f182db39fb00 (KVM: arm64: selftests: Add ITS table save tests)
> > > 
> > > from the kvm-arm tree.  I have applied the fixup below and can carry as
> > > needed:
> > 
> > Given that this is in "fixes", I assume the new test will land in 7.3?  If so,
> > this is mostly my problem to deal with when sending Paolo the selftests pull
> > (which, FWIW, I'm hoping to do this week so that it can be used as the base for
> > PPC selftests support). 
> 
> Yeah, aim here is to have the selftest go with the fix which I'll send to
> Paolo this week. Sorry for the churn.

LOL, why are you apoligizing?  You added one test, I reworked all of the core
allocator APIs.  :-D
Re: linux-next: build failure after merge of the kvm-x86 tree
Posted by Oliver Upton 1 week, 1 day ago
On Wed, Sep 16, 2026 at 09:43:14AM -0700, Sean Christopherson wrote:
> On Wed, Sep 16, 2026, Oliver Upton wrote:
> > > In case anyone cares, I'm woefully behind on sending "thanks".  These came from
> > > the prep series for enabling PPC selftests.
> > > 
> > > https://lore.kernel.org/all/20260826230511.972824-1-seanjc@google.com
> > > 
> > > > interacting with commit
> > > > 
> > > >   6f182db39fb00 (KVM: arm64: selftests: Add ITS table save tests)
> > > > 
> > > > from the kvm-arm tree.  I have applied the fixup below and can carry as
> > > > needed:
> > > 
> > > Given that this is in "fixes", I assume the new test will land in 7.3?  If so,
> > > this is mostly my problem to deal with when sending Paolo the selftests pull
> > > (which, FWIW, I'm hoping to do this week so that it can be used as the base for
> > > PPC selftests support). 
> > 
> > Yeah, aim here is to have the selftest go with the fix which I'll send to
> > Paolo this week. Sorry for the churn.
> 
> LOL, why are you apoligizing?  You added one test, I reworked all of the core
> allocator APIs.  :-D

I'm pretty sure you've conditioned everyone to endure at least one
KVM-wide rework every release ;-)
Re: linux-next: build failure after merge of the kvm-x86 tree
Posted by Mark Brown 1 week, 1 day ago
On Wed, Sep 16, 2026 at 07:04:49AM -0700, Sean Christopherson wrote:

> The test also needs to override/define the memory region.  Not fully tested, but
> I think it's this:

Thanks for checking, I'll roll your fixup into my resolution tomorrow
unless someone says otherwise.