That's an open question: do we want to be able to build selftests against any host headers, and not the in-tree headers that have to be manually installed and dirty the git tree?
One obvious drawbacks is that we'll have to deal with all that using a bunch of #ifdef, and the tests that will be built+run will depend on the host headers.
Especially the letter is relevant I think: Our upstream testing won't be able to build+run tests that rely on new upstream features. But that's what some key benefit of these selftests, and being able to run them automatically on a bunch of different combinations upstream.
Further, the tests are closely related to the given kernel version, they are not some completely separate tests.
Moving the the (MM?) selftests to a separate repository would make the decision easier: just like in QEMU etc, we'd simply pull in a headers update and only build against these archived headers.
So I see the options:
(1) Rely on installing the proper in-tree headers. Build will fail if
that is not happening.
(2) Make the tests build with any host headers.
(3) Regularly archive the required headers in the selftest directory
like external projects like QEMU do.