2023-02-02 21:02:00

by Mark Brown

[permalink] [raw]
Subject: [PATCH] KVM: selftests: Enable USERFAULTFD

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 <[email protected]>
---
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 <[email protected]>



2023-02-06 17:09:25

by Oliver Upton

[permalink] [raw]
Subject: Re: [PATCH] KVM: selftests: Enable USERFAULTFD

+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 <[email protected]>
> ---
> 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 <[email protected]>
>

--
Thanks,
Oliver

2023-02-06 18:15:27

by Sean Christopherson

[permalink] [raw]
Subject: Re: [PATCH] KVM: selftests: Enable USERFAULTFD

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 <[email protected]>

2023-02-06 19:49:32

by Oliver Upton

[permalink] [raw]
Subject: Re: [PATCH] KVM: selftests: Enable USERFAULTFD

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

2023-02-06 21:10:22

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] KVM: selftests: Enable USERFAULTFD

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.


Attachments:
(No filename) (738.00 B)
signature.asc (488.00 B)
Download all attachments

2023-02-08 17:30:46

by Oliver Upton

[permalink] [raw]
Subject: Re: [PATCH] KVM: selftests: Enable USERFAULTFD

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