@@ -507,6 +507,7 @@ compile_test() {
507507 #include <asm/pgtable_types.h>
508508 #endif
509509 #include <asm/page.h>
510+ #include <linux/percpu.h>
510511 #include <asm/set_memory.h>
511512 #else
512513 #include <asm/cacheflush.h>
@@ -530,6 +531,7 @@ compile_test() {
530531 #include <asm/pgtable_types.h>
531532 #endif
532533 #include <asm/page.h>
534+ #include <linux/percpu.h>
533535 #include <asm/set_memory.h>
534536 #else
535537 #include <asm/cacheflush.h>
@@ -588,6 +590,7 @@ compile_test() {
588590 #include <asm/pgtable_types.h>
589591 #endif
590592 #include <asm/page.h>
593+ #include <linux/percpu.h>
591594 #include <asm/set_memory.h>
592595 #else
593596 #include <asm/cacheflush.h>
@@ -614,6 +617,7 @@ compile_test() {
614617 #include <asm/pgtable_types.h>
615618 #endif
616619 #include <asm/page.h>
620+ #include <linux/percpu.h>
617621 #include <asm/set_memory.h>
618622 #else
619623 #include <asm/cacheflush.h>
@@ -1126,19 +1130,44 @@ compile_test() {
11261130 compile_check_conftest " $CODE " " NV_VFIO_DEVICE_OPS_HAS_DETACH_IOAS" " " " types"
11271131 ;;
11281132
1133+ vfio_device_ops_has_get_region_info_caps)
1134+ #
1135+ # Determine if 'struct vfio_device_ops' has 'get_region_info_caps'
1136+ # callback.
1137+ #
1138+ # Added by commit 775f726a742a ("vfio: Add get_region_info_caps op")
1139+ # in v6.19
1140+ #
1141+ CODE="
1142+ #include <linux/pci.h>
1143+ #include <linux/vfio.h>
1144+ int conftest_vfio_device_ops_has_get_region_info_caps(void) {
1145+ return offsetof(struct vfio_device_ops, get_region_info_caps);
1146+ }"
1147+
1148+ compile_check_conftest " $CODE " " NV_VFIO_DEVICE_OPS_HAS_GET_REGION_INFO_CAPS" " " " types"
1149+ ;;
1150+
11291151 pfn_address_space)
11301152 #
11311153 # Determine if 'struct pfn_address_space' structure is present or not.
11321154 #
1155+ # Added by commit 2ec41967189c ("mm: handle poisoning of pfn without
1156+ # struct pages") in v6.19
1157+ # Added by commit e6dbcb7c0e7b ("mm: fixup pfnmap memory failure
1158+ # handling to use pgoff in v6.19
1159+ #
11331160 CODE="
11341161 #include <linux/memory-failure.h>
11351162 void conftest_pfn_address_space() {
11361163 struct pfn_address_space pfn_address_space;
1164+ pfn_address_space.pfn_to_vma_pgoff = NULL;
1165+ register_pfn_address_space(&pfn_address_space);
1166+ unregister_pfn_address_space(&pfn_address_space);
11371167 }"
1138-
11391168 compile_check_conftest " $CODE " " NV_PFN_ADDRESS_SPACE_STRUCT_PRESENT" " " " types"
11401169 ;;
1141-
1170+
11421171 irq_bypass_producer_has_token)
11431172 #
11441173 # Determine if 'struct irq_bypass_producer' has 'token' field
@@ -1182,13 +1211,18 @@ compile_test() {
11821211 #
11831212 # Determine if egm management api are present or not.
11841213 #
1214+ # unregister_egm_node() function signature changed by commit
1215+ # 9863aeed3a2d ("NVIDIA: SAUCE: vfio/nvgrace-egm: Update EGM
1216+ # unregistration API") to use PCI device as its parameter
1217+ # https://github.com/NVIDIA/NV-Kernels.git
1218+ #
11851219 CODE="
11861220 #include <linux/pci.h>
11871221 #include <linux/nvgrace-egm.h>
11881222 void conftest_egm_module_helper_api_present() {
1189- struct pci_dev *pdev;
1223+ struct pci_dev *pdev = NULL ;
11901224 register_egm_node(pdev);
1191- unregister_egm_node(0 );
1225+ unregister_egm_node(pdev );
11921226 }
11931227 "
11941228 compile_check_conftest " $CODE " " NV_EGM_MODULE_HELPER_API_PRESENT" " " " types"
@@ -2138,24 +2172,6 @@ compile_test() {
21382172 fi
21392173 ;;
21402174
2141- enable_apicv)
2142- #
2143- # Determine if enable_apicv boolean is exported by kernel.
2144- #
2145- # Added by commit fdf513e37a3b ("KVM: x86: Use common
2146- # 'enable_apicv' variable for both APICv and AVIC") in v5.14.
2147- #
2148- CODE="
2149- $CONFTEST_PREAMBLE
2150- #include <asm/kvm_host.h>
2151-
2152- bool is_enable_apicv_present() {
2153- return enable_apicv;
2154- }"
2155-
2156- compile_check_conftest " $CODE " " NV_ENABLE_APICV_PRESENT" " " " types"
2157- ;;
2158-
21592175 pci_driver_has_driver_managed_dma)
21602176 #
21612177 # Determine if "struct pci_driver" has .driver_managed_dma member.
@@ -5044,6 +5060,26 @@ compile_test() {
50445060 ;;
50455061
50465062
5063+ is_vma_write_locked_has_mm_lock_seq_arg)
5064+ #
5065+ # Determine if __is_vma_write_locked() takes only a single
5066+ # 'struct vm_area_struct *' argument.
5067+ #
5068+ # Commit 22f7639f2f03 ("mm/vma: improve and document
5069+ # __is_vma_write_locked()") removed the 'unsigned int *mm_lock_seq'
5070+ # parameter in v7.0-rc1.
5071+ #
5072+ CODE="
5073+ #include <linux/mm.h>
5074+ #include <linux/mmap_lock.h>
5075+ int conftest_is_vma_write_locked_has_mm_lock_seq_arg(struct vm_area_struct *vma) {
5076+ unsigned int mm_lock_seq;
5077+ return __is_vma_write_locked(vma, &mm_lock_seq);
5078+ }"
5079+
5080+ compile_check_conftest " $CODE " " NV_IS_VMA_WRITE_LOCKED_HAS_MM_LOCK_SEQ_ARG" " " " types"
5081+ ;;
5082+
50475083 # When adding a new conftest entry, please use the correct format for
50485084 # specifying the relevant upstream Linux kernel commit. Please
50495085 # avoid specifying -rc kernels, and only use SHAs that actually exist
0 commit comments