intel / intel/ethernet-linux-ice
[Bug] VFIO generation failing in Linux Kernel 6.8
- Dominant language
- C
- Stars
- 60
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
`ice-vfio-pci.ko` is not getting generated in kernel 6.8 as VFIO migration protocol v1 is deprecated and the support for VFIO migration protocol v2 is not yet added
## Bug description
For ice-vfio-pci generation, `HAVE_LMV1_SUPPORT` has to be present in the generated `kcompat_generated_defs.h` file.
`HAVE_LMV1_SUPPORT` is added if macro `VFIO_REGION_TYPE_MIGRATION` is defined under `include/uapi/linux/vfio.h` in the kernel code
However the migration protocol v1 was depreciated. Therefore VFIO_REGION_TYPE_MIGRATION does not exist anymore.
Reference:
- https://lore.kernel.org/all/20220224142024.147653-12-yishaih@nvidia.com/
- https://lore.kernel.org/all/20220224142024.147653-1-yishaih@nvidia.com/
## Driver Tag/Commit
https://github.com/intel/ethernet-linux-ice/releases/tag/v1.15.4
## Custom Code
No
## Reproduction steps
1. Pull latest 6.8 kernel from Ubuntu(https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/noble/tag/?h=Ubuntu-6.8.0-38.38) or the latest rc tag from Linux tree (https://github.com/torvalds/linux/tree/v6.8-rc7)
3. Try to compile with 1.15.4
4. Notice that ice-vfio-pci.ko is not generated
## Expected Behavior
ice-vfio-pci.ko to be generated
## Actual Behavior
ice-vfio-pci.ko is not generated
## Relevant log output
None as vfio is not generated.
But if you try to use the depreciated VFIO_REGION_TYPE_MIGRATION_DEPRECATED & VFIO_REGION_SUBTYPE_MIGRATION_DEPRECATED, you get another set of errors
```
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c: In function ‘ice_vfio_pci_set_device_state’:
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c:254:42: error: ‘VFIO_DEVICE_STATE_SAVING’ undeclared (first use in this function); did you mean ‘VFIO_DEVICE_STATE_V1_SAVING’?
254 | case VFIO_DEVICE_STATE_RUNNING | VFIO_DEVICE_STATE_SAVING:
| ^~~~~~~~~~~~~~~~~~~~~~~~
| VFIO_DEVICE_STATE_V1_SAVING
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c:254:42: note: each undeclared identifier is reported only once for each function it appears in
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c: In function ‘ice_vfio_pci_mig_rw_data_size’:
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c:450:47: error: ‘VFIO_DEVICE_STATE_SAVING’ undeclared (first use in this function); did you mean ‘VFIO_DEVICE_STATE_V1_SAVING’?
450 | if (mig_info->device_state != VFIO_DEVICE_STATE_SAVING)
| ^~~~~~~~~~~~~~~~~~~~~~~~
| VFIO_DEVICE_STATE_V1_SAVING
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c: In function ‘ice_vfio_group_notifier’:
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c:557:23: error: ‘VFIO_GROUP_NOTIFY_SET_KVM’ undeclared (first use in this function)
557 | if (action == VFIO_GROUP_NOTIFY_SET_KVM)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c: In function ‘ice_vfio_migration_init’:
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c:606:18: error: ‘VFIO_GROUP_NOTIFY_SET_KVM’ undeclared (first use in this function)
606 | events = VFIO_GROUP_NOTIFY_SET_KVM;
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c:607:15: error: implicit declaration of function ‘vfio_register_notifier’; did you mean ‘bus_register_notifier’? [-Werror=implicit-function-declaration]
607 | ret = vfio_register_notifier(dev, VFIO_GROUP_NOTIFY, &events,
| ^~~~~~~~~~~~~~~~~~~~~~
| bus_register_notifier
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c:607:43: error: ‘VFIO_GROUP_NOTIFY’ undeclared (first use in this function)
607 | ret = vfio_register_notifier(dev, VFIO_GROUP_NOTIFY, &events,
| ^~~~~~~~~~~~~~~~~
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c:615:15: error: implicit declaration of function ‘vfio_pci_register_dev_region’; did you mean ‘vfio_pci_core_register_dev_region’? [-Werror=implicit-function-declaration]
615 | ret = vfio_pci_register_dev_region(&ice_vdev->core_device,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| vfio_pci_core_register_dev_region
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c:630:9: error: implicit declaration of function ‘vfio_unregister_notifier’; did you mean ‘bus_unregister_notifier’? [-Werror=implicit-function-declaration]
630 | vfio_unregister_notifier(dev, VFIO_GROUP_NOTIFY,
| ^~~~~~~~~~~~~~~~~~~~~~~~
| bus_unregister_notifier
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c: In function ‘ice_vfio_migration_uninit’:
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c:649:39: error: ‘VFIO_GROUP_NOTIFY’ undeclared (first use in this function)
649 | vfio_unregister_notifier(dev, VFIO_GROUP_NOTIFY,
| ^~~~~~~~~~~~~~~~~
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c: In function ‘ice_vfio_pci_probe’:
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c:728:9: error: implicit declaration of function ‘vfio_pci_core_init_device’; did you mean ‘vfio_pci_core_init_dev’? [-Werror=implicit-function-declaration]
728 | vfio_pci_core_init_device(&ice_vdev->core_device, pdev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| vfio_pci_core_init_dev
/home/ubuntu/ice/ice-1.15.4/src/ice_vfio_pci.c:740:9: error: implicit declaration of function ‘vfio_pci_core_uninit_device’; did you mean ‘vfio_pci_core_init_dev’? [-Werror=implicit-function-declaration]
740 | vfio_pci_core_uninit_device(&ice_vdev->core_device);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| vfio_pci_core_init_dev
cc1: some warnings being treated as errors
```
All these error as because of migration protocol v1 depreciation. For example
VFIO_DEVICE_STATE_RUNNING does not exist anymore.
Reference: https://lore.kernel.org/all/20220224142024.147653-10-yishaih@nvidia.com/
Could someone please help?
Contributor guide
Assessment
This issue has not been assessed yet.