Enable support for kernel 5.15
cover Enable support for kernel 5.15
Most of these are harmless conversions with backward-compatible wrappings. Only the last patch is a bit hairy as I'm unsure whether the new detection mechanism for vDSO VMAs is truly reliable. Therefore, this patch is not (yet?) targeting next, thus 3.2-rc2.
Jan
Jan Kiszka (9):
cobalt/dovetail: Use IRQ_WORK_INIT to please 5.11+
cobalt: Use close_fd for kernel 5.14+
cobalt: Use linux/stdarg.h
cobalt/posix: Add required FORCE makefile rule cobalt/thread: Switch to MAX_RT_PRIO
cobalt: Use fallthrough key word rather than comments drivers/can: Drop MODULE_SUPPORTED_DEVICE drivers/net/e1000e: Add missing ethtool.h include cobalt/debug: Detect vDSO via absence of vm_file
.../kernel/dovetail/pipeline/inband_work.h | 6 +----- kernel/cobalt/debug.c | 12 +++++------ kernel/cobalt/heap.c | 2 +- .../include/asm-generic/xenomai/wrappers.h | 19 ++++++++++++++++++ kernel/cobalt/include/linux/stdarg.h | 1 + kernel/cobalt/posix/Makefile | 4 ++-- kernel/cobalt/posix/compat.c | 2 +- kernel/cobalt/posix/mqueue.c | 2 +- kernel/cobalt/posix/process.c | 2 +- kernel/cobalt/posix/sched.c | 6 +++--- kernel/cobalt/posix/signal.c | 2 +- kernel/cobalt/posix/signal.h | 2 +- kernel/cobalt/posix/thread.h | 2 +- kernel/cobalt/rtdm/core.c | 4 ++-- kernel/cobalt/rtdm/fd.c | 2 +- kernel/cobalt/synch.c | 2 +- kernel/cobalt/thread.c | 4 ++-- kernel/cobalt/timer.c | 2 +- kernel/cobalt/vfile.c | 2 +- .../analogy/national_instruments/mio_common.c | 2 +- .../drivers/can/peak_canfd/rtcan_peak_canfd.c | 2 +- .../can/peak_canfd/rtcan_peak_pciefd.c | 3 +-- kernel/drivers/can/rtcan_flexcan.c | 2 +- kernel/drivers/can/rtcan_raw_dev.c | 2 +- kernel/drivers/can/sja1000/rtcan_adv_pci.c | 1 - kernel/drivers/can/sja1000/rtcan_ems_pci.c | 1 - kernel/drivers/can/sja1000/rtcan_esd_pci.c | 2 -- kernel/drivers/can/sja1000/rtcan_isa.c | 1 - kernel/drivers/can/sja1000/rtcan_ixxat_pci.c | 1 - kernel/drivers/can/sja1000/rtcan_mem.c | 1 - kernel/drivers/can/sja1000/rtcan_peak_dng.c | 1 - kernel/drivers/can/sja1000/rtcan_peak_pci.c | 11 +++++----- kernel/drivers/can/sja1000/rtcan_plx_pci.c | 7 ------- kernel/drivers/can/sja1000/rtcan_sja1000.c | 1 - kernel/drivers/ipc/bufp.c | 2 +- kernel/drivers/ipc/iddp.c | 2 +- kernel/drivers/ipc/xddp.c | 2 +- kernel/drivers/net/drivers/e1000/e1000_hw.c | 20 +++++++++---------- kernel/drivers/net/drivers/e1000/e1000_main.c | 2 +- kernel/drivers/net/drivers/e1000e/82571.c | 4 ++-- kernel/drivers/net/drivers/e1000e/e1000.h | 1 + kernel/drivers/net/drivers/e1000e/ich8lan.c | 8 ++++---- kernel/drivers/net/drivers/e1000e/netdev.c | 4 ++-- .../experimental/e1000/e1000_ethtool.c | 4 ++-- .../drivers/experimental/e1000/e1000_main.c | 10 +++++----- .../drivers/experimental/e1000/e1000_param.c | 2 +- kernel/drivers/net/drivers/igb/e1000_82575.c | 4 ++-- kernel/drivers/net/drivers/igb/e1000_nvm.c | 2 +- kernel/drivers/net/drivers/igb/e1000_phy.c | 4 ++-- kernel/drivers/net/drivers/igb/igb_main.c | 10 +++++----- kernel/drivers/net/stack/ipv4/udp/udp.c | 2 +- kernel/drivers/net/stack/packet/af_packet.c | 2 +- kernel/drivers/testing/switchtest.c | 2 +- scripts/prepare-kernel.sh | 1 + 54 files changed, 101 insertions(+), 103 deletions(-) create mode 100644 kernel/cobalt/include/linux/stdarg.h
Signature · 1 line
2.31.1
PATCH 1/9 cobalt/dovetail: Use IRQ_WORK_INIT to please 5.11+
From: Jan Kiszka <[email protected]>
--- include/cobalt/kernel/dovetail/pipeline/inband_work.h | 6 +----- kernel/cobalt/include/asm-generic/xenomai/wrappers.h | 7 +++++++ 2 files changed, 8 insertions(+), 5 deletions(-)
include/cobalt/kernel/dovetail/pipeline/inband_work.h +1 -5
@@ -19,11 +19,7 @@ struct pipeline_inband_work {#define PIPELINE_INBAND_WORK_INITIALIZER (__work, __handler) \ { \ - .work = { \ - .func = (void (*)(struct irq_work *)) \ - __handler, \ - .flags = ATOMIC_INIT(0), \ - }, \ + .work = IRQ_WORK_INIT((void (*)(struct irq_work *))__handler), \ }#define pipeline_post_inband_work (__work) \
kernel/cobalt/include/asm-generic/xenomai/wrappers.h +7 -0
@@ -231,4 +231,11 @@ devm_hwmon_device_register_with_groups(struct device *dev, const char *name, kernel_read_file(__file, 0, __buf, __buf_size, __file_size, __id)#endif +#if LINUX_VERSION_CODE <KERNEL_VERSION (5 ,11 ,0 ) +#define IRQ_WORK_INIT (_func) (struct irq_work){ \ + .node = { .u_flags = 0, }, \ + .func = (_func), \ +} +#endif +#endif /* _COBALT_ASM_GENERIC_WRAPPERS_H */
Signature · 1 line
2.31.1
PATCH 2/9 cobalt: Use close_fd for kernel 5.14+
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Wrap it on __close_fd for older kernels.
--- kernel/cobalt/include/asm-generic/xenomai/wrappers.h | 4 ++++ kernel/cobalt/rtdm/core.c | 4 ++-- kernel/cobalt/rtdm/fd.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-)
kernel/cobalt/include/asm-generic/xenomai/wrappers.h +4 -0
@@ -238,4 +238,8 @@ devm_hwmon_device_register_with_groups(struct device *dev, const char *name, }#endif +#if LINUX_VERSION_CODE <KERNEL_VERSION (5 ,14 ,0 ) +#define close_fd (__ufd) __close_fd(current->files, __ufd) +#endif +#endif /* _COBALT_ASM_GENERIC_WRAPPERS_H */
kernel/cobalt/rtdm/core.c +2 -2
@@ -66,7 +66,7 @@ int __rtdm_anon_getfd(const char *name, int flags)void __rtdm_anon_putfd (int ufd) { -__close_fd (current->files, ufd); +close_fd (ufd); } static int create_instance(int ufd, struct rtdm_device *dev,
@@ -247,7 +247,7 @@ int __rtdm_dev_socket(int protocol_family, int socket_type, fail_socket:cleanup_instance (dev, context); fail_create: -__close_fd (current->files, ufd); +close_fd (ufd); fail_getfd:__rtdm_put_device (dev);
kernel/cobalt/rtdm/fd.c +1 -1
@@ -902,7 +902,7 @@ eadv:* rtdm_fd are still pending. */ __fd_close (ppd, idx, s); -__close_fd (current->files, ufd); +close_fd (ufd);return 0 ; }
Signature · 1 line
2.31.1
PATCH 3/9 cobalt: Use linux/stdarg.h
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Required with kernel 5.15 to avoid duplicate includes. Provide a stub for older kernels that continues to use the toolchain header.
--- kernel/cobalt/heap.c | 2 +- kernel/cobalt/include/linux/stdarg.h | 1 + kernel/cobalt/posix/mqueue.c | 2 +- kernel/cobalt/posix/process.c | 2 +- kernel/cobalt/posix/thread.h | 2 +- kernel/cobalt/synch.c | 2 +- kernel/cobalt/vfile.c | 2 +- scripts/prepare-kernel.sh | 1 + 8 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 kernel/cobalt/include/linux/stdarg.h
kernel/cobalt/heap.c +1 -1
@@ -16,7 +16,7 @@* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/vmalloc.h> #include <linux/slab.h> #include <linux/kernel.h>
kernel/cobalt/include/linux/stdarg.h new file +1 -0
@@ -0,0 +1 @@ +#include <stdarg.h>
kernel/cobalt/posix/mqueue.c +1 -1
@@ -16,7 +16,7 @@* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/slab.h> #include <linux/mm.h> #include <linux/sched.h>
kernel/cobalt/posix/process.c +1 -1
@@ -21,7 +21,7 @@* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/unistd.h> #include <linux/init.h> #include <linux/module.h>
kernel/cobalt/posix/thread.h +1 -1
@@ -18,7 +18,7 @@#ifndef _COBALT_POSIX_THREAD_H#define _COBALT_POSIX_THREAD_H -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/types.h> #include <linux/time.h> #include <linux/signal.h>
kernel/cobalt/synch.c +1 -1
@@ -16,7 +16,7 @@* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/signal.h> #include <cobalt/kernel/sched.h> #include <cobalt/kernel/synch.h>
kernel/cobalt/vfile.c +1 -1
@@ -15,7 +15,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <stdarg.h> +#include <linux/stdarg.h> #include <linux/ctype.h> #include <linux/uaccess.h> #include <linux/module.h>
scripts/prepare-kernel.sh +1 -0
@@ -453,6 +453,7 @@ patch_link r n include/cobalt/kernel/$pipeline_type/pipeline include/xenomai/pip patch_link r n include/cobalt/uapi include/xenomai/cobalt/uapi patch_link r n include/rtdm/uapi include/xenomai/rtdm/uapi patch_link n version.h include/xenomai include/xenomai +patch_link n stdarg.h kernel/cobalt/include/linux include/xenomai/linux if test "x$output_patch" != "x"; then if test x$verbose = x1; then
Signature · 1 line
2.31.1
PATCH 4/9 cobalt/posix: Add required FORCE makefile rule
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Enforced by recent kernels.
--- kernel/cobalt/posix/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/cobalt/posix/Makefile +2 -2
@@ -26,9 +26,9 @@ xenomai-y := \ syscall_entries := $(srctree)/$(src)/gen-syscall-entries.sh quiet_cmd_syscall_entries = GEN $@ - cmd_syscall_entries = $(CONFIG_SHELL) '$(syscall_entries)' $^ > $@ + cmd_syscall_entries = $(CONFIG_SHELL) '$(syscall_entries)' $(filter-out FORCE,$^) > $@ -$(obj)/syscall_entries.h: $(syscall_entries) $(wildcard $(srctree)/$(src)/*.c) +$(obj)/syscall_entries.h: $(syscall_entries) $(wildcard $(srctree)/$(src)/*.c) FORCE $(call if_changed,syscall_entries) target += syscall_entries.h
Signature · 1 line
2.31.1
PATCH 5/9 cobalt/thread: Switch to MAX_RT_PRIO
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Identical to MAX_USER_RT_PRIO which was removed in 5.12.
--- kernel/cobalt/thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/cobalt/thread.c +2 -2
@@ -2008,8 +2008,8 @@ void __xnthread_propagate_schedparam(struct xnthread *curr)*/ if (xnthread_test_state (curr,XNWEAK ) && kprio ==0 ) kpolicy =SCHED_NORMAL ; -else if (kprio >=MAX_USER_RT_PRIO ) - kprio =MAX_USER_RT_PRIO -1 ; +else if (kprio >=MAX_RT_PRIO ) + kprio =MAX_RT_PRIO -1 ;if (p->policy != kpolicy || (kprio >0 && p->rt_priority != kprio)) { param.sched_priority = kprio;
Signature · 1 line
2.31.1
PATCH 6/9 cobalt: Use fallthrough key word rather than comments
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Kernel 5.14 requires this.
--- .../include/asm-generic/xenomai/wrappers.h | 8 ++++++++ kernel/cobalt/posix/compat.c | 2 +- kernel/cobalt/posix/sched.c | 6 +++--- kernel/cobalt/posix/signal.c | 2 +- kernel/cobalt/posix/signal.h | 2 +- kernel/cobalt/timer.c | 2 +- .../analogy/national_instruments/mio_common.c | 2 +- .../drivers/can/peak_canfd/rtcan_peak_canfd.c | 2 +- .../can/peak_canfd/rtcan_peak_pciefd.c | 2 +- kernel/drivers/can/rtcan_flexcan.c | 2 +- kernel/drivers/can/rtcan_raw_dev.c | 2 +- kernel/drivers/can/sja1000/rtcan_peak_pci.c | 10 +++++----- kernel/drivers/ipc/bufp.c | 2 +- kernel/drivers/ipc/iddp.c | 2 +- kernel/drivers/ipc/xddp.c | 2 +- kernel/drivers/net/drivers/e1000/e1000_hw.c | 20 +++++++++---------- kernel/drivers/net/drivers/e1000/e1000_main.c | 2 +- kernel/drivers/net/drivers/e1000e/82571.c | 4 ++-- kernel/drivers/net/drivers/e1000e/ich8lan.c | 8 ++++---- kernel/drivers/net/drivers/e1000e/netdev.c | 4 ++-- .../experimental/e1000/e1000_ethtool.c | 4 ++-- .../drivers/experimental/e1000/e1000_main.c | 10 +++++----- .../drivers/experimental/e1000/e1000_param.c | 2 +- kernel/drivers/net/drivers/igb/e1000_82575.c | 4 ++-- kernel/drivers/net/drivers/igb/e1000_nvm.c | 2 +- kernel/drivers/net/drivers/igb/e1000_phy.c | 4 ++-- kernel/drivers/net/drivers/igb/igb_main.c | 10 +++++----- kernel/drivers/net/stack/ipv4/udp/udp.c | 2 +- kernel/drivers/net/stack/packet/af_packet.c | 2 +- kernel/drivers/testing/switchtest.c | 2 +- 30 files changed, 68 insertions(+), 60 deletions(-)
kernel/cobalt/include/asm-generic/xenomai/wrappers.h +8 -0
@@ -231,6 +231,14 @@ devm_hwmon_device_register_with_groups(struct device *dev, const char *name, kernel_read_file(__file, 0, __buf, __buf_size, __file_size, __id)#endif +#if LINUX_VERSION_CODE <KERNEL_VERSION (5 ,4 ,0 ) +#if __has_attribute (__fallthrough__) +# define fallthrough __attribute__((__fallthrough__)) +#else +# define fallthrough do {} while (0)/* fallthrough */ +#endif +#endif +#if LINUX_VERSION_CODE <KERNEL_VERSION (5 ,11 ,0 )#define IRQ_WORK_INIT (_func) (struct irq_work){ \ .node = { .u_flags = 0, }, \
kernel/cobalt/posix/compat.c +1 -1
@@ -424,7 +424,7 @@ int sys32_put_siginfo(void __user *u_si, const struct siginfo *si,case SI_QUEUE :case SI_MESGQ : ret |=__xn_put_user (ptr_to_compat (si->si_ptr), &u_p->si_ptr); -/* fallthrough */ + fallthrough;case SI_USER : ret |=__xn_put_user (si->si_pid, &u_p->si_pid); ret |=__xn_put_user (si->si_uid, &u_p->si_uid);
kernel/cobalt/posix/sched.c +3 -3
@@ -58,7 +58,7 @@ cobalt_sched_policy_param(union xnsched_policy_param *param,* levels. Otherwise, SCHED_NORMAL is scheduled by * xnsched_class_rt at priority level #0. */ -/* fallthrough */ + fallthrough;case SCHED_WEAK :#ifdef CONFIG_XENO_OPT_SCHED_WEAK if (prio < XNSCHED_WEAK_MIN_PRIO ||
@@ -76,7 +76,7 @@ cobalt_sched_policy_param(union xnsched_policy_param *param, tslice =u_ts2ns (¶m_ex->sched_rr_quantum);if (tslice ==XN_INFINITE && tslice_r) tslice = *tslice_r; -/* fallthrough */ + fallthrough;case SCHED_FIFO :if (prio <XNSCHED_FIFO_MIN_PRIO || prio >XNSCHED_FIFO_MAX_PRIO )
@@ -249,7 +249,7 @@ int set_tp_config(int cpu, union sched_config *config, size_t len)case sched_tp_install:if (config->tp.nr_windows >0 )break ; -/* fallthrough */ + fallthrough;case sched_tp_uninstall: gps =NULL ; goto set_schedule;
kernel/cobalt/posix/signal.c +1 -1
@@ -235,7 +235,7 @@ static int signal_put_siginfo(void __user *u_si, const struct siginfo *si,case SI_QUEUE :case SI_MESGQ : ret |=__xn_put_user (si->si_ptr, &u_p->si_ptr); -/* fallthrough */ + fallthrough;case SI_USER : ret |=__xn_put_user (si->si_pid, &u_p->si_pid); ret |=__xn_put_user (si->si_uid, &u_p->si_uid);
kernel/cobalt/posix/signal.h +1 -1
@@ -49,7 +49,7 @@ void cobalt_copy_siginfo(int code,case SI_QUEUE :case SI_MESGQ : dst->si_value = src->si_value; -/* fallthrough */ + fallthrough;case SI_USER : dst->si_pid = src->si_pid; dst->si_uid = src->si_uid;
kernel/cobalt/timer.c +1 -1
@@ -140,7 +140,7 @@ int xntimer_start(struct xntimer *timer,case XN_REALTIME : timer->status |=XNTIMER_REALTIME ; value -=xnclock_get_offset (clock); -/* fall through */ + fallthrough;default :/* XN_ABSOLUTE || XN_REALTIME */ date =xnclock_ns_to_ticks (clock, value);if ((xnsticks_t)(date - now) <=0 ) {
kernel/drivers/analogy/national_instruments/mio_common.c +1 -1
@@ -4014,7 +4014,7 @@ static void ni_gpct_write_register(struct ni_gpct *counter,break ;case NITIO_G01_Joint_Reset_Reg:BUG_ON (bits & ~gpct_joint_reset_mask); -/* fall-through */ + fallthrough;default : stc_register =ni_gpct_to_stc_register (reg); devpriv->stc_writew (dev, bits, stc_register);
kernel/drivers/can/peak_canfd/rtcan_peak_canfd.c +1 -1
@@ -493,7 +493,7 @@ static int peak_canfd_set_mode(struct rtcan_device *rdev, can_mode_t mode,if (rdev->state ==CAN_STATE_SLEEPING )break ; -/* fallthrough */ + fallthrough;default : err = -EOPNOTSUPP ;break ;
kernel/drivers/can/peak_canfd/rtcan_peak_pciefd.c +1 -1
@@ -698,7 +698,7 @@ static int pciefd_can_probe(struct pciefd_board *pciefd)pciefd_can_writereg (priv,CANFD_CLK_SEL_80MHZ ,PCIEFD_REG_CAN_CLK_SEL ); -/* fallthrough */ + fallthrough;case CANFD_CLK_SEL_80MHZ : priv->ucan.rdev->can_sys_clock =80 *1000 *1000 ;break ;
kernel/drivers/can/rtcan_flexcan.c +1 -1
@@ -604,7 +604,7 @@ static void flexcan_change_state(struct rtcan_device *dev, CAN_ERR_CRTL_TX_WARNING :CAN_ERR_CRTL_RX_WARNING ; } -/* fallthrough */ + fallthrough;case CAN_STATE_ERROR_WARNING :/* * from: ERROR_ACTIVE, ERROR_WARNING
kernel/drivers/can/rtcan_raw_dev.c +1 -1
@@ -374,7 +374,7 @@ int rtcan_raw_ioctl_dev(struct rtdm_fd *fd, int request, void *arg)case SIOCGCANBAUDRATE :case SIOCGCANCUSTOMBITTIME : get =1 ; -/* fallthrough */ + fallthrough;case SIOCSCANMODE :case SIOCSCANCTRLMODE :case SIOCSCANBAUDRATE :
kernel/drivers/can/sja1000/rtcan_peak_pci.c +5 -5
@@ -142,7 +142,7 @@ static void rtcan_peak_pci_del_chan(struct rtcan_device *dev,printk ("Removing %s %s device %s\n" , peak_pci_board_name, dev->ctrl_name, dev->name);rtcan_sja1000_unregister (dev); -/* fallthrough */ + fallthrough;case 5 : pita_icr_high =readw (board->conf_addr +PITA_ICR +2 );if (board->channel ==CHANNEL_SLAVE ) {
@@ -151,17 +151,17 @@ static void rtcan_peak_pci_del_chan(struct rtcan_device *dev, pita_icr_high &= ~0x0002 ; }writew (pita_icr_high, board->conf_addr +PITA_ICR +2 ); -/* fallthrough */ + fallthrough;case 4 :iounmap ((void *)board->base_addr); -/* fallthrough */ + fallthrough;case 3 :if (board->channel !=CHANNEL_SLAVE )iounmap ((void *)board->conf_addr); -/* fallthrough */ + fallthrough;case 2 :rtcan_dev_free (dev); -/* fallthrough */ + fallthrough;case 1 :break ; }
kernel/drivers/ipc/bufp.c +1 -1
@@ -1035,7 +1035,7 @@ static int bufp_ioctl(struct rtdm_fd *fd, COMPAT_CASE(_RTIOC_BIND):if (rtdm_in_rt_context ())return -ENOSYS ;/* Try downgrading to NRT */ -/* fallthrough */ + fallthrough;default : ret =__bufp_ioctl (fd, request, arg); }
kernel/drivers/ipc/iddp.c +1 -1
@@ -916,7 +916,7 @@ static int iddp_ioctl(struct rtdm_fd *fd, COMPAT_CASE(_RTIOC_BIND):if (rtdm_in_rt_context ())return -ENOSYS ;/* Try downgrading to NRT */ -/* fallthrough */ + fallthrough;default : ret =__iddp_ioctl (fd, request, arg); }
kernel/drivers/ipc/xddp.c +1 -1
@@ -1079,7 +1079,7 @@ static int xddp_ioctl(struct rtdm_fd *fd, COMPAT_CASE(_RTIOC_BIND):if (rtdm_in_rt_context ())return -ENOSYS ;/* Try downgrading to NRT */ -/* fallthrough */ + fallthrough;default : ret =__xddp_ioctl (fd, request, arg); }
kernel/drivers/net/drivers/e1000/e1000_hw.c +10 -10
@@ -126,7 +126,7 @@ e1000_set_phy_type(struct e1000_hw *hw) hw->phy_type = e1000_phy_igp;break ; } -/* fallthrough */ + fallthrough;case IGP03E1000_E_PHY_ID : hw->phy_type = e1000_phy_igp_3;break ;
@@ -140,7 +140,7 @@ e1000_set_phy_type(struct e1000_hw *hw) hw->phy_type = e1000_phy_gg82563;break ; } -/* fallthrough */ + fallthrough;default :/* Should never have loaded on this device */ hw->phy_type = e1000_phy_undefined;
@@ -373,12 +373,12 @@ e1000_set_mac_type(struct e1000_hw *hw)break ;case e1000_80003es2lan: hw->swfw_sync_present = TRUE; -/* fall through */ + fallthrough;case e1000_82571:case e1000_82572:case e1000_82573: hw->eeprom_semaphore_present = TRUE; -/* fall through */ + fallthrough;case e1000_82541:case e1000_82547:case e1000_82541_rev_2:
@@ -611,7 +611,7 @@ e1000_reset_hw(struct e1000_hw *hw)E1000_WRITE_REG (hw,CTRL_EXT , ctrl_ext);E1000_WRITE_FLUSH (hw); } -/* fall through */ + fallthrough;case e1000_82571:case e1000_82572:case e1000_ich8lan:
@@ -834,7 +834,7 @@ e1000_init_hw(struct e1000_hw *hw) reg_data =E1000_READ_REG_ARRAY (hw,FFLT ,0x0001 ); reg_data &= ~0x00100000 ;E1000_WRITE_REG_ARRAY (hw,FFLT ,0x0001 , reg_data); -/* Fall through */ + fallthrough;case e1000_82571:case e1000_82572:case e1000_ich8lan:
@@ -5870,7 +5870,7 @@ e1000_rar_set(struct e1000_hw *hw,case e1000_80003es2lan:if (hw->leave_av_bit_off == TRUE)break ; -/* fallthrough */ + fallthrough;default :/* Indicate to hardware the Address is Valid. */ rar_high |=E1000_RAH_AV ;
@@ -6062,7 +6062,7 @@ e1000_setup_led(struct e1000_hw *hw) ~IGP01E1000_GMII_SPD));if (ret_val)return ret_val; -/* Fall Through */ + fallthrough;default :if (hw->media_type == e1000_media_type_fiber) { ledctl =E1000_READ_REG (hw,LEDCTL );
@@ -6150,7 +6150,7 @@ e1000_cleanup_led(struct e1000_hw *hw) hw->phy_spd_default);if (ret_val)return ret_val; -/* Fall Through */ + fallthrough;default :if (hw->phy_type == e1000_phy_ife) {e1000_write_phy_reg (hw,IFE_PHY_SPECIAL_CONTROL_LED ,0 );
@@ -8030,7 +8030,7 @@ e1000_get_phy_cfg_done(struct e1000_hw *hw)/* Separate *_CFG_DONE_* bit for each port */ if (E1000_READ_REG (hw,STATUS ) &E1000_STATUS_FUNC_1 ) cfg_mask =E1000_EEPROM_CFG_DONE_PORT_1 ; -/* Fall Through */ + fallthrough;case e1000_82571:case e1000_82572:while (timeout) {
kernel/drivers/net/drivers/e1000/e1000_main.c +1 -1
@@ -893,7 +893,7 @@ static int e1000_probe(struct pci_dev *pdev, EEPROM_INIT_CONTROL3_PORT_B, 1, &eeprom_data);break ; } -/* Fall Through */ + fallthrough;default :e1000_read_eeprom (&adapter->hw,EEPROM_INIT_CONTROL3_PORT_A ,1 , &eeprom_data);
kernel/drivers/net/drivers/e1000e/82571.c +2 -2
@@ -199,7 +199,7 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)ew32 (EECD , eecd);break ; } -/* Fall Through */ + fallthrough;default : nvm->type = e1000_nvm_eeprom_spi; size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
@@ -1172,7 +1172,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)switch (mac->type) {case e1000_82573:e1000e_enable_tx_pkt_filtering (hw); -/* fall through */ + fallthrough;case e1000_82574:case e1000_82583: reg_data =er32 (GCR );
kernel/drivers/net/drivers/e1000e/ich8lan.c +4 -4
@@ -397,7 +397,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) goto out;if ((phy->id !=0 ) && (phy->id !=PHY_REVISION_MASK ))break ; -/* fall-through */ + fallthrough;case e1000_pch2lan:case e1000_pch_lpt:/*
@@ -770,7 +770,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) ret_val =e1000_k1_workaround_lv (hw);if (ret_val) goto out; -/* fall-thru */ + fallthrough;case e1000_pchlan:if (hw->phy.type == e1000_phy_82578) { ret_val =e1000_link_stall_workaround_hv (hw);
@@ -1210,7 +1210,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) sw_cfg_mask =E1000_FEXTNVM_SW_CONFIG ;break ; } -/* Fall-thru */ + fallthrough;case e1000_pchlan:case e1000_pch2lan:case e1000_pch_lpt:
@@ -2267,7 +2267,7 @@ static s32 e1000_valid_nvm_bank_detect_ich8lan(struct e1000_hw *hw, u32 *bank) }e_dbg ("Unable to determine valid NVM bank via EEC - " "reading flash signature\n" ); -/* fall-thru */ + fallthrough;default :/* set bank to 0 in case flash read fails */ *bank =0 ;
kernel/drivers/net/drivers/e1000e/netdev.c +2 -2
@@ -1239,7 +1239,7 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)e1000e_reset_interrupt_capability (adapter); } adapter->int_mode =E1000E_INT_MODE_MSI ; -/* Fall through */ + fallthrough;case E1000E_INT_MODE_MSI :if (!pci_enable_msi (adapter->pdev)) { adapter->flags |=FLAG_MSI_ENABLED ;
@@ -1248,7 +1248,7 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)e_err ("Failed to initialize MSI interrupts. Falling " "back to legacy interrupts.\n" ); } -/* Fall through */ + fallthrough;case E1000E_INT_MODE_LEGACY :/* Don't do anything; this is the system default */ break ;
kernel/drivers/net/drivers/experimental/e1000/e1000_ethtool.c +2 -2
@@ -1565,7 +1565,7 @@ static void e1000_loopback_cleanup(struct e1000_adapter *adapter)E1000_WRITE_REG (hw,E1000_CTRL_EXT , adapter->tx_fifo_head); adapter->tx_fifo_head =0 ; } -/* fall through */ + fallthrough;case e1000_82571:case e1000_82572: if (hw->phy.media_type == e1000_media_type_fiber ||
@@ -1575,7 +1575,7 @@ static void e1000_loopback_cleanup(struct e1000_adapter *adapter)msleep (10 );break ; } -/* Fall Through */ + fallthrough;case e1000_82545:case e1000_82546:case e1000_82545_rev_3:
kernel/drivers/net/drivers/experimental/e1000/e1000_main.c +5 -5
@@ -1314,7 +1314,7 @@ static int e1000_probe(struct pci_dev *pdev, NVM_INIT_CONTROL3_PORT_B, 1, &eeprom_data);break ; } -/* Fall Through */ + fallthrough;default :e1000_read_nvm (&adapter->hw,NVM_INIT_CONTROL3_PORT_A ,1 , &eeprom_data);
@@ -1536,7 +1536,7 @@ static int e1000_sw_init(struct e1000_adapter *adapter) adapter->num_rx_queues =2 ;break ; } -/* Fall through - remaining ICH SKUs do not support MQ */ + fallthrough;/* remaining ICH SKUs do not support MQ */ default :/* All hardware before 82571 only have 1 queue each for Rx/Tx. * However, the 82571 family does not have MSI-X, so multi-
@@ -2396,11 +2396,11 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)case 3 : psrctl |=PAGE_SIZE <<E1000_PSRCTL_BSIZE3_SHIFT ; -/* fall through */ + fallthrough;case 2 : psrctl |=PAGE_SIZE <<E1000_PSRCTL_BSIZE2_SHIFT ; -/* fall through */ + fallthrough;case 1 : psrctl |=PAGE_SIZE >>E1000_PSRCTL_BSIZE1_SHIFT ;
@@ -3780,7 +3780,7 @@ static int e1000_xmit_frame_ring(struct sk_buff *skb,* into the next dword */ if ((unsigned long )(skb_tail_pointer (skb) -1 ) &4 )break ; -/* fall through */ + fallthrough;case e1000_82571:case e1000_82572:case e1000_82573:
kernel/drivers/net/drivers/experimental/e1000/e1000_param.c +1 -1
@@ -872,7 +872,7 @@ static void e1000_check_copper_options(struct e1000_adapter *adapter)case SPEED_1000 +HALF_DUPLEX :DPRINTK (PROBE ,INFO ,"Half Duplex is not supported at 1000 Mbps\n" ); -/* fall through */ + fallthrough;case SPEED_1000 +FULL_DUPLEX : full_duplex_only: DPRINTK(PROBE, INFO,
kernel/drivers/net/drivers/igb/e1000_82575.c +2 -2
@@ -608,7 +608,7 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)break ; }/* for I2C based SGMII: */ -/* fallthrough */ + fallthrough;case E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES :/* read media type from SFP EEPROM */ ret_val =igb_set_sfp_media_type_82575 (hw);
@@ -1670,7 +1670,7 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX :/* disable PCS autoneg and support parallel detect only */ pcs_autoneg = false; -/* fallthrough */ + fallthrough;default :if (hw->mac.type == e1000_82575 || hw->mac.type == e1000_82576) {
kernel/drivers/net/drivers/igb/e1000_nvm.c +1 -1
@@ -742,7 +742,7 @@ void igb_get_fw_version(struct e1000_hw *hw, struct e1000_fw_version *fw_vers)igb_read_invm_version (hw, fw_vers);return ; } -/* fall through */ + fallthrough;case e1000_i350:/* find combo image version */ hw->nvm.ops.read (hw,NVM_COMB_VER_PTR ,1 , &comb_offset);
kernel/drivers/net/drivers/igb/e1000_phy.c +2 -2
@@ -682,7 +682,7 @@ s32 igb_copper_link_setup_m88_gen2(struct e1000_hw *hw) phy_data |=M88E1000_PSCR_AUTO_X_1000T ;break ; } -/* fallthrough */ + fallthrough;case 0 :default : phy_data |=M88E1000_PSCR_AUTO_X_MODE ;
@@ -2504,7 +2504,7 @@ static s32 igb_set_master_slave_mode(struct e1000_hw *hw)break ;case e1000_ms_auto: phy_data &= ~CR_1000T_MS_ENABLE ; -/* fall-through */ + fallthrough;default :break ; }
kernel/drivers/net/drivers/igb/igb_main.c +5 -5
@@ -638,14 +638,14 @@ static void igb_cache_ring_register(struct igb_adapter *adapter)* In order to avoid collision we start at the first free queue * and continue consuming queues in the same sequence */ -/* Fall through */ + fallthrough;case e1000_82575:case e1000_82580:case e1000_i350:case e1000_i354:case e1000_i210:case e1000_i211: -/* Fall through */ + fallthrough;default :for (; i < adapter->num_rx_queues; i++) adapter->rx_ring[i]->reg_idx = rbase_offset + i;
@@ -1876,7 +1876,7 @@ void igb_set_fw_version(struct igb_adapter *adapter) fw.invm_img_type);break ; } -/* fall through */ + fallthrough;default :/* if option is rom valid, display its version too */ if (fw.or_valid) {
@@ -2514,7 +2514,7 @@ static void igb_init_queue_configuration(struct igb_adapter *adapter)* should pair the queues in order to conserve interrupts due * to limited supply. */ -/* fall through */ + fallthrough;case e1000_82580:case e1000_i350:case e1000_i354:
@@ -3550,7 +3550,7 @@ bool igb_has_link(struct igb_adapter *adapter)case e1000_media_type_copper:if (!hw->mac.get_link_status)return true; -/* fallthrough */ + fallthrough;case e1000_media_type_internal_serdes: hw->mac.ops.check_for_link (hw); link_active = !hw->mac.get_link_status;
kernel/drivers/net/stack/ipv4/udp/udp.c +1 -1
@@ -422,7 +422,7 @@ ssize_t rt_udp_recvmsg(struct rtdm_fd *fd, struct user_msghdr *msg,switch (ret) {default : ret = -EBADF ;/* socket has been closed */ -/* fallthrough */ + fallthrough;case -EWOULDBLOCK :case -ETIMEDOUT :case -EINTR :
kernel/drivers/net/stack/packet/af_packet.c +1 -1
@@ -326,7 +326,7 @@ static ssize_t rt_packet_recvmsg(struct rtdm_fd *fd, struct user_msghdr *msg,switch (ret) {default : ret = -EBADF ;/* socket has been closed */ -/* fallthrough */ + fallthrough;case -EWOULDBLOCK :case -ETIMEDOUT :case -EINTR :
kernel/drivers/testing/switchtest.c +1 -1
@@ -432,7 +432,7 @@ static void rtswitch_ktask(void *cookie)if (to == task->base.index) ++to; -/* Fall through. */ + fallthrough;case 2 :rtswitch_to_rt (ctx, task->base.index, to); }
Signature · 1 line
2.31.1
PATCH 7/9 drivers/can: Drop MODULE_SUPPORTED_DEVICE
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Was a nop and got removed in kernel 5.12.
--- kernel/drivers/can/peak_canfd/rtcan_peak_pciefd.c | 1 - kernel/drivers/can/sja1000/rtcan_adv_pci.c | 1 - kernel/drivers/can/sja1000/rtcan_ems_pci.c | 1 - kernel/drivers/can/sja1000/rtcan_esd_pci.c | 2 -- kernel/drivers/can/sja1000/rtcan_isa.c | 1 - kernel/drivers/can/sja1000/rtcan_ixxat_pci.c | 1 - kernel/drivers/can/sja1000/rtcan_mem.c | 1 - kernel/drivers/can/sja1000/rtcan_peak_dng.c | 1 - kernel/drivers/can/sja1000/rtcan_peak_pci.c | 1 - kernel/drivers/can/sja1000/rtcan_plx_pci.c | 7 ------- kernel/drivers/can/sja1000/rtcan_sja1000.c | 1 - 11 files changed, 18 deletions(-)
kernel/drivers/can/peak_canfd/rtcan_peak_pciefd.c +0 -1
@@ -35,7 +35,6 @@ static char *pciefd_board_name = "PEAK-PCIe FD";MODULE_AUTHOR ("Stephane Grosjean <[email protected]>" );MODULE_DESCRIPTION ("RTCAN driver for PEAK PCAN PCIe/M.2 FD family cards" ); -MODULE_SUPPORTED_DEVICE ("PEAK PCAN PCIe/M.2 FD CAN controllers" );MODULE_LICENSE ("GPL v2" );#define PEAK_PCI_VENDOR_ID 0x001c/* The PCI device and vendor IDs */
kernel/drivers/can/sja1000/rtcan_adv_pci.c +0 -1
@@ -43,7 +43,6 @@ static char *adv_pci_board_name = "ADV-PCI";MODULE_AUTHOR ("Thierry Bultel <[email protected]>" );MODULE_DESCRIPTION ("RTCAN board driver for Advantech PCI cards" ); -MODULE_SUPPORTED_DEVICE ("ADV-PCI card CAN controller" );MODULE_LICENSE ("GPL" );struct rtcan_adv_pci {
kernel/drivers/can/sja1000/rtcan_ems_pci.c +0 -1
@@ -41,7 +41,6 @@ static char *ems_pci_board_name = "EMS-CPC-PCI";MODULE_AUTHOR ("Wolfgang Grandegger <[email protected]>" );MODULE_DESCRIPTION ("RTCAN board driver for EMS CPC-PCI/PCIe/104P CAN cards" ); -MODULE_SUPPORTED_DEVICE ("EMS CPC-PCI/PCIe/104P CAN card" );MODULE_LICENSE ("GPL v2" );#define EMS_PCI_V1_MAX_CHAN 2
kernel/drivers/can/sja1000/rtcan_esd_pci.c +0 -2
@@ -44,8 +44,6 @@ static char *esd_pci_board_name = "ESD-PCI";MODULE_AUTHOR ("Sebastian Smolorz <[email protected]" );MODULE_DESCRIPTION ("RTCAN board driver for esd PCI/PMC/CPCI/PCIe/PCI104 " \"CAN cards" ); -MODULE_SUPPORTED_DEVICE ("esd CAN-PCI/200, CAN-PCI/266, CAN-PMC266, " \ -"CAN-PCIe/2000, CAN-CPCI/200, CAN-PCI104" );MODULE_LICENSE ("GPL v2" );struct rtcan_esd_pci {
kernel/drivers/can/sja1000/rtcan_isa.c +0 -1
@@ -42,7 +42,6 @@ static char *isa_board_name = "ISA-Board";MODULE_AUTHOR ("Wolfgang Grandegger <[email protected]>" );MODULE_DESCRIPTION ("RTCAN board driver for standard ISA boards" ); -MODULE_SUPPORTED_DEVICE ("ISA board" );MODULE_LICENSE ("GPL" );static u16 io[RTCAN_ISA_MAX_DEV ];
kernel/drivers/can/sja1000/rtcan_ixxat_pci.c +0 -1
@@ -39,7 +39,6 @@ static char *ixxat_pci_board_name = "IXXAT-PCI";MODULE_AUTHOR ("Wolfgang Grandegger <[email protected]>" );MODULE_DESCRIPTION ("RTCAN board driver for IXXAT-PCI cards" ); -MODULE_SUPPORTED_DEVICE ("IXXAT-PCI card CAN controller" );MODULE_LICENSE ("GPL" );struct rtcan_ixxat_pci
kernel/drivers/can/sja1000/rtcan_mem.c +0 -1
@@ -50,7 +50,6 @@ static char *mem_board_name = "mem mapped";MODULE_AUTHOR ("Matthias Fuchs <[email protected]>" );MODULE_DESCRIPTION ("RTCAN driver for memory mapped SJA1000 controller" ); -MODULE_SUPPORTED_DEVICE ("mem mapped" );MODULE_LICENSE ("GPL" );static u32 mem[RTCAN_MEM_MAX_DEV ];
kernel/drivers/can/sja1000/rtcan_peak_dng.c +0 -1
@@ -45,7 +45,6 @@ static char *dongle_board_name = "PEAK-Dongle";MODULE_AUTHOR ("Wolfgang Grandegger <[email protected]>" );MODULE_DESCRIPTION ("RTCAN board driver for PEAK-Dongle" ); -MODULE_SUPPORTED_DEVICE ("PEAK-Dongle CAN controller" );MODULE_LICENSE ("GPL" );static char *type[RTCAN_PEAK_DNG_MAX_DEV ];
kernel/drivers/can/sja1000/rtcan_peak_pci.c +0 -1
@@ -43,7 +43,6 @@ static char *peak_pci_board_name = "PEAK-PCI";MODULE_AUTHOR ("Wolfgang Grandegger <[email protected]>" );MODULE_DESCRIPTION ("RTCAN board driver for PEAK-PCI cards" ); -MODULE_SUPPORTED_DEVICE ("PEAK-PCI card CAN controller" );MODULE_LICENSE ("GPL" );struct rtcan_peak_pci
kernel/drivers/can/sja1000/rtcan_plx_pci.c +0 -7
@@ -41,13 +41,6 @@MODULE_AUTHOR ("Pavel Cheblakov <[email protected]>" );MODULE_DESCRIPTION ("RTCAN driver for PLX90xx PCI-bridge cards with " "the SJA1000 chips" ); -MODULE_SUPPORTED_DEVICE ("Adlink PCI-7841/cPCI-7841, " -"Adlink PCI-7841/cPCI-7841 SE, " -"Marathon CAN-bus-PCI, " -"TEWS TECHNOLOGIES TPMC810, " -"esd CAN-PCI/CPCI/PCI104/200, " -"esd CAN-PCI/PMC/266, " - "esd CAN-PCIe/2000")MODULE_LICENSE ("GPL v2" );#define PLX_PCI_MAX_CHAN 2
kernel/drivers/can/sja1000/rtcan_sja1000.c +0 -1
@@ -81,7 +81,6 @@ static char *sja_ctrl_name = "SJA1000";MODULE_AUTHOR ("[email protected]" );MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("RT-Socket-CAN driver for SJA1000" ); -MODULE_SUPPORTED_DEVICE ("SJA1000 CAN controller" );#ifndef CONFIG_XENO_DRIVERS_CAN_CALC_BITTIME_OLD static struct can_bittiming_const sja1000_bittiming_const = {
Signature · 1 line
2.31.1
PATCH 8/9 drivers/net/e1000e: Add missing ethtool.h include
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Needed for recent kernels.
--- kernel/drivers/net/drivers/e1000e/e1000.h | 1 + 1 file changed, 1 insertion(+)
kernel/drivers/net/drivers/e1000e/e1000.h +1 -0
@@ -40,6 +40,7 @@#include <linux/pci.h> #include <linux/crc32.h> #include <linux/if_vlan.h> +#include <linux/ethtool.h> #include <rtnet_port.h>
Signature · 1 line
2.31.1
PATCH 9/9 cobalt/debug: Detect vDSO via absence of vm_file
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
VM_DENYWRITE was removed in 5.15, so we need a different criteria. Absence of a file-backing seems to be a good one.
--- kernel/cobalt/debug.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
kernel/cobalt/debug.c +5 -7
@@ -249,13 +249,12 @@ void xndebug_trace_relax(int nr, unsigned long *backtrace,continue ;/* -* Hack. Unlike DSOs, executables and interpreters -* (e.g. dynamic linkers) are protected against write -* attempts. Use this to determine when $pc should be -* fixed up by subtracting the mapping base address in -* the DSO case. +* DSOs are not file-backed. Use this to determine when $pc +* should be fixed up by subtracting the mapping base address +* in the DSO case. */ -if (!(vma->vm_flags &VM_DENYWRITE )) + file = vma->vm_file; +if (file ==NULL ) pc -= vma->vm_start; spot.backtrace[depth].pc = pc;
@@ -265,7 +264,6 @@ void xndebug_trace_relax(int nr, unsigned long *backtrace,* record the PC value, which may still give some hint * downstream. */ - file = vma->vm_file;if (file ==NULL ) goto next_frame;
Signature · 1 line
2.31.1
Quoted 5 lines · Jan Kiszka via Xenomai
Most of these are harmless conversions with backward-compatible wrappings. Only the last patch is a bit hairy as I'm unsure whether the new detection mechanism for vDSO VMAs is truly reliable. Therefore, this patch is not (yet?) targeting next, thus 3.2-rc2.
Forgot to write: The result booted with v5.15-dovetail-rebase and apparently worked fine. I'm just seeing strange issues with the virtual VGA console in QEMU, likely upstream related and not an issue of Dovetail or Xenomai.
Jan
Signature · 2 lines
Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux
PATCH v2 1/9 cobalt/dovetail: Use IRQ_WORK_INIT to please 5.11+
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
And wrap the previous open-coded initialization for older kernels.
---
Changes in v2:
- initialize .flags in older kernels more accurately
include/cobalt/kernel/dovetail/pipeline/inband_work.h | 6 +----- kernel/cobalt/include/asm-generic/xenomai/wrappers.h | 7 +++++++ 2 files changed, 8 insertions(+), 5 deletions(-)
include/cobalt/kernel/dovetail/pipeline/inband_work.h +1 -5
@@ -19,11 +19,7 @@ struct pipeline_inband_work {#define PIPELINE_INBAND_WORK_INITIALIZER (__work, __handler) \ { \ - .work = { \ - .func = (void (*)(struct irq_work *)) \ - __handler, \ - .flags = ATOMIC_INIT(0), \ - }, \ + .work = IRQ_WORK_INIT((void (*)(struct irq_work *))__handler), \ }#define pipeline_post_inband_work (__work) \
kernel/cobalt/include/asm-generic/xenomai/wrappers.h +7 -0
@@ -231,4 +231,11 @@ devm_hwmon_device_register_with_groups(struct device *dev, const char *name, kernel_read_file(__file, 0, __buf, __buf_size, __file_size, __id)#endif +#if LINUX_VERSION_CODE <KERNEL_VERSION (5 ,11 ,0 ) +#define IRQ_WORK_INIT (_func) (struct irq_work) { \ + .flags = ATOMIC_INIT(0), \ + .func = (_func), \ +} +#endif +#endif /* _COBALT_ASM_GENERIC_WRAPPERS_H */
Signature · 1 line
2.31.1
Re: [PATCH 9/9] cobalt/debug: Detect vDSO via absence of vm_file
In reply to Jan KiszkaQuoted 35 lines · Jan Kiszka via Xenomai
From: Jan Kiszka <[email protected]>
VM_DENYWRITEwas removed in 5.15, so we need a different criteria. Absence of a file-backing seems to be a good one.Signed-off-by Jan Kiszka <[email protected]>--- kernel/cobalt/debug.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)kernel/cobalt/debug.c +5
-6@@ -249,13 +249,12 @@ void xndebug_trace_relax(int nr, unsigned long *backtrace,continue ;/* -* Hack. Unlike DSOs, executables and interpreters -* (e.g. dynamic linkers) are protected against write -* attempts. Use this to determine when $pc should be -* fixed up by subtracting the mapping base address in -* the DSO case. +* DSOs are not file-backed. Use this to determine when $pc +* should be fixed up by subtracting the mapping base address +* in the DSO case. */ -if (!(vma->vm_flags &VM_DENYWRITE )) + file = vma->vm_file; +if (file ==NULL ) pc -= vma->vm_start; spot.backtrace[depth].pc = pc;
kernel/cobalt/debug.c void xndebug_trace_relax(int nr, unsigned long *backtrace, · line 269
Quoted 7 lines
kernel/cobalt/debug.c +0
-1@@ -265,7 +264,6 @@ void xndebug_trace_relax(int nr, unsigned long *backtrace,* record the PC value, which may still give some hint * downstream. */ - file = vma->vm_file;if (file ==NULL ) goto next_frame;
Philippe, could you comment on this change? Does this sound safe enough to you? How to test that best?
Jan
Signature · 2 lines
Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux
Re: [PATCH 9/9] cobalt/debug: Detect vDSO via absence of vm_file
In reply to Jan KiszkaQuoted 4 lines · Jan Kiszka via Xenomai
From: Jan Kiszka <[email protected]>
VM_DENYWRITEwas removed in 5.15, so we need a different criteria. Absence of a file-backing seems to be a good one.
Bringing this one up, because we recently had a "report" on the ML regarding VM_DENYWRITE.
I scanned the ld (dynamic loader) sources today. I was interested if there is any magic involved when mapping DSOs to the vma of the process. AFAICT there is none. I would expect the vma to be file-backed (=vma->vm_file =! NULL), so not sure if that is going to work.
Btw: Subject talks about vDSO, which is not what we are looking at here.
Just to make sure I got all that right: We need a way to figure out if the reason for the thread relax was caused by the executable itself, or any of it's dependencies, right?
Quoted 37 lines
Signed-off-by Jan Kiszka <[email protected]>--- kernel/cobalt/debug.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)kernel/cobalt/debug.c +5
-7@@ -249,13 +249,12 @@ void xndebug_trace_relax(int nr, unsigned long *backtrace,continue ;/* -* Hack. Unlike DSOs, executables and interpreters -* (e.g. dynamic linkers) are protected against write -* attempts. Use this to determine when $pc should be -* fixed up by subtracting the mapping base address in -* the DSO case. +* DSOs are not file-backed. Use this to determine when $pc +* should be fixed up by subtracting the mapping base address +* in the DSO case. */ -if (!(vma->vm_flags &VM_DENYWRITE )) + file = vma->vm_file; +if (file ==NULL ) pc -= vma->vm_start; spot.backtrace[depth].pc = pc;@@ -265,7 +264,6 @@ void xndebug_trace_relax(int nr, unsigned long *backtrace,* record the PC value, which may still give some hint * downstream. */ - file = vma->vm_file;if (file ==NULL ) goto next_frame;
Re: [PATCH 9/9] cobalt/debug: Detect vDSO via absence of vm_file
Quoted 6 lines · Florian Bezdeka
Quoted 4 lines · Jan Kiszka via Xenomai
From: Jan Kiszka <[email protected]>
VM_DENYWRITEwas removed in 5.15, so we need a different criteria. Absence of a file-backing seems to be a good one.
Quoted 7 lines
Bringing this one up, because we recently had a "report" on the ML regarding
VM_DENYWRITE.I scanned the ld (dynamic loader) sources today. I was interested if there is any magic involved when mapping DSOs to the vma of the process. AFAICT there is none. I would expect the vma to be file-backed (=vma->vm_file =! NULL), so not sure if that is going to work.
Then likely not.
Quoted 2 lines
Btw: Subject talks about vDSO, which is not what we are looking at here.
Yeah, misnomer of mine.
Quoted 4 lines
Just to make sure I got all that right: We need a way to figure out if the reason for the thread relax was caused by the executable itself, or any of it's dependencies, right?
The purpose is to calculate the correct PC value that makes sense and is useful for the userspace helper:
* We compute PC values relative to the base of the shared
* executable mappings we find in the backtrace, which makes
* it possible for the slackspot utility to match the
* corresponding source code locations from unrelocated file
* offsets.
Jan
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux
Re: [PATCH 9/9] cobalt/debug: Detect vDSO via absence of vm_file
Quoted 27 lines · Jan Kiszka via Xenomai
Quoted 6 lines · Florian Bezdeka
Quoted 4 lines · Jan Kiszka via Xenomai
From: Jan Kiszka <[email protected]>
VM_DENYWRITEwas removed in 5.15, so we need a different criteria. Absence of a file-backing seems to be a good one.Quoted 7 lines
Bringing this one up, because we recently had a "report" on the ML regarding
VM_DENYWRITE.I scanned the ld (dynamic loader) sources today. I was interested if there is any magic involved when mapping DSOs to the vma of the process. AFAICT there is none. I would expect the vma to be file-backed (=vma->vm_file =! NULL), so not sure if that is going to work.
Then likely not.
Quoted 2 lines
Btw: Subject talks about vDSO, which is not what we are looking at here.
Yeah, misnomer of mine.
Quoted 4 lines
Just to make sure I got all that right: We need a way to figure out if the reason for the thread relax was caused by the executable itself, or any of it's dependencies, right?
Quoted 9 lines
The purpose is to calculate the correct PC value that makes sense and is useful for the userspace helper:
* We compute PC values relative to the base of the shared
* executable mappings we find in the backtrace, which makes
* it possible for the slackspot utility to match the
* corresponding source code locations from unrelocated file
* offsets.
Looking at the slackspot tool: We run addr2line for each spot that has a mapping, thus executable name, and we pass in relative addresses then. For the others, we just print the true PC value as recording and as NOT adjusted. So my logic was at least wrong in being inverted. It should work for telling DSOs apart from interpreter-created executable sections. Not sure about other "executables", though.
Jan
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux