@@ -5231,6 +5231,45 @@ compile_test() {
52315231
52325232 compile_check_conftest " $CODE " " NV_FOLLOW_PFN_PRESENT" " " " functions"
52335233 ;;
5234+
5235+ follow_pte_arg_vma)
5236+ #
5237+ # Determine if the first argument of follow_pte is
5238+ # mm_struct or vm_area_struct.
5239+ #
5240+ # The first argument was changed from mm_struct to vm_area_struct by
5241+ # commit 29ae7d96d166 ("mm: pass VMA instead of MM to follow_pte()")
5242+ #
5243+ CODE="
5244+ #include <linux/mm.h>
5245+
5246+ typeof(follow_pte) conftest_follow_pte_has_vma_arg;
5247+ int conftest_follow_pte_has_vma_arg(struct vm_area_struct *vma,
5248+ unsigned long address,
5249+ pte_t **ptep,
5250+ spinlock_t **ptl) {
5251+ return 0;
5252+ }"
5253+
5254+ compile_check_conftest " $CODE " " NV_FOLLOW_PTE_ARG1_VMA" " " " types"
5255+ ;;
5256+
5257+ ptep_get)
5258+ #
5259+ # Determine if ptep_get() is present.
5260+ #
5261+ # ptep_get() was added by commit 481e980a7c19
5262+ # ("mm: Allow arches to provide ptep_get()")
5263+ #
5264+ CODE="
5265+ #include <linux/mm.h>
5266+ void conftest_ptep_get(void) {
5267+ ptep_get();
5268+ }"
5269+
5270+ compile_check_conftest " $CODE " " NV_PTEP_GET_PRESENT" " " " functions"
5271+ ;;
5272+
52345273 drm_plane_atomic_check_has_atomic_state_arg)
52355274 #
52365275 # Determine if drm_plane_helper_funcs::atomic_check takes 'state'
@@ -6125,6 +6164,32 @@ compile_test() {
61256164 compile_check_conftest " $CODE " " NV_NUM_REGISTERED_FB_PRESENT" " " " types"
61266165 ;;
61276166
6167+ acpi_video_register_backlight)
6168+ #
6169+ # Determine if acpi_video_register_backlight() function is present
6170+ #
6171+ # acpi_video_register_backlight was added by commit 3dbc80a3e4c55c
6172+ # (ACPI: video: Make backlight class device registration a separate
6173+ # step (v2)) for v6.0 (2022-09-02).
6174+ # Note: the include directive for <linux/types> in this conftest is
6175+ # necessary in order to support kernels between commit 0b9f7d93ca61
6176+ # ("ACPI / i915: ignore firmware requests backlight change") for
6177+ # v3.16 (2014-07-07) and commit 3bd6bce369f5 ("ACPI / video: Port
6178+ # to new backlight interface selection API") for v4.2 (2015-07-16).
6179+ # Kernels within this range use the 'bool' type and the related
6180+ # 'false' value in <acpi/video.h> without first including the
6181+ # definitions of that type and value.
6182+ #
6183+ CODE="
6184+ #include <linux/types.h>
6185+ #include <acpi/video.h>
6186+ void conftest_acpi_video_register_backlight(void) {
6187+ acpi_video_register_backlight(0);
6188+ }"
6189+
6190+ compile_check_conftest " $CODE " " NV_ACPI_VIDEO_REGISTER_BACKLIGHT" " " " functions"
6191+ ;;
6192+
61286193 acpi_video_backlight_use_native)
61296194 #
61306195 # Determine if acpi_video_backlight_use_native() function is present
@@ -6378,6 +6443,25 @@ compile_test() {
63786443 compile_check_conftest " $CODE " " NV_MEMORY_FAILURE_MF_SW_SIMULATED_DEFINED" " " " types"
63796444 ;;
63806445
6446+ drm_client_setup)
6447+ #
6448+ # Determine whether drm_client_setup is present.
6449+ #
6450+ # Added by commit d07fdf922592 ("drm/fbdev-ttm:
6451+ # Convert to client-setup") in v6.13.
6452+ #
6453+ CODE="
6454+ #include <drm/drm_fb_helper.h>
6455+ #if defined(NV_DRM_DRM_CLIENT_SETUP_H_PRESENT)
6456+ #include <drm/drm_client_setup.h>
6457+ #endif
6458+ void conftest_drm_client_setup(void) {
6459+ drm_client_setup();
6460+ }"
6461+
6462+ compile_check_conftest " $CODE " " NV_DRM_CLIENT_SETUP_PRESENT" " " " functions"
6463+ ;;
6464+
63816465 drm_output_poll_changed)
63826466 #
63836467 # Determine whether drm_mode_config_funcs.output_poll_changed
@@ -6401,6 +6485,38 @@ compile_test() {
64016485 compile_check_conftest " $CODE " " NV_DRM_OUTPUT_POLL_CHANGED_PRESENT" " " " types"
64026486 ;;
64036487
6488+ aperture_remove_conflicting_devices)
6489+ #
6490+ # Determine whether aperture_remove_conflicting_devices is present.
6491+ #
6492+ # Added by commit 7283f862bd991 ("drm: Implement DRM aperture
6493+ # helpers under video/") in v6.0
6494+ CODE="
6495+ #if defined(NV_LINUX_APERTURE_H_PRESENT)
6496+ #include <linux/aperture.h>
6497+ #endif
6498+ void conftest_aperture_remove_conflicting_devices(void) {
6499+ aperture_remove_conflicting_devices();
6500+ }"
6501+ compile_check_conftest " $CODE " " NV_APERTURE_REMOVE_CONFLICTING_DEVICES_PRESENT" " " " functions"
6502+ ;;
6503+
6504+ aperture_remove_conflicting_pci_devices)
6505+ #
6506+ # Determine whether aperture_remove_conflicting_pci_devices is present.
6507+ #
6508+ # Added by commit 7283f862bd991 ("drm: Implement DRM aperture
6509+ # helpers under video/") in v6.0
6510+ CODE="
6511+ #if defined(NV_LINUX_APERTURE_H_PRESENT)
6512+ #include <linux/aperture.h>
6513+ #endif
6514+ void conftest_aperture_remove_conflicting_pci_devices(void) {
6515+ aperture_remove_conflicting_pci_devices();
6516+ }"
6517+ compile_check_conftest " $CODE " " NV_APERTURE_REMOVE_CONFLICTING_PCI_DEVICES_PRESENT" " " " functions"
6518+ ;;
6519+
64046520 crypto_tfm_ctx_aligned)
64056521 # Determine if 'crypto_tfm_ctx_aligned' is defined.
64066522 #
@@ -6422,17 +6538,17 @@ compile_test() {
64226538 # This test is not complete and may return false positive.
64236539 #
64246540 CODE="
6425- #include <crypto/akcipher.h>
6426- #include <crypto/algapi.h>
6427- #include <crypto/ecc_curve.h>
6428- #include <crypto/ecdh.h>
6429- #include <crypto/hash.h>
6430- #include <crypto/internal/ecc.h>
6431- #include <crypto/kpp.h>
6432- #include <crypto/public_key.h>
6433- #include <crypto/sm3.h>
6434- #include <keys/asymmetric-type.h>
6435- #include <linux/crypto.h>
6541+ #include <crypto/akcipher.h>
6542+ #include <crypto/algapi.h>
6543+ #include <crypto/ecc_curve.h>
6544+ #include <crypto/ecdh.h>
6545+ #include <crypto/hash.h>
6546+ #include <crypto/internal/ecc.h>
6547+ #include <crypto/kpp.h>
6548+ #include <crypto/public_key.h>
6549+ #include <crypto/sm3.h>
6550+ #include <keys/asymmetric-type.h>
6551+ #include <linux/crypto.h>
64366552 void conftest_crypto(void) {
64376553 struct shash_desc sd;
64386554 struct crypto_shash cs;
@@ -6442,6 +6558,47 @@ compile_test() {
64426558 compile_check_conftest " $CODE " " NV_CRYPTO_PRESENT" " " " symbols"
64436559 ;;
64446560
6561+ crypto_akcipher_verify)
6562+ #
6563+ # Determine whether the crypto_akcipher_verify API is still present.
6564+ # It was removed by commit 6b34562 ('crypto: akcipher - Drop sign/verify operations')
6565+ # in v6.13-rc1 (2024-10-04).
6566+ #
6567+ # This test is dependent on the crypto conftest to determine whether crypto should be
6568+ # enabled at all. That means that if the kernel is old enough such that crypto_akcipher_verify
6569+ #
6570+ # The test merely checks for the presence of the API, as it assumes that if the API
6571+ # is no longer present, the new API to replace it (crypto_sig_verify) must be present.
6572+ # If the kernel version is too old to have crypto_akcipher_verify, it will fail the crypto
6573+ # conftest above and all crypto code will be compiled out.
6574+ #
6575+ CODE="
6576+ #include <crypto/akcipher.h>
6577+ #include <linux/crypto.h>
6578+ void conftest_crypto_akcipher_verify(void) {
6579+ (void)crypto_akcipher_verify;
6580+ }"
6581+
6582+ compile_check_conftest " $CODE " " NV_CRYPTO_AKCIPHER_VERIFY_PRESENT" " " " symbols"
6583+ ;;
6584+
6585+ ecc_digits_from_bytes)
6586+ #
6587+ # Determine whether ecc_digits_from_bytes is present.
6588+ # It was added in commit c6ab5c915da4 ('crypto: ecc - Prevent ecc_digits_from_bytes from
6589+ # reading too many bytes') in v6.10.
6590+ #
6591+ # This functionality is needed when crypto_akcipher_verify is not present.
6592+ #
6593+ CODE="
6594+ #include <crypto/internal/ecc.h>
6595+ void conftest_ecc_digits_from_bytes(void) {
6596+ (void)ecc_digits_from_bytes;
6597+ }"
6598+
6599+ compile_check_conftest " $CODE " " NV_ECC_DIGITS_FROM_BYTES_PRESENT" " " " symbols"
6600+ ;;
6601+
64456602 mempolicy_has_unified_nodes)
64466603 #
64476604 # Determine if the 'mempolicy' structure has
@@ -6546,6 +6703,47 @@ compile_test() {
65466703 compile_check_conftest " $CODE " " NV_FOLIO_TEST_SWAPCACHE_PRESENT" " " " functions"
65476704 ;;
65486705
6706+ module_import_ns_takes_constant)
6707+ #
6708+ # Determine if the MODULE_IMPORT_NS macro takes a string literal
6709+ # or constant.
6710+ #
6711+ # Commit cdd30ebb1b9f ("module: Convert symbol namespace to
6712+ # string literal") changed MODULE_IMPORT_NS to take a string
6713+ # literal in Linux kernel v6.13.
6714+ #
6715+ CODE="
6716+ #include <linux/module.h>
6717+
6718+ MODULE_IMPORT_NS(DMA_BUF);"
6719+
6720+ compile_check_conftest " $CODE " " NV_MODULE_IMPORT_NS_TAKES_CONSTANT" " " " generic"
6721+ ;;
6722+
6723+ drm_driver_has_date)
6724+ #
6725+ # Determine if the 'drm_driver' structure has a 'date' field.
6726+ #
6727+ # Removed by commit cb2e1c2136f7 ("drm: remove driver date from
6728+ # struct drm_driver and all drivers") in linux-next, expected in
6729+ # v6.14.
6730+ #
6731+ CODE="
6732+ #if defined(NV_DRM_DRMP_H_PRESENT)
6733+ #include <drm/drmP.h>
6734+ #endif
6735+
6736+ #if defined(NV_DRM_DRM_DRV_H_PRESENT)
6737+ #include <drm/drm_drv.h>
6738+ #endif
6739+
6740+ int conftest_drm_driver_has_date(void) {
6741+ return offsetof(struct drm_driver, date);
6742+ }"
6743+
6744+ compile_check_conftest " $CODE " " NV_DRM_DRIVER_HAS_DATE" " " " types"
6745+ ;;
6746+
65496747 # When adding a new conftest entry, please use the correct format for
65506748 # specifying the relevant upstream Linux kernel commit.
65516749 #
0 commit comments