From: Scott Weaver on gitlab.com Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2606
There are two significant problems with the existing hardware and driver maintenance process. It is not easy to determine if a driver or piece of hardware is supported, and it is not easy to determine if a driver or piece of hardware is deprecated.
This changeset implements new 'centralized' call points to mark hardware and devices deprecated, unmaintained, or disabled. This removes per-driver code and reduces the amount of RHEL only code in the kernel.
It is easiest to look at a comparison of the old and new processes. In this example, I will look at disabling a PCI card. In the old process, a bugzilla would be opened to mark the device as disabled, and it would be assigned to an engineer. That engineer would submit code and it would eventually be merged into the tree. The problem with this process is that it does not make it easy for others to determine the status of the device without examining the code. This led to situations where devices were assumed to be supported in RHEL9 but were not actually enabled. In addition to this, this process required per-driver changes which were spread throughout the kernel.
The new process relies on a database that contains information on the status of a device. In order to disable a device the database must first be updated with the information. The database contains a utility to update the code which is then directly copied into the kernel as a Merge Request.
As part of this change, the code is updated to have two main calling points to examine devices and drivers. The kernel module loading code is updated to check the status of a driver before loading it, and the PCI core driver code was updated to to check the status of a device before binding it to a driver.
There is dead and existing code that is removed from the source code before any changes are made.
Signed-off-by: Prarit Bhargava prarit@redhat.com Signed-off-by: Scott Weaver scweaver@redhat.com
--- drivers/message/fusion/mptsas.c | 5 - drivers/message/fusion/mptspi.c | 5 - drivers/pci/pci-driver.c | 83 +-------- include/linux/kernel.h | 9 +- include/linux/module.h | 4 + include/linux/pci.h | 19 +- init/main.c | 3 + kernel/module/main.c | 5 + kernel/rh_messages.c | 343 +++++++++++++++++++++++++++++++-------- kernel/rh_messages.h | 109 ++++++++++++ 10 files changed, 406 insertions(+), 179 deletions(-)
From: Prarit Bhargava prarit@redhat.com
[redhat] drivers/pci: Remove RHEL-only pci_hw_*() functions
Remove the RHEL-only pci_hw_*() functions. These will be replaced with new functions in a later commit.
Signed-off-by: Prarit Bhargava prarit@redhat.com Signed-off-by: Scott Weaver scweaver@redhat.com
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index blahblah..blahblah 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -297,83 +297,6 @@ static struct attribute *pci_drv_attrs[] = { }; ATTRIBUTE_GROUPS(pci_drv);
-#ifdef CONFIG_RHEL_DIFFERENCES -/** - * pci_hw_deprecated - Tell if a PCI device is deprecated - * @ids: array of PCI device id structures to search in - * @dev: the PCI device structure to match against - * - * Used by a driver to check whether this device is in its list of deprecated - * devices. Returns the matching pci_device_id structure or %NULL if there is - * no match. - * - * Reserved for Internal Red Hat use only. - */ -const struct pci_device_id *pci_hw_deprecated(const struct pci_device_id *ids, - struct pci_dev *dev) -{ - const struct pci_device_id *ret = pci_match_id(ids, dev); - - if (!ret) - return NULL; - - mark_hardware_deprecated(dev_driver_string(&dev->dev), "%04X:%04X @ %s", - dev->device, dev->vendor, pci_name(dev)); - return ret; -} -EXPORT_SYMBOL(pci_hw_deprecated); - -/** - * pci_hw_unmaintained - Tell if a PCI device is unmaintained - * @ids: array of PCI device id structures to search in - * @dev: the PCI device structure to match against - * - * Used by a driver to check whether this device is in its list of unmaintained - * devices. Returns the matching pci_device_id structure or %NULL if there is - * no match. - * - * Reserved for Internal Red Hat use only. - */ -const struct pci_device_id *pci_hw_unmaintained(const struct pci_device_id *ids, - struct pci_dev *dev) -{ - const struct pci_device_id *ret = pci_match_id(ids, dev); - - if (!ret) - return NULL; - - mark_hardware_unmaintained(dev_driver_string(&dev->dev), "%04X:%04X @ %s", - dev->device, dev->vendor, pci_name(dev)); - return ret; -} -EXPORT_SYMBOL(pci_hw_unmaintained); - -/** - * pci_hw_disabled - Tell if a PCI device is disabled - * @ids: array of PCI device id structures to search in - * @dev: the PCI device structure to match against - * - * Used by a driver to check whether this device is in its list of disabled - * devices. Returns the matching pci_device_id structure or %NULL if there is - * no match. - * - * Reserved for Internal Red Hat use only. - */ -const struct pci_device_id *pci_hw_disabled(const struct pci_device_id *ids, - struct pci_dev *dev) -{ - const struct pci_device_id *ret = pci_match_id(ids, dev); - - if (!ret) - return NULL; - - mark_hardware_disabled(dev_driver_string(&dev->dev), "%04X:%04X @ %s", - dev->device, dev->vendor, pci_name(dev)); - return ret; -} -EXPORT_SYMBOL(pci_hw_disabled); -#endif - struct drv_dev_and_id { struct pci_driver *drv; struct pci_dev *dev; diff --git a/include/linux/pci.h b/include/linux/pci.h index blahblah..blahblah 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1561,21 +1561,6 @@ int pci_add_dynid(struct pci_driver *drv, const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev);
-#ifdef CONFIG_RHEL_DIFFERENCES -const struct pci_device_id *pci_hw_deprecated(const struct pci_device_id *ids, - struct pci_dev *dev); -const struct pci_device_id *pci_hw_unmaintained(const struct pci_device_id *ids, - struct pci_dev *dev); -const struct pci_device_id *pci_hw_disabled(const struct pci_device_id *ids, - struct pci_dev *dev); -#else -static inline const struct pci_device_id *pci_hw_deprecated(const struct pci_device_id *ids, - struct pci_dev *dev) { return NULL; } -static inline const struct pci_device_id *pci_hw_unmaintained(const struct pci_device_id *ids, - struct pci_dev *dev) { return NULL; } -static inline const struct pci_device_id *pci_hw_disabled(const struct pci_device_id *ids, - struct pci_dev *dev) {return NULL; } -#endif int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass);
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2606
From: Scott Weaver scweaver@redhat.com
[redhat] mptsas: Remove add_taint()
Removed add_taint() call which had been removed in cs9 ba729644ae63e ('mptsas: add new messaging') but not brought to kernel-ark. A new function to track unmaintained drivers will be added in a later commit in this series.
Signed-off-by: Scott Weaver scweaver@redhat.com
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index blahblah..blahblah 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c @@ -5320,11 +5320,6 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) ioc, MPI_SAS_OP_CLEAR_ALL_PERSISTENT); }
-#ifdef CONFIG_RHEL_DIFFERENCES - add_taint(TAINT_SUPPORT_REMOVED, LOCKDEP_STILL_OK); - pr_warn("MPTSAS MODULE IS NOT SUPPORTED\n"); -#endif - error = scsi_add_host(sh, &ioc->pcidev->dev); if (error) { dprintk(ioc, printk(MYIOC_s_ERR_FMT
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2606
From: Prarit Bhargava prarit@redhat.com
[redhat] drivers/message/fusion/mptspi.c: Remove extra disabled warning
Remove this warning. It is no longer needed.
Signed-off-by: Prarit Bhargava prarit@redhat.com Signed-off-by: Scott Weaver scweaver@redhat.com
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index blahblah..blahblah 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c @@ -1540,11 +1540,6 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
scsi_scan_host(sh);
-#ifdef CONFIG_RHEL_DIFFERENCES - add_taint(TAINT_SUPPORT_REMOVED, LOCKDEP_STILL_OK); - pr_warn("MPTSPI MODULE IS NOT SUPPORTED\n"); -#endif - return 0;
out_mptspi_probe:
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2606
From: Prarit Bhargava prarit@redhat.com
[redhat] drivers/pci: Update rh_messages.c
Database information is used to create lists of drivers and devices that are unmaintained, deprecated, or disabled. New functions using the data are introduced and will be called directly from PCI driver loading and module loading code.
Signed-off-by: Prarit Bhargava prarit@redhat.com Signed-off-by: Scott Weaver scweaver@redhat.com
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index blahblah..blahblah 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -486,18 +486,11 @@ struct module;
#ifdef CONFIG_RHEL_DIFFERENCES void mark_hardware_unmaintained(const char *driver_name, char *fmt, ...); -void mark_driver_unmaintained(const char *driver_name); -void mark_hardware_deprecated(const char *driver_name, char *fmt, ...); -void mark_driver_deprecated(const char *driver_name); -void mark_hardware_disabled(const char *driver_name, char *fmt, ...); void mark_tech_preview(const char *msg, struct module *mod); void mark_partner_supported(const char *msg, struct module *mod); +void init_rh_check_status(char *fn_name); #else static inline void mark_hardware_unmaintained(const char *driver_name, char *fmt, ...) { } -static inline void mark_driver_unmaintained(const char *driver_name) { } -static inline void mark_hardware_deprecated(const char *driver_name, char *fmt, ...) { } -static inline void mark_driver_deprecated(const char *driver_name) { } -static inline void mark_hardware_disabled(const char *driver_name, char *fmt, ...) { } static inline void mark_tech_preview(const char *msg, struct module *mod) { } static inline void mark_partner_supported(const char *msg, struct module *mod) { } #endif diff --git a/include/linux/module.h b/include/linux/module.h index blahblah..blahblah 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -989,4 +989,8 @@ static inline unsigned long find_kallsyms_symbol_value(struct module *mod,
#endif /* CONFIG_MODULES && CONFIG_KALLSYMS */
+#ifdef CONFIG_RHEL_DIFFERENCES +void module_rh_check_status(const char * module_name); +#endif + #endif /* _LINUX_MODULE_H */ diff --git a/include/linux/pci.h b/include/linux/pci.h index blahblah..blahblah 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -2579,6 +2579,10 @@ static inline bool pci_is_thunderbolt_attached(struct pci_dev *pdev) return false; }
+#ifdef CONFIG_RHEL_DIFFERENCES +bool pci_rh_check_status(struct pci_dev *pci_dev); +#endif + #if defined(CONFIG_PCIEPORTBUS) || defined(CONFIG_EEH) void pci_uevent_ers(struct pci_dev *pdev, enum pci_ers_result err_type); #endif diff --git a/kernel/rh_messages.c b/kernel/rh_messages.c index blahblah..blahblah 100644 --- a/kernel/rh_messages.c +++ b/kernel/rh_messages.c @@ -1,7 +1,8 @@ -#include <linux/kernel.h> -#include <linux/module.h> +/* + * WARNING: This file is auto-generated by an internal Red Hat script and, + * in general, should not be modified by hand. + */
-#define DEV_DESC_LEN 256 /* * The following functions are used by Red Hat to indicate to users that * hardware and drivers are unsupported, or have limited support in RHEL major @@ -19,6 +20,212 @@ * related fixes until they are disabled. */
+#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/pci.h> + +#define DEV_DESC_LEN 256 +static const char *rh_deprecated_drivers[] = { + "team", + "ebtables", + "arp_tables", + "ip_tables", + "ip6_tables", + "ip_set", + "nft_compat", + "firewire-core", + "" /* Terminating entry */ +}; + +static const char *rh_deprecated_init_fns[] = { + "team_module_init", + "ebtables_init", + "arp_tables_init", + "ip_tables_init", + "ip6_tables_init", + "ip_set_init", + "nft_compat_module_init", + "fw_core_init", + "" /* Terminating entry */ +}; + +static const char *rh_unmaintained_drivers[] = { + "bnx2", + "e1000", + "dl2k", + "hpsa", + "mptbase", + "mptsas", + "mptscsih", + "mptspi", + "myri10ge", + "netxen_nic", + "qla3xxx", + "hdlc_fr", + "nvmet-fc", + "nvmet-tcp", + "team", + "ebtables", + "arp_tables", + "ip_tables", + "ip6_tables", + "ip_set", + "nft_compat", + "nicvf", + "nicpf", + "" /* Terminating entry */ +}; + +static const char *rh_unmaintained_init_fns[] = { + "bnx2_pci_driver_init", + "e1000_init_module", + "rio_driver_init", + "hpsa_init", + "fusion_init", + "mptsas_init", + "fusion_init", + "mptspi_init", + "myri10ge_init_module", + "netxen_init_module", + "ql3xxx_driver_init", + "hdlc_fr_init", + "nvmet_fc_init_module", + "nvmet_tcp_init", + "team_module_init", + "ebtables_init", + "arp_tables_init", + "ip_tables_init", + "ip6_tables_init", + "ip_set_init", + "nft_compat_module_init", + "nicvf_init_module", + "nic_init_module", + "" /* Terminating entry */ +}; + +static const struct pci_device_id rh_deprecated_pci_devices[] = { + {0} /* Terminating entry */ +}; + +static const struct pci_device_id rh_disabled_pci_devices[] = { + { 0x1011, 0x0046, 0x103c, 0x10c2 }, + { 0x1011, 0x0046, 0x9005, 0x0364 }, + { 0x1011, 0x0046, 0x9005, 0x0365 }, + { 0x1011, 0x0046, 0x9005, 0x1364 }, + { 0x1028, 0x0001, 0x1028, 0x0001 }, + { 0x1028, 0x0002, 0x1028, 0x0002 }, + { 0x1028, 0x0002, 0x1028, 0x00d1 }, + { 0x1028, 0x0002, 0x1028, 0x00d9 }, + { 0x1028, 0x0003, 0x1028, 0x0003 }, + { 0x1028, 0x0004, 0x1028, 0x00d0 }, + { 0x1028, 0x000a, 0x1028, 0x0106 }, + { 0x1028, 0x000a, 0x1028, 0x011b }, + { 0x1028, 0x000a, 0x1028, 0x0121 }, + { 0x9005, 0x0200, 0x9005, 0x0200 }, + { 0x9005, 0x0283, 0x9005, 0x0283 }, + { 0x9005, 0x0284, 0x9005, 0x0284 }, + { 0x9005, 0x0285, PCI_ANY_ID, PCI_ANY_ID }, + { 0x9005, 0x0285, 0x1014, 0x02F2 }, + { 0x9005, 0x0285, 0x1014, 0x0312 }, + { 0x9005, 0x0285, 0x1028, PCI_ANY_ID }, + { 0x9005, 0x0285, 0x1028, 0x0287 }, + { 0x9005, 0x0285, 0x103C, 0x3227 }, + { 0x9005, 0x0285, 0x17aa, PCI_ANY_ID }, + { 0x9005, 0x0285, 0x17aa, 0x0286 }, + { 0x9005, 0x0285, 0x17aa, 0x0287 }, + { 0x9005, 0x0285, 0x9005, 0x0285 }, + { 0x9005, 0x0285, 0x9005, 0x0286 }, + { 0x9005, 0x0285, 0x9005, 0x0287 }, + { 0x9005, 0x0285, 0x9005, 0x0288 }, + { 0x9005, 0x0285, 0x9005, 0x0289 }, + { 0x9005, 0x0285, 0x9005, 0x028a }, + { 0x9005, 0x0285, 0x9005, 0x028b }, + { 0x9005, 0x0285, 0x9005, 0x028e }, + { 0x9005, 0x0285, 0x9005, 0x028f }, + { 0x9005, 0x0285, 0x9005, 0x0290 }, + { 0x9005, 0x0285, 0x9005, 0x0291 }, + { 0x9005, 0x0285, 0x9005, 0x0292 }, + { 0x9005, 0x0285, 0x9005, 0x0293 }, + { 0x9005, 0x0285, 0x9005, 0x0294 }, + { 0x9005, 0x0285, 0x9005, 0x0296 }, + { 0x9005, 0x0285, 0x9005, 0x0297 }, + { 0x9005, 0x0285, 0x9005, 0x0298 }, + { 0x9005, 0x0285, 0x9005, 0x0299 }, + { 0x9005, 0x0285, 0x9005, 0x029a }, + { 0x9005, 0x0285, 0x9005, 0x02a4 }, + { 0x9005, 0x0285, 0x9005, 0x02a5 }, + { 0x9005, 0x0286, PCI_ANY_ID, PCI_ANY_ID }, + { 0x9005, 0x0286, 0x1014, 0x9540 }, + { 0x9005, 0x0286, 0x1014, 0x9580 }, + { 0x9005, 0x0286, 0x9005, 0x028c }, + { 0x9005, 0x0286, 0x9005, 0x028d }, + { 0x9005, 0x0286, 0x9005, 0x029b }, + { 0x9005, 0x0286, 0x9005, 0x029c }, + { 0x9005, 0x0286, 0x9005, 0x029d }, + { 0x9005, 0x0286, 0x9005, 0x029e }, + { 0x9005, 0x0286, 0x9005, 0x029f }, + { 0x9005, 0x0286, 0x9005, 0x02a0 }, + { 0x9005, 0x0286, 0x9005, 0x02a1 }, + { 0x9005, 0x0286, 0x9005, 0x02a2 }, + { 0x9005, 0x0286, 0x9005, 0x02a3 }, + { 0x9005, 0x0286, 0x9005, 0x02a6 }, + { 0x9005, 0x0286, 0x9005, 0x0800 }, + { 0x9005, 0x0287, 0x9005, 0x0800 }, + { 0x9005, 0x0288, PCI_ANY_ID, PCI_ANY_ID }, + { 0x19a2, 0x0700, PCI_ANY_ID, PCI_ANY_ID }, + { 0x19a2, 0x0211, PCI_ANY_ID, PCI_ANY_ID }, + { 0x19a2, 0x0710, PCI_ANY_ID, PCI_ANY_ID }, + { 0x19a2, 0x0221, PCI_ANY_ID, PCI_ANY_ID }, + { 0x19a2, 0xe220, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0060, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0078, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x007C, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0411, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0413, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1028, 0x0015, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0064, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0065, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0070, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0072, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0074, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0076, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0077, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x007E, PCI_ANY_ID, PCI_ANY_ID }, + {0} /* Terminating entry */ +}; + +static const struct pci_device_id rh_unmaintained_pci_devices[] = { + { 0x10df, 0x0724, PCI_ANY_ID, PCI_ANY_ID }, + { 0x10df, 0xe200, PCI_ANY_ID, PCI_ANY_ID }, + { 0x10df, 0xe220, PCI_ANY_ID, PCI_ANY_ID }, + { 0x10df, 0xf011, PCI_ANY_ID, PCI_ANY_ID }, + { 0x10df, 0xf015, PCI_ANY_ID, PCI_ANY_ID }, + { 0x10df, 0xf100, PCI_ANY_ID, PCI_ANY_ID }, + { 0x10df, 0xfc40, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x005b, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0071, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0073, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0079, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x006E, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0080, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0081, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0082, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0083, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0084, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0085, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0086, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1000, 0x0087, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1077, 0x2031, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1077, 0x2532, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1077, 0x8031, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1924, 0x0803, PCI_ANY_ID, PCI_ANY_ID }, + { 0x1924, 0x0813, PCI_ANY_ID, PCI_ANY_ID }, + { 0x177d, 0xa01e, PCI_ANY_ID, PCI_ANY_ID }, + { 0x177d, 0xa034, PCI_ANY_ID, PCI_ANY_ID }, + { 0x177d, 0x0011, PCI_ANY_ID, PCI_ANY_ID }, + {0} /* Terminating entry */ +}; + /** * mark_hardware_unmaintained() - Mark hardware as unmaintained. * @driver_name: driver name @@ -27,13 +234,16 @@ * * Called to notify users that the device will no longer be tested on a routine * basis and driver code associated with this device is no longer being updated. - * Red Hat may fix security-related and critical issues. Support for this device - * will be disabled in a future major release and users deploying this device - * should plan to replace the device in production systems. + * Red Hat may, at their own discretion, fix security-related and critical + * issues. Support for this device will be disabled in a future major release + * and users deploying this device should plan to replace the device in + * production systems. * * This function should be used when the driver's usage can be tied to a * specific hardware device. For example, a network device driver loading on a * specific device that is no longer maintained by the manufacturer. + * + * Reserved for Internal Red Hat use only. */ void mark_hardware_unmaintained(const char *driver_name, char *fmt, ...) { @@ -42,32 +252,12 @@ void mark_hardware_unmaintained(const char *driver_name, char *fmt, ...)
va_start(args, fmt); vsnprintf(device_description, DEV_DESC_LEN, fmt, args); - pr_crit("Warning: Unmaintained hardware is detected: %s:%s\n", driver_name, - device_description); + pr_crit("Warning: Unmaintained Hardware is detected: %s:%s\n", + driver_name, device_description); va_end(args); } EXPORT_SYMBOL(mark_hardware_unmaintained);
-/** - * mark_driver_unmaintained() - Mark a driver as unmaintained. - * @driver_name: driver name - * - * Called to notify users that a driver will no longer be tested on a routine - * basis and the driver code is no longer being updated. Red Hat may fix - * security-related and critical issues. Support for this driver will be - * disabled in a future major release, and users should replace any affected - * devices in production systems. - * - * This function should be used when a driver's usage cannot be tied to a - * specific hardware device. For example, a network bonding driver or a higher - * level storage layer driver that is no longer maintained upstream. - */ -void mark_driver_unmaintained(const char *driver_name) -{ - pr_crit("Warning: Unmaintained driver is detected: %s\n", driver_name); -} -EXPORT_SYMBOL(mark_driver_unmaintained); - /** * mark_hardware_deprecated() - Mark hardware as deprecated. * @driver_name: driver name @@ -82,6 +272,8 @@ EXPORT_SYMBOL(mark_driver_unmaintained); * This function should be used when the driver's usage can be tied to a * specific hardware device. For example, a network device driver loading on a * specific device that is no longer maintained by the manufacturer. + * + * Reserved for Internal Red Hat use only. */ void mark_hardware_deprecated(const char *driver_name, char *fmt, ...) { @@ -94,28 +286,6 @@ void mark_hardware_deprecated(const char *driver_name, char *fmt, ...) driver_name, device_description); va_end(args); } -EXPORT_SYMBOL(mark_hardware_deprecated); - -/** - * mark_driver_deprecated() - Mark a driver as deprecated. - * @driver_name: driver name - * - * Called to notify users that support for this driver is planned to be - * unmaintained in a future major release, and will eventually be disabled in a - * future major release. This driver should not be used in new production - * environments and users should replace any affected devices in production - * systems. - * - * This function should be used when a driver's usage cannot be tied to a - * specific hardware device. For example, a network bonding driver or a higher - * level storage layer driver that is no longer maintained upstream. - */ -void mark_driver_deprecated(const char *driver_name) -{ - pr_crit("Warning: Deprecated Driver is detected: %s will not be maintained in a future major release and may be disabled\n", - driver_name); -} -EXPORT_SYMBOL(mark_driver_deprecated);
/** * mark_hardware_disabled() - Mark a driver as removed. @@ -131,8 +301,10 @@ EXPORT_SYMBOL(mark_driver_deprecated); * This function should be used when the driver's usage can be tied to a * specific hardware device. For example, a network device driver loading on a * specific device that is no longer maintained by the manufacturer. + * + * Reserved for Internal Red Hat use only. */ -void mark_hardware_disabled(const char *driver_name, char *fmt, ...) +static void mark_hardware_disabled(const char *driver_name, char *fmt, ...) { char device_description[DEV_DESC_LEN]; va_list args; @@ -143,7 +315,185 @@ void mark_hardware_disabled(const char *driver_name, char *fmt, ...) driver_name, device_description); va_end(args); } -EXPORT_SYMBOL(mark_hardware_disabled); + +#ifdef CONFIG_PCI +/** + * pci_hw_deprecated() - Mark a PCI device deprecated. + * @dev: the PCI device structure to match against + * + * Called to check if this @dev is in the list of deprecated devices. + * + * Reserved for Internal Red Hat use only. + */ +static void pci_hw_deprecated(struct pci_dev *dev) +{ + const struct pci_device_id *ret = pci_match_id(rh_deprecated_pci_devices, dev); + + if (!ret) + return; + + mark_hardware_deprecated(dev_driver_string(&dev->dev), "%04X:%04X @ %s", + dev->device, dev->vendor, pci_name(dev)); +} + +/** + * pci_hw_unmaintained() - Mark a PCI device unmaintained. + * @dev: the PCI device structure to match against + * + * Called to check if this @dev is in the list of unmaintained devices. + * + * Reserved for Internal Red Hat use only. + */ +static void pci_hw_unmaintained(struct pci_dev *dev) +{ + const struct pci_device_id *ret = pci_match_id(rh_unmaintained_pci_devices, dev); + + if (!ret) + return; + + mark_hardware_unmaintained(dev_driver_string(&dev->dev), "%04X:%04X @ %s", + dev->device, dev->vendor, pci_name(dev)); +} + +/** + * pci_hw_disabled() - Mark a PCI device disabled. + * @dev: the PCI device structure to match against + * + * Called to check if this @dev is in the list of disabled devices. + * + * Reserved for Internal Red Hat use only. + */ +static bool pci_hw_disabled(struct pci_dev *dev) +{ + const struct pci_device_id *ret = pci_match_id(rh_disabled_pci_devices, dev); + + if (!ret) + return false; + + mark_hardware_disabled(dev_driver_string(&dev->dev), "%04X:%04X @ %s", + dev->device, dev->vendor, pci_name(dev)); + return true; +} +#endif + +/** + * driver_unmaintained() - check to see if a driver is unmaintained + * @module_name: module name + * + * Called to notify users that a driver will no longer be tested on a routine + * basis and the driver code is no longer being updated. Red Hat may fix + * security-related and critical issues. Support for this driver will be + * disabled in a future major release, and users should replace any affected + * devices in production systems. + * + * This function should be used when a driver's usage cannot be tied to a + * specific hardware device. For example, a network bonding driver or a higher + * level storage layer driver that is no longer maintained upstream. + * + * Reserved for Internal Red Hat use only. + */ +static void driver_unmaintained(const char* module_name) +{ + int i = 0; + + while (rh_unmaintained_drivers[i]) { + if (strcmp(rh_unmaintained_drivers[i], module_name) == 0) { + pr_crit("Warning: Unmaintained driver is detected: %s\n", module_name); + return; + } + i++; + } +} + +/** + * driver_deprecated() - check to see if a driver is deprecated + * @driver_name: module name + * + * Called to notify users that support for this driver is planned to be + * unmaintained in a future major release, and will eventually be disabled in a + * future major release. This driver should not be used in new production + * environments and users should replace any affected devices in production + * systems. + * + * This function should be used when a driver's usage cannot be tied to a + * specific hardware device. For example, a network bonding driver or a higher + * level storage layer driver that is no longer maintained upstream. + * + * Reserved for Internal Red Hat use only. + */ +static void driver_deprecated(const char* module_name) +{ + int i = 0; + + while (rh_deprecated_drivers[i]) { + if (strcmp(rh_deprecated_drivers[i], module_name) == 0) { + pr_crit("Warning: Deprecated Driver is detected: %s will not be maintained in a future major release and may be disabled\n", module_name); + return; + } + i++; + } +} + +/* There is no driver_disabled() function. Disabled drivers are configured off ;). */ + +/** + * init_fn_unmaintained - check to see if a built-in driver is unmaintained. + * @fn_name: module's module_init function name + * + * Called to notify users that a built-in driver will no longer be tested on a routine + * basis and the built-in driver code is no longer being updated. Red Hat may fix + * security-related and critical issues. Support for this built-in driver will be + * disabled in a future major release, and users should replace any affected + * devices in production systems. + * + * This function should be used when a built-in driver's usage cannot be tied to a + * specific hardware device. For example, a network bonding driver or a higher + * level storage layer driver that is no longer maintained upstream. + * + * Reserved for Internal Red Hat use only. + */ + +static void init_fn_unmaintained(char* fn_name) +{ + int i = 0; + + while (rh_unmaintained_init_fns[i]) { + if (strcmp(rh_unmaintained_init_fns[i], fn_name) == 0) { + pr_crit("Warning: Unmaintained driver is detected: %s\n", fn_name); + return; + } + i++; + } +} + +/** + * init_fn_deprecated() - check to see if a built-in driver is deprecated + * @fn_name: module's module_init function name + * + * Called to notify users that support for this built-in driver is planned to be + * unmaintained in a future major release, and will eventually be disabled in a + * future major release. This driver should not be used in new production + * environments and users should replace any affected devices in production + * systems. + * + * This function should be used when a built-in driver's usage cannot be tied to a + * specific hardware device. For example, a network bonding driver or a higher + * level storage layer driver that is no longer maintained upstream. + * + * Reserved for Internal Red Hat use only. + */ +static void init_fn_deprecated(char* fn_name) +{ + int i = 0; + + while (rh_deprecated_init_fns[i]) { + if (strcmp(rh_deprecated_init_fns[i], fn_name) == 0) { + pr_crit("Warning: Deprecated Driver is detected: %s will not be maintained in a future major release and may be disabled\n", fn_name); + return; + } + i++; + } +}
/** * mark_tech_preview() - Mark driver or kernel subsystem as 'Tech Preview' @@ -155,6 +505,8 @@ EXPORT_SYMBOL(mark_hardware_disabled); * minor release. The next RHEL minor release may contain full support for * this driver. Red Hat does not guarantee that bugs reported against this * driver or subsystem will be resolved. + * + * Reserved for Internal Red Hat use only. */ void mark_tech_preview(const char *msg, struct module *mod) { @@ -177,14 +529,15 @@ void mark_tech_preview(const char *msg, struct module *mod) #endif } EXPORT_SYMBOL(mark_tech_preview); - /** * mark_partner_supported() - Mark driver or kernel subsystem as 'Partner Supported' * @msg: Driver or kernel subsystem name * - * Called to clarify the support status of a driver. This does TAINT the - * kernel. Calling this function indicates that the driver or subsystem is - * supported by one of our partners and not by Red Hat directly. + * Called to minimize the support status of a new driver. This does TAINT the + * kernel. Calling this function indicates that the driver or subsystem has + * is not supported directly by Red Hat but by a partner engineer. + * + * Reserved for Internal Red Hat use only. */ void mark_partner_supported(const char *msg, struct module *mod) { @@ -207,3 +560,64 @@ void mark_partner_supported(const char *msg, struct module *mod) #endif } EXPORT_SYMBOL(mark_partner_supported); + +/* + * + * Functions called by 'main' kernel code. + * + */ + +#ifdef CONFIG_PCI +/** + * pci_rh_check_status - checks the status of a PCI device. + * @pci_dev: PCI device to be examined + * + * This function is called by the PCI driver subsystem to check the status of a + * PCI device. + * + * This function returns true if the PCI device is disabled, and false otherwise. + * + * Reserved for Internal Red Hat use only. + */ +bool pci_rh_check_status(struct pci_dev *pci_dev) +{ + if (pci_dev->driver->driver.owner != NULL) { + if (!test_bit(TAINT_OOT_MODULE, &pci_dev->driver->driver.owner->taints)) { + pci_hw_unmaintained(pci_dev); + pci_hw_deprecated(pci_dev); + return pci_hw_disabled(pci_dev); + } + } + return false; +} +#endif + +/** module_rh_check_status - checks the status of a module. + * @module_name: Name of module to be examined + * + * This function is called by the module loading code to check the status of a + * module. + * + * Reserved for Internal Red Hat use only. + */ +void module_rh_check_status(const char * module_name) +{ + driver_unmaintained(module_name); + driver_deprecated(module_name); +} + +/** + * init_rh_check_status - checks the status of a built-in module. + * @fn_name: init function of module to be examined + * + * This function is called by the init code to check the status of a built-in module. + * When a module is built-in, the module_init() function is converted into an initcall. + * The initcall is the called during boot with the other system initcalls. + * + * Reserved for Internal Red Hat use only. + */ +void init_rh_check_status(char *fn_name) +{ + init_fn_deprecated(fn_name); + init_fn_unmaintained(fn_name); +}
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2606
From: Prarit Bhargava prarit@redhat.com
[redhat] kernel/rh_messages.c: Wire up new calls
Wire up the new general calls into the module loading and pci driver loading code. This provides centralized call locations for drivers and devices that are unmaintained, deprecated, or disabled.
Signed-off-by: Prarit Bhargava prarit@redhat.com Signed-off-by: Scott Weaver scweaver@redhat.com
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index blahblah..blahblah 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -322,6 +322,12 @@ static long local_pci_probe(void *_ddi) */ pm_runtime_get_sync(dev); pci_dev->driver = pci_drv; + +#ifdef CONFIG_RHEL_DIFFERENCES + if (pci_rh_check_status(pci_dev)) + return -EACCES; +#endif + rc = pci_drv->probe(pci_dev, ddi->id); if (!rc) return rc; diff --git a/init/main.c b/init/main.c index blahblah..blahblah 100644 --- a/init/main.c +++ b/init/main.c @@ -1147,6 +1147,9 @@ static bool __init_or_module initcall_blacklisted(initcall_t fn) */ strreplace(fn_name, ' ', '\0');
+#ifdef CONFIG_RHEL_DIFFERENCES + init_rh_check_status(fn_name); +#endif list_for_each_entry(entry, &blacklisted_initcalls, next) { if (!strcmp(fn_name, entry->buf)) { pr_debug("initcall %s blacklisted\n", fn_name); diff --git a/kernel/module/main.c b/kernel/module/main.c index blahblah..blahblah 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2796,6 +2796,11 @@ static int early_mod_check(struct load_info *info, int flags) return -EPERM; }
+#ifdef CONFIG_RHEL_DIFFERENCES + if (get_modinfo(info, "intree")) + module_rh_check_status(info->name); +#endif + err = rewrite_section_headers(info, flags); if (err) return err;
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2606
From: Scott Weaver scweaver@redhat.com
[redhat] kernel/rh_messages.c: move hardware tables to rh_messages.h
This moves the static message strings and hardware tables that were in rh_messages.c into an auto-generated header file (rh_messages.h) that contains the lists of unmaintained, deprecated and disabled drivers and pci devices.
For kernel-ark, there is no need to maintain driver and device lists so they are left empty. Note that for Gemini, there would be two separate lists depending on if we build RHEL 9 or 10.
Signed-off-by: Scott Weaver scweaver@redhat.com
diff --git a/kernel/rh_messages.c b/kernel/rh_messages.c index blahblah..blahblah 100644 --- a/kernel/rh_messages.c +++ b/kernel/rh_messages.c @@ -1,8 +1,3 @@ -/* - * WARNING: This file is auto-generated by an internal Red Hat script and, - * in general, should not be modified by hand. - */ - /* * The following functions are used by Red Hat to indicate to users that * hardware and drivers are unsupported, or have limited support in RHEL major @@ -23,208 +18,7 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> - -#define DEV_DESC_LEN 256 -static const char *rh_deprecated_drivers[] = { - "team", - "ebtables", - "arp_tables", - "ip_tables", - "ip6_tables", - "ip_set", - "nft_compat", - "firewire-core", - "" /* Terminating entry */ -}; - -static const char *rh_deprecated_init_fns[] = { - "team_module_init", - "ebtables_init", - "arp_tables_init", - "ip_tables_init", - "ip6_tables_init", - "ip_set_init", - "nft_compat_module_init", - "fw_core_init", - "" /* Terminating entry */ -}; - -static const char *rh_unmaintained_drivers[] = { - "bnx2", - "e1000", - "dl2k", - "hpsa", - "mptbase", - "mptsas", - "mptscsih", - "mptspi", - "myri10ge", - "netxen_nic", - "qla3xxx", - "hdlc_fr", - "nvmet-fc", - "nvmet-tcp", - "team", - "ebtables", - "arp_tables", - "ip_tables", - "ip6_tables", - "ip_set", - "nft_compat", - "nicvf", - "nicpf", - "" /* Terminating entry */ -}; - -static const char *rh_unmaintained_init_fns[] = { - "bnx2_pci_driver_init", - "e1000_init_module", - "rio_driver_init", - "hpsa_init", - "fusion_init", - "mptsas_init", - "fusion_init", - "mptspi_init", - "myri10ge_init_module", - "netxen_init_module", - "ql3xxx_driver_init", - "hdlc_fr_init", - "nvmet_fc_init_module", - "nvmet_tcp_init", - "team_module_init", - "ebtables_init", - "arp_tables_init", - "ip_tables_init", - "ip6_tables_init", - "ip_set_init", - "nft_compat_module_init", - "nicvf_init_module", - "nic_init_module", - "" /* Terminating entry */ -}; - -static const struct pci_device_id rh_deprecated_pci_devices[] = { - {0} /* Terminating entry */ -}; - -static const struct pci_device_id rh_disabled_pci_devices[] = { - { 0x1011, 0x0046, 0x103c, 0x10c2 }, - { 0x1011, 0x0046, 0x9005, 0x0364 }, - { 0x1011, 0x0046, 0x9005, 0x0365 }, - { 0x1011, 0x0046, 0x9005, 0x1364 }, - { 0x1028, 0x0001, 0x1028, 0x0001 }, - { 0x1028, 0x0002, 0x1028, 0x0002 }, - { 0x1028, 0x0002, 0x1028, 0x00d1 }, - { 0x1028, 0x0002, 0x1028, 0x00d9 }, - { 0x1028, 0x0003, 0x1028, 0x0003 }, - { 0x1028, 0x0004, 0x1028, 0x00d0 }, - { 0x1028, 0x000a, 0x1028, 0x0106 }, - { 0x1028, 0x000a, 0x1028, 0x011b }, - { 0x1028, 0x000a, 0x1028, 0x0121 }, - { 0x9005, 0x0200, 0x9005, 0x0200 }, - { 0x9005, 0x0283, 0x9005, 0x0283 }, - { 0x9005, 0x0284, 0x9005, 0x0284 }, - { 0x9005, 0x0285, PCI_ANY_ID, PCI_ANY_ID }, - { 0x9005, 0x0285, 0x1014, 0x02F2 }, - { 0x9005, 0x0285, 0x1014, 0x0312 }, - { 0x9005, 0x0285, 0x1028, PCI_ANY_ID }, - { 0x9005, 0x0285, 0x1028, 0x0287 }, - { 0x9005, 0x0285, 0x103C, 0x3227 }, - { 0x9005, 0x0285, 0x17aa, PCI_ANY_ID }, - { 0x9005, 0x0285, 0x17aa, 0x0286 }, - { 0x9005, 0x0285, 0x17aa, 0x0287 }, - { 0x9005, 0x0285, 0x9005, 0x0285 }, - { 0x9005, 0x0285, 0x9005, 0x0286 }, - { 0x9005, 0x0285, 0x9005, 0x0287 }, - { 0x9005, 0x0285, 0x9005, 0x0288 }, - { 0x9005, 0x0285, 0x9005, 0x0289 }, - { 0x9005, 0x0285, 0x9005, 0x028a }, - { 0x9005, 0x0285, 0x9005, 0x028b }, - { 0x9005, 0x0285, 0x9005, 0x028e }, - { 0x9005, 0x0285, 0x9005, 0x028f }, - { 0x9005, 0x0285, 0x9005, 0x0290 }, - { 0x9005, 0x0285, 0x9005, 0x0291 }, - { 0x9005, 0x0285, 0x9005, 0x0292 }, - { 0x9005, 0x0285, 0x9005, 0x0293 }, - { 0x9005, 0x0285, 0x9005, 0x0294 }, - { 0x9005, 0x0285, 0x9005, 0x0296 }, - { 0x9005, 0x0285, 0x9005, 0x0297 }, - { 0x9005, 0x0285, 0x9005, 0x0298 }, - { 0x9005, 0x0285, 0x9005, 0x0299 }, - { 0x9005, 0x0285, 0x9005, 0x029a }, - { 0x9005, 0x0285, 0x9005, 0x02a4 }, - { 0x9005, 0x0285, 0x9005, 0x02a5 }, - { 0x9005, 0x0286, PCI_ANY_ID, PCI_ANY_ID }, - { 0x9005, 0x0286, 0x1014, 0x9540 }, - { 0x9005, 0x0286, 0x1014, 0x9580 }, - { 0x9005, 0x0286, 0x9005, 0x028c }, - { 0x9005, 0x0286, 0x9005, 0x028d }, - { 0x9005, 0x0286, 0x9005, 0x029b }, - { 0x9005, 0x0286, 0x9005, 0x029c }, - { 0x9005, 0x0286, 0x9005, 0x029d }, - { 0x9005, 0x0286, 0x9005, 0x029e }, - { 0x9005, 0x0286, 0x9005, 0x029f }, - { 0x9005, 0x0286, 0x9005, 0x02a0 }, - { 0x9005, 0x0286, 0x9005, 0x02a1 }, - { 0x9005, 0x0286, 0x9005, 0x02a2 }, - { 0x9005, 0x0286, 0x9005, 0x02a3 }, - { 0x9005, 0x0286, 0x9005, 0x02a6 }, - { 0x9005, 0x0286, 0x9005, 0x0800 }, - { 0x9005, 0x0287, 0x9005, 0x0800 }, - { 0x9005, 0x0288, PCI_ANY_ID, PCI_ANY_ID }, - { 0x19a2, 0x0700, PCI_ANY_ID, PCI_ANY_ID }, - { 0x19a2, 0x0211, PCI_ANY_ID, PCI_ANY_ID }, - { 0x19a2, 0x0710, PCI_ANY_ID, PCI_ANY_ID }, - { 0x19a2, 0x0221, PCI_ANY_ID, PCI_ANY_ID }, - { 0x19a2, 0xe220, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0060, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0078, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x007C, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0411, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0413, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1028, 0x0015, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0064, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0065, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0070, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0072, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0074, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0076, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0077, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x007E, PCI_ANY_ID, PCI_ANY_ID }, - {0} /* Terminating entry */ -}; - -static const struct pci_device_id rh_unmaintained_pci_devices[] = { - { 0x10df, 0x0724, PCI_ANY_ID, PCI_ANY_ID }, - { 0x10df, 0xe200, PCI_ANY_ID, PCI_ANY_ID }, - { 0x10df, 0xe220, PCI_ANY_ID, PCI_ANY_ID }, - { 0x10df, 0xf011, PCI_ANY_ID, PCI_ANY_ID }, - { 0x10df, 0xf015, PCI_ANY_ID, PCI_ANY_ID }, - { 0x10df, 0xf100, PCI_ANY_ID, PCI_ANY_ID }, - { 0x10df, 0xfc40, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x005b, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0071, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0073, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0079, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x006E, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0080, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0081, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0082, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0083, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0084, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0085, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0086, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1000, 0x0087, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1077, 0x2031, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1077, 0x2532, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1077, 0x8031, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1924, 0x0803, PCI_ANY_ID, PCI_ANY_ID }, - { 0x1924, 0x0813, PCI_ANY_ID, PCI_ANY_ID }, - { 0x177d, 0xa01e, PCI_ANY_ID, PCI_ANY_ID }, - { 0x177d, 0xa034, PCI_ANY_ID, PCI_ANY_ID }, - { 0x177d, 0x0011, PCI_ANY_ID, PCI_ANY_ID }, - {0} /* Terminating entry */ -}; +#include "rh_messages.h"
/** * mark_hardware_unmaintained() - Mark hardware as unmaintained. @@ -252,7 +46,7 @@ void mark_hardware_unmaintained(const char *driver_name, char *fmt, ...)
va_start(args, fmt); vsnprintf(device_description, DEV_DESC_LEN, fmt, args); - pr_crit("Warning: Unmaintained Hardware is detected: %s:%s\n", + pr_crit(RH_UNMAINT_HW, driver_name, device_description); va_end(args); } @@ -282,7 +76,7 @@ void mark_hardware_deprecated(const char *driver_name, char *fmt, ...)
va_start(args, fmt); vsnprintf(device_description, DEV_DESC_LEN, fmt, args); - pr_crit("Warning: Deprecated Hardware is detected: %s:%s will not be maintained in a future major release and may be disabled\n", + pr_crit(RH_DEPRECATED_HW, driver_name, device_description); va_end(args); } @@ -311,7 +105,7 @@ static void mark_hardware_disabled(const char *driver_name, char *fmt, ...)
va_start(args, fmt); vsnprintf(device_description, DEV_DESC_LEN, fmt, args); - pr_crit("Warning: Disabled Hardware is detected: %s:%s is no longer enabled in this release.\n", + pr_crit(RH_DISABLED_HW, driver_name, device_description); va_end(args); } @@ -398,7 +192,7 @@ static void driver_unmaintained(const char* module_name)
while (rh_unmaintained_drivers[i]) { if (strcmp(rh_unmaintained_drivers[i], module_name) == 0) { - pr_crit("Warning: Unmaintained driver is detected: %s\n", module_name); + pr_crit(RH_UNMAINT_DR, module_name); return; } i++; @@ -427,7 +221,7 @@ static void driver_deprecated(const char* module_name)
while (rh_deprecated_drivers[i]) { if (strcmp(rh_deprecated_drivers[i], module_name) == 0) { - pr_crit("Warning: Deprecated Driver is detected: %s will not be maintained in a future major release and may be disabled\n", module_name); + pr_crit(RH_DEPRECATED_DR, module_name); return; } i++; @@ -459,7 +253,7 @@ static void init_fn_unmaintained(char* fn_name)
while (rh_unmaintained_init_fns[i]) { if (strcmp(rh_unmaintained_init_fns[i], fn_name) == 0) { - pr_crit("Warning: Unmaintained driver is detected: %s\n", fn_name); + pr_crit(RH_UNMAINT_DR, fn_name); return; } i++; @@ -488,7 +282,7 @@ static void init_fn_deprecated(char* fn_name)
while (rh_deprecated_init_fns[i]) { if (strcmp(rh_deprecated_init_fns[i], fn_name) == 0) { - pr_crit("Warning: Deprecated Driver is detected: %s will not be maintained in a future major release and may be disabled\n", fn_name); + pr_crit(RH_DEPRECATED_DR, fn_name); return; } i++; @@ -519,9 +313,7 @@ void mark_tech_preview(const char *msg, struct module *mod) str = mod->name; #endif
- pr_warn("TECH PREVIEW: %s may not be fully supported.\n" - "Please review provided documentation for limitations.\n", - (str ? str : "kernel")); + pr_warn(RH_TECH_PREVIEW, (str ? str : "kernel")); add_taint(TAINT_AUX, LOCKDEP_STILL_OK); #ifdef CONFIG_MODULES if (mod) @@ -529,34 +321,33 @@ void mark_tech_preview(const char *msg, struct module *mod) #endif } EXPORT_SYMBOL(mark_tech_preview); + /** * mark_partner_supported() - Mark driver or kernel subsystem as 'Partner Supported' * @msg: Driver or kernel subsystem name * * Called to minimize the support status of a new driver. This does TAINT the - * kernel. Calling this function indicates that the driver or subsystem has + * kernel. Calling this function indicates that the driver or subsystem * is not supported directly by Red Hat but by a partner engineer. * * Reserved for Internal Red Hat use only. */ void mark_partner_supported(const char *msg, struct module *mod) { - const char *str = NULL; + const char *str = NULL;
- if (msg) - str = msg; + if (msg) + str = msg; #ifdef CONFIG_MODULES else if (mod) str = mod->name; #endif
- pr_warn("Notice: %s is a Partner Supported GPL module and not supported directly by Red Hat.\n" - "Please contact your provider for support.\n", - (str ? str : "kernel")); - add_taint(TAINT_PARTNER_SUPPORTED, LOCKDEP_STILL_OK); + pr_warn(RH_PARTNER_SUPPORTED, (str ? str : "kernel")); + add_taint(TAINT_PARTNER_SUPPORTED, LOCKDEP_STILL_OK); #ifdef CONFIG_MODULES - if (mod) - mod->taints |= (1U << TAINT_PARTNER_SUPPORTED); + if (mod) + mod->taints |= (1U << TAINT_PARTNER_SUPPORTED); #endif } EXPORT_SYMBOL(mark_partner_supported); diff --git a/kernel/rh_messages.h b/kernel/rh_messages.h new file mode 100644 index blahblah..blahblah 100644 --- /dev/null +++ b/kernel/rh_messages.h @@ -0,0 +1,109 @@ +/* + * WARNING: This file is auto-generated by an internal Red Hat script and, + * in general, should not be modified by hand. + */ + +/* + * The following tables are used by Red Hat to define what hardware and drivers + * are unsupported, or have limited support in RHEL major and minor releases. + * + * Generally, the process of disabling a driver or device in RHEL requires the + * driver or device to be marked as 'deprecated' in all existing releases, and + * then either 'unmaintained' or 'disabled' in a future release. + * + * In general, deprecated and unmaintained drivers continue to receive security + * related fixes until they are disabled. + */ + +#ifndef __RH_MESSAGES_H +#define __RH_MESSAGES_H + +#include <linux/version.h> +#include <linux/pci.h> + +#define DEV_DESC_LEN 256 + +#define RH_UNMAINT_HW "Warning: Unmaintained Hardware is detected: %s:%s\n" + +#define RH_UNMAINT_DR "Warning: Unmaintained driver is detected: %s\n" + +#define RH_DEPRECATED_HW "Warning: Deprecated Hardware is detected: %s:%s " \ + "will not be maintained in a future major release " \ + "and may be disabled\n" + +#define RH_DEPRECATED_DR "Warning: Deprecated Driver is detected: %s will " \ + "not be maintained in a future major release and " \ + "may be disabled\n" + +#define RH_DISABLED_HW "Warning: Disabled Hardware is detected: %s:%s is " \ + "no longer enabled in this release.\n" + +#define RH_TECH_PREVIEW "TECH PREVIEW: %s may not be fully supported.\n" \ + "Please review provided documentation for " \ + "limitations.\n" + +#define RH_PARTNER_SUPPORTED "Warning: %s is a Partner supported GPL " \ + "module and not supported directly by Red Hat.\n" + +#if RHEL_MAJOR == 9 + +static const char *rh_deprecated_drivers[] = { + 0 /* Terminating entry */ +}; + +static const char *rh_deprecated_init_fns[] = { + 0 /* Terminating entry */ +}; + +static const char *rh_unmaintained_drivers[] = { + 0 /* Terminating entry */ +}; + +static const char *rh_unmaintained_init_fns[] = { + 0 /* Terminating entry */ +}; + +static const struct pci_device_id rh_deprecated_pci_devices[] = { + {0} /* Terminating entry */ +}; + +static const struct pci_device_id rh_disabled_pci_devices[] = { + {0} /* Terminating entry */ +}; + +static const struct pci_device_id rh_unmaintained_pci_devices[] = { + {0} /* Terminating entry */ +}; + +#else /* RHEL-10 */ + +static const char *rh_deprecated_drivers[] = { + 0 /* Terminating entry */ +}; + +static const char *rh_deprecated_init_fns[] = { + 0 /* Terminating entry */ +}; + +static const char *rh_unmaintained_drivers[] = { + 0 /* Terminating entry */ +}; + +static const char *rh_unmaintained_init_fns[] = { + 0 /* Terminating entry */ +}; + +static const struct pci_device_id rh_deprecated_pci_devices[] = { + {0} /* Terminating entry */ +}; + +static const struct pci_device_id rh_disabled_pci_devices[] = { + {0} /* Terminating entry */ +}; + +static const struct pci_device_id rh_unmaintained_pci_devices[] = { + {0} /* Terminating entry */ +}; +#endif /* RHEL_MAJOR */ + +#endif /* __RH_MESSAGES_H */
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2606
From: Scott Weaver on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2606#note_1494215...
I've removed it.
From: Don Zickus on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2606#note_1509536...
/block
temporarily blocking as I have heard hesitation about if there is anything else to do here. Let's discuss this at the weekly meeting.
I am wondering about the data piece. If this is merged then we regress because we now re-support all the deprecated hw that we excluding starting in rhel-8. Let's get a final checklist of how to finish this off.
From: Prarit Bhargava on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2606#note_1509582...
You heard what from whom?
I am wondering about the data piece. If this is merged then we regress
because we now re-support all the deprecated hw that we excluding starting in rhel-8. Let's get a final checklist of how to finish this off.
No that is not true. The date is up-to-date and was verified.
From: Prarit Bhargava on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2606#note_1509583...
And -- this doesn't affect kernel-ark. We need only the base code in place here. If you want to have a discussion on the data, then let's do that in the cs9 (or rhel8) mr.
From: Don Zickus on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2606#note_1512616...
/unblock
From: Don Zickus on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2606#note_1512618...
/unblock
kernel@lists.fedoraproject.org