[v2] selftests: kvm: Adding config fragments
diff mbox series

Message ID 20190808123140.25583-1-naresh.kamboju@linaro.org
State Mainlined
Commit c096397c78f766db972f923433031f2dec01cae0
Headers show
Series
  • [v2] selftests: kvm: Adding config fragments
Related show

Commit Message

Naresh Kamboju Aug. 8, 2019, 12:31 p.m. UTC
selftests kvm all test cases need pre-required kernel configs for the
tests to get pass.

The KVM tests are skipped without these configs:

        dev_fd = open(KVM_DEV_PATH, O_RDONLY);
        if (dev_fd < 0)
                exit(KSFT_SKIP);

Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
---
 tools/testing/selftests/kvm/config | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 tools/testing/selftests/kvm/config

Comments

Andrew Jones Aug. 8, 2019, 3:10 p.m. UTC | #1
On Thu, Aug 08, 2019 at 01:31:40PM +0100, Naresh Kamboju wrote:
> selftests kvm all test cases need pre-required kernel configs for the
> tests to get pass.
> 
> The KVM tests are skipped without these configs:
> 
>         dev_fd = open(KVM_DEV_PATH, O_RDONLY);
>         if (dev_fd < 0)
>                 exit(KSFT_SKIP);
> 
> Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> ---
>  tools/testing/selftests/kvm/config | 3 +++
>  1 file changed, 3 insertions(+)
>  create mode 100644 tools/testing/selftests/kvm/config
> 
> diff --git a/tools/testing/selftests/kvm/config b/tools/testing/selftests/kvm/config
> new file mode 100644
> index 000000000000..63ed533f73d6
> --- /dev/null
> +++ b/tools/testing/selftests/kvm/config
> @@ -0,0 +1,3 @@
> +CONFIG_KVM=y
> +CONFIG_KVM_INTEL=y
> +CONFIG_KVM_AMD=y
> -- 
> 2.17.1
>

What does the kselftests config file do? I was about to complain that this
would break compiling on non-x86 platforms, but 'make kselftest' and other
forms of invoking the build work fine on aarch64 even with this config
file. So is this just for documentation? If so, then its still obviously
wrong for non-x86 platforms. The only config that makes sense here is KVM.
If the other options need to be documented for x86, then should they get
an additional config file? tools/testing/selftests/kvm/x86_64/config?

Thanks,
drew
Paolo Bonzini Aug. 8, 2019, 4 p.m. UTC | #2
On 08/08/19 17:10, Andrew Jones wrote:
>>
> What does the kselftests config file do? I was about to complain that this
> would break compiling on non-x86 platforms, but 'make kselftest' and other
> forms of invoking the build work fine on aarch64 even with this config
> file. So is this just for documentation? If so, then its still obviously
> wrong for non-x86 platforms. The only config that makes sense here is KVM.
> If the other options need to be documented for x86, then should they get
> an additional config file? tools/testing/selftests/kvm/x86_64/config?

My understanding is that a config file fragment requires some kind of
kconfig invocation to create a full .config file.  When you do that,
unknown configurations are dropped silently.

Paolo
shuah Aug. 8, 2019, 5:22 p.m. UTC | #3
On 8/8/19 6:31 AM, Naresh Kamboju wrote:
> selftests kvm all test cases need pre-required kernel configs for the
> tests to get pass.
> 
> The KVM tests are skipped without these configs:
> 
>          dev_fd = open(KVM_DEV_PATH, O_RDONLY);
>          if (dev_fd < 0)
>                  exit(KSFT_SKIP);
> 

Thanks.

> Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> ---
>   tools/testing/selftests/kvm/config | 3 +++
>   1 file changed, 3 insertions(+)
>   create mode 100644 tools/testing/selftests/kvm/config
> 
> diff --git a/tools/testing/selftests/kvm/config b/tools/testing/selftests/kvm/config
> new file mode 100644
> index 000000000000..63ed533f73d6
> --- /dev/null
> +++ b/tools/testing/selftests/kvm/config
> @@ -0,0 +1,3 @@
> +CONFIG_KVM=y
> +CONFIG_KVM_INTEL=y
> +CONFIG_KVM_AMD=y
> 

Acked-by: Shuah Khan <skhan@linuxfoundation.org>

thanks,
-- Shuah
Naresh Kamboju Aug. 9, 2019, 7:27 a.m. UTC | #4
On Thu, 8 Aug 2019 at 20:40, Andrew Jones <drjones@redhat.com> wrote:
>
> On Thu, Aug 08, 2019 at 01:31:40PM +0100, Naresh Kamboju wrote:
> > selftests kvm all test cases need pre-required kernel configs for the
> > tests to get pass.
> >
> > The KVM tests are skipped without these configs:
> >
> >         dev_fd = open(KVM_DEV_PATH, O_RDONLY);
> >         if (dev_fd < 0)
> >                 exit(KSFT_SKIP);
> >
> > Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> > ---
> >  tools/testing/selftests/kvm/config | 3 +++
> >  1 file changed, 3 insertions(+)
> >  create mode 100644 tools/testing/selftests/kvm/config
> >
> > diff --git a/tools/testing/selftests/kvm/config b/tools/testing/selftests/kvm/config
> > new file mode 100644
> > index 000000000000..63ed533f73d6
> > --- /dev/null
> > +++ b/tools/testing/selftests/kvm/config
> > @@ -0,0 +1,3 @@
> > +CONFIG_KVM=y
> > +CONFIG_KVM_INTEL=y
> > +CONFIG_KVM_AMD=y
> > --
> > 2.17.1
> >
>
> What does the kselftests config file do? I was about to complain that this
> would break compiling on non-x86 platforms, but 'make kselftest' and other
> forms of invoking the build work fine on aarch64 even with this config
> file. So is this just for documentation? If so, then its still obviously
> wrong for non-x86 platforms. The only config that makes sense here is KVM.
> If the other options need to be documented for x86, then should they get
> an additional config file? tools/testing/selftests/kvm/x86_64/config?

Addressed your comments and sent out v3 patch.
Thank for the review.

- Naresh
Naresh Kamboju Aug. 9, 2019, 7:35 a.m. UTC | #5
On Thu, 8 Aug 2019 at 21:30, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 08/08/19 17:10, Andrew Jones wrote:
> >>
> > What does the kselftests config file do? I was about to complain that this
> > would break compiling on non-x86 platforms, but 'make kselftest' and other
> > forms of invoking the build work fine on aarch64 even with this config
> > file. So is this just for documentation? If so, then its still obviously
> > wrong for non-x86 platforms. The only config that makes sense here is KVM.
> > If the other options need to be documented for x86, then should they get
> > an additional config file? tools/testing/selftests/kvm/x86_64/config?
>
> My understanding is that a config file fragment requires some kind of
> kconfig invocation to create a full .config file.  When you do that,
> unknown configurations are dropped silently.

You are right on this point. As you said, unknown configs getting dropped for
arm64 cross compilation.

- Naresh

Patch
diff mbox series

diff --git a/tools/testing/selftests/kvm/config b/tools/testing/selftests/kvm/config
new file mode 100644
index 000000000000..63ed533f73d6
--- /dev/null
+++ b/tools/testing/selftests/kvm/config
@@ -0,0 +1,3 @@ 
+CONFIG_KVM=y
+CONFIG_KVM_INTEL=y
+CONFIG_KVM_AMD=y