diff mbox series

KVM: selftests: Enable USERFAULTFD

Message ID 20230202-kvm-selftest-userfaultfd-v1-1-8186ac5a33a5@kernel.org (mailing list archive)
State New, archived
Headers show
Series KVM: selftests: Enable USERFAULTFD | expand

Commit Message

Mark Brown Feb. 2, 2023, 9:01 p.m. UTC
The page_fault_test KVM selftest requires userfaultfd but the config
fragment for the KVM selftests does not enable it, meaning that those tests
are skipped in CI systems that rely on appropriate settings in the config
fragments except on S/390 which happens to have it in defconfig. Enable
the option in the config fragment so that the tests get run.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/kvm/config | 1 +
 1 file changed, 1 insertion(+)


---
base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2
change-id: 20230202-kvm-selftest-userfaultfd-ea85a8b5f873

Best regards,

Comments

Oliver Upton Feb. 6, 2023, 5:09 p.m. UTC | #1
+cc x86, riscv as they're also affected.

On Thu, Feb 02, 2023 at 09:01:36PM +0000, Mark Brown wrote:
> The page_fault_test KVM selftest requires userfaultfd but the config
> fragment for the KVM selftests does not enable it, meaning that those tests
> are skipped in CI systems that rely on appropriate settings in the config
> fragments except on S/390 which happens to have it in defconfig. Enable
> the option in the config fragment so that the tests get run.

Thanks for catching this.

I believe we also need UFFD for demand_paging_test, which is used by all
the KVM selftests arches. I plan on picking this up, but if anyone has
objections please shout :)

--
Thanks,
Oliver

> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>  tools/testing/selftests/kvm/config | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/testing/selftests/kvm/config b/tools/testing/selftests/kvm/config
> index 63ed533f73d6..d011b38e259e 100644
> --- a/tools/testing/selftests/kvm/config
> +++ b/tools/testing/selftests/kvm/config
> @@ -1,3 +1,4 @@
>  CONFIG_KVM=y
>  CONFIG_KVM_INTEL=y
>  CONFIG_KVM_AMD=y
> +CONFIG_USERFAULTFD=y
> 
> ---
> base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2
> change-id: 20230202-kvm-selftest-userfaultfd-ea85a8b5f873
> 
> Best regards,
> -- 
> Mark Brown <broonie@kernel.org>
>
Sean Christopherson Feb. 6, 2023, 6:15 p.m. UTC | #2
On Mon, Feb 06, 2023, Oliver Upton wrote:
> +cc x86, riscv as they're also affected.
> 
> On Thu, Feb 02, 2023 at 09:01:36PM +0000, Mark Brown wrote:
> > The page_fault_test KVM selftest requires userfaultfd but the config
> > fragment for the KVM selftests does not enable it, meaning that those tests
> > are skipped in CI systems that rely on appropriate settings in the config
> > fragments except on S/390 which happens to have it in defconfig. Enable
> > the option in the config fragment so that the tests get run.

What do CI systems do for HugeTLB and THP?  Those are the other config options I
can think of where there are very interesting interactions from a KVM perspective,
but where KVM doesn't have a strict dependency on the feature.

E.g. x86_64_defconfig selects CONFIG_HUGETLBFS=y, but I don't see anything for THP,
and AFAICT TRANSPARENT_HUGEPAGE is default=n.

> Thanks for catching this.
> 
> I believe we also need UFFD for demand_paging_test, which is used by all
> the KVM selftests arches. I plan on picking this up, but if anyone has
> objections please shout :)

All yours.

Reviewed-by: Sean Christopherson <seanjc@google.com>
Oliver Upton Feb. 6, 2023, 7:49 p.m. UTC | #3
On Mon, Feb 06, 2023 at 06:15:16PM +0000, Sean Christopherson wrote:
> On Mon, Feb 06, 2023, Oliver Upton wrote:
> > +cc x86, riscv as they're also affected.
> > 
> > On Thu, Feb 02, 2023 at 09:01:36PM +0000, Mark Brown wrote:
> > > The page_fault_test KVM selftest requires userfaultfd but the config
> > > fragment for the KVM selftests does not enable it, meaning that those tests
> > > are skipped in CI systems that rely on appropriate settings in the config
> > > fragments except on S/390 which happens to have it in defconfig. Enable
> > > the option in the config fragment so that the tests get run.
> 
> What do CI systems do for HugeTLB and THP?  Those are the other config options I
> can think of where there are very interesting interactions from a KVM perspective,
> but where KVM doesn't have a strict dependency on the feature.
> 
> E.g. x86_64_defconfig selects CONFIG_HUGETLBFS=y, but I don't see anything for THP,
> and AFAICT TRANSPARENT_HUGEPAGE is default=n.

Looks like arm64 defconfig enables THP and hugetlb. Regardless, I think
it would be valuable if our Kconfig fragment expressed the options that
buy us additional code coverage.

--
Thanks,
Oliver
Mark Brown Feb. 6, 2023, 9:10 p.m. UTC | #4
On Mon, Feb 06, 2023 at 06:15:16PM +0000, Sean Christopherson wrote:

> What do CI systems do for HugeTLB and THP?  Those are the other config options I
> can think of where there are very interesting interactions from a KVM perspective,
> but where KVM doesn't have a strict dependency on the feature.

> E.g. x86_64_defconfig selects CONFIG_HUGETLBFS=y, but I don't see anything for THP,
> and AFAICT TRANSPARENT_HUGEPAGE is default=n.

Most likely they'll either just go with defconfig plus whatever's in the
fragement, or they'll lump all the kselftest fragments together (which
isn't ideal but cuts down on the number of kernels you have to build).
If someone's specifically set something up for KVM they might do more
combinations.
Oliver Upton Feb. 8, 2023, 5:30 p.m. UTC | #5
On Thu, 02 Feb 2023 21:01:36 +0000, Mark Brown wrote:
> The page_fault_test KVM selftest requires userfaultfd but the config
> fragment for the KVM selftests does not enable it, meaning that those tests
> are skipped in CI systems that rely on appropriate settings in the config
> fragments except on S/390 which happens to have it in defconfig. Enable
> the option in the config fragment so that the tests get run.
> 
> 
> [...]

Applied to kvmarm/next, thanks!

[1/1] KVM: selftests: Enable USERFAULTFD
      https://git.kernel.org/kvmarm/kvmarm/c/d23650547819

--
Best,
Oliver
diff mbox series

Patch

diff --git a/tools/testing/selftests/kvm/config b/tools/testing/selftests/kvm/config
index 63ed533f73d6..d011b38e259e 100644
--- a/tools/testing/selftests/kvm/config
+++ b/tools/testing/selftests/kvm/config
@@ -1,3 +1,4 @@ 
 CONFIG_KVM=y
 CONFIG_KVM_INTEL=y
 CONFIG_KVM_AMD=y
+CONFIG_USERFAULTFD=y