diff mbox series

[02/20] KVM: selftests: Bump the minimum GPA for page tables to 0x200000

Message ID 20260826230511.972824-3-seanjc@google.com
State New
Headers show
Series KVM: selftests: PPC pre-enabling | expand

Commit Message

Sean Christopherson Aug. 26, 2026, 11:04 p.m. UTC
Bump selftests completely arbitrary minimum GPA for page tables from
0x180000 to 0x200000 (LoongArch's minimum), so that LoongArch can use
vm_alloc_page_table() instead of open coding a rough equivalent.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 tools/testing/selftests/kvm/include/kvm_util.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Claudio Imbrenda Aug. 28, 2026, 5:58 p.m. UTC | #1
On Wed, 26 Aug 2026 16:04:53 -0700
Sean Christopherson <seanjc@google.com> wrote:

> Bump selftests completely arbitrary minimum GPA for page tables from
> 0x180000 to 0x200000 (LoongArch's minimum), so that LoongArch can use
> vm_alloc_page_table() instead of open coding a rough equivalent.
> 
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
>  tools/testing/selftests/kvm/include/kvm_util.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h
> index 5a7a455b5387..70906a0d1003 100644
> --- a/tools/testing/selftests/kvm/include/kvm_util.h
> +++ b/tools/testing/selftests/kvm/include/kvm_util.h
> @@ -175,7 +175,7 @@ static inline struct userspace_mem_region *vm_get_mem_region(struct kvm_vm *vm,
>  
>  /* Minimum allocated guest virtual and physical addresses */
>  #define KVM_UTIL_MIN_VADDR		0x2000
> -#define KVM_GUEST_PAGE_TABLE_MIN_PADDR	0x180000
> +#define KVM_GUEST_PAGE_TABLE_MIN_PADDR	0x200000
>  
>  #define DEFAULT_GUEST_STACK_VADDR_MIN	0xab6000
>  #define DEFAULT_STACK_PGS		5

this breaks s390/cmma_test

I tried a quick fix, but nope... I will need to actually invest some
time (i.e. next week) to understand why the quick fix is not enough,
and come up with a proper fix

the good news is: it seems like cmma_test is the only test that is
negatively affected by this series.
Sean Christopherson Aug. 28, 2026, 6:07 p.m. UTC | #2
On Fri, Aug 28, 2026, Claudio Imbrenda wrote:
> On Wed, 26 Aug 2026 16:04:53 -0700
> Sean Christopherson <seanjc@google.com> wrote:
> 
> > Bump selftests completely arbitrary minimum GPA for page tables from
> > 0x180000 to 0x200000 (LoongArch's minimum), so that LoongArch can use
> > vm_alloc_page_table() instead of open coding a rough equivalent.
> > 
> > Signed-off-by: Sean Christopherson <seanjc@google.com>
> > ---
> >  tools/testing/selftests/kvm/include/kvm_util.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h
> > index 5a7a455b5387..70906a0d1003 100644
> > --- a/tools/testing/selftests/kvm/include/kvm_util.h
> > +++ b/tools/testing/selftests/kvm/include/kvm_util.h
> > @@ -175,7 +175,7 @@ static inline struct userspace_mem_region *vm_get_mem_region(struct kvm_vm *vm,
> >  
> >  /* Minimum allocated guest virtual and physical addresses */
> >  #define KVM_UTIL_MIN_VADDR		0x2000
> > -#define KVM_GUEST_PAGE_TABLE_MIN_PADDR	0x180000
> > +#define KVM_GUEST_PAGE_TABLE_MIN_PADDR	0x200000
> >  
> >  #define DEFAULT_GUEST_STACK_VADDR_MIN	0xab6000
> >  #define DEFAULT_STACK_PGS		5
> 
> this breaks s390/cmma_test
> 
> I tried a quick fix, but nope... I will need to actually invest some
> time (i.e. next week) to understand why the quick fix is not enough,
> and come up with a proper fix
> 
> the good news is: it seems like cmma_test is the only test that is
> negatively affected by this series.

Is it this change specifically that's problematic?  Because if so, you can probably
just do nothing, because Sashiko (argh, just remembered that Sashiko doesn't Cc
everyone) pointed out that this will likely break some arm64 tests as well[*].

The LoongArch folks confirmed that using KVM_GUEST_PAGE_TABLE_MIN_PADDR as-is
should be a-ok, so my plan is to drop this patch and instead have LoongArch use
KVM_GUEST_PAGE_TABLE_MIN_PADDR.  I.e. make LoongArch match everyone else, instead
of making everyone else match LoongArch.

[*] https://lore.kernel.org/all/20260826232224.782021F000E9@smtp.kernel.org
Claudio Imbrenda Aug. 31, 2026, 11:34 a.m. UTC | #3
On Fri, 28 Aug 2026 11:07:34 -0700
Sean Christopherson <seanjc@google.com> wrote:

> On Fri, Aug 28, 2026, Claudio Imbrenda wrote:
> > On Wed, 26 Aug 2026 16:04:53 -0700
> > Sean Christopherson <seanjc@google.com> wrote:
> >   
> > > Bump selftests completely arbitrary minimum GPA for page tables from
> > > 0x180000 to 0x200000 (LoongArch's minimum), so that LoongArch can use
> > > vm_alloc_page_table() instead of open coding a rough equivalent.
> > > 
> > > Signed-off-by: Sean Christopherson <seanjc@google.com>
> > > ---
> > >  tools/testing/selftests/kvm/include/kvm_util.h | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h
> > > index 5a7a455b5387..70906a0d1003 100644
> > > --- a/tools/testing/selftests/kvm/include/kvm_util.h
> > > +++ b/tools/testing/selftests/kvm/include/kvm_util.h
> > > @@ -175,7 +175,7 @@ static inline struct userspace_mem_region *vm_get_mem_region(struct kvm_vm *vm,
> > >  
> > >  /* Minimum allocated guest virtual and physical addresses */
> > >  #define KVM_UTIL_MIN_VADDR		0x2000
> > > -#define KVM_GUEST_PAGE_TABLE_MIN_PADDR	0x180000
> > > +#define KVM_GUEST_PAGE_TABLE_MIN_PADDR	0x200000
> > >  
> > >  #define DEFAULT_GUEST_STACK_VADDR_MIN	0xab6000
> > >  #define DEFAULT_STACK_PGS		5  
> > 
> > this breaks s390/cmma_test
> > 
> > I tried a quick fix, but nope... I will need to actually invest some
> > time (i.e. next week) to understand why the quick fix is not enough,
> > and come up with a proper fix
> > 
> > the good news is: it seems like cmma_test is the only test that is
> > negatively affected by this series.  
> 
> Is it this change specifically that's problematic?  Because if so, you can probably

yesn't

wihtout this patch everything works for s390, but my quick fix should
have worked...

so I still need to debug why things don't work the way I expect, but at
least now my bug chase is independent from this series :)

> just do nothing, because Sashiko (argh, just remembered that Sashiko doesn't Cc
> everyone) pointed out that this will likely break some arm64 tests as well[*].
> 
> The LoongArch folks confirmed that using KVM_GUEST_PAGE_TABLE_MIN_PADDR as-is
> should be a-ok, so my plan is to drop this patch and instead have LoongArch use
> KVM_GUEST_PAGE_TABLE_MIN_PADDR.  I.e. make LoongArch match everyone else, instead
> of making everyone else match LoongArch.
> 
> [*] https://lore.kernel.org/all/20260826232224.782021F000E9@smtp.kernel.org
> 

if you respin without this patch I'll Ack
diff mbox series

Patch

diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h
index 5a7a455b5387..70906a0d1003 100644
--- a/tools/testing/selftests/kvm/include/kvm_util.h
+++ b/tools/testing/selftests/kvm/include/kvm_util.h
@@ -175,7 +175,7 @@  static inline struct userspace_mem_region *vm_get_mem_region(struct kvm_vm *vm,
 
 /* Minimum allocated guest virtual and physical addresses */
 #define KVM_UTIL_MIN_VADDR		0x2000
-#define KVM_GUEST_PAGE_TABLE_MIN_PADDR	0x180000
+#define KVM_GUEST_PAGE_TABLE_MIN_PADDR	0x200000
 
 #define DEFAULT_GUEST_STACK_VADDR_MIN	0xab6000
 #define DEFAULT_STACK_PGS		5