* Re: [PATCH] arch: m68k: remove incomplete, unusable Apollo hardware support
From: Randy Dunlap @ 2026-02-09 1:40 UTC (permalink / raw)
To: Ethan Nelson-Moore, linux-api, Geert Uytterhoeven, linux-m68k
In-Reply-To: <20260209013041.37536-1-enelsonmoore@gmail.com>
Hi--
On 2/8/26 5:30 PM, Ethan Nelson-Moore wrote:
> The m68k architecture contains very incomplete support for running on
> Apollo Domain hardware. There are only timer, console, and framebuffer
> drivers, and no storage or network drivers, so there is no way to
> practically use it. It is not even capable of rebooting by itself (see
> dn_dummy_reset() in arch/m68k/apollo/config.c).
>
> arch/m68k/apollo has only received tree-wide changes and fixes by
> inspection in the entire Git history (since Linux 2.6.12-rc2), so there
> is clearly no interest in completing support for Apollo hardware.
> Remove it to reduce future maintenance workload.
>
> There are no uses of the removed <asm/bootinfo-apollo.h> UAPI header or
> the constants removed from the <asm/bootinfo.h> UAPI header on GitHub
> or Debian Code Search.
>
> Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
> ---
> arch/m68k/Kbuild | 1 -
> arch/m68k/Kconfig.devices | 4 +-
> arch/m68k/Kconfig.machine | 8 -
> arch/m68k/apollo/Makefile | 6 -
> arch/m68k/apollo/apollo.h | 4 -
> arch/m68k/apollo/config.c | 240 --------
> arch/m68k/apollo/dn_ints.c | 50 --
> arch/m68k/configs/apollo_defconfig | 595 -------------------
> arch/m68k/configs/multi_defconfig | 1 -
> arch/m68k/include/asm/apollohw.h | 90 ---
> arch/m68k/include/asm/config.h | 2 -
> arch/m68k/include/asm/irq.h | 2 -
> arch/m68k/include/asm/setup.h | 32 +-
> arch/m68k/include/uapi/asm/bootinfo-apollo.h | 29 -
> arch/m68k/include/uapi/asm/bootinfo.h | 5 +-
> arch/m68k/kernel/head.S | 70 +--
> arch/m68k/kernel/setup_mm.c | 9 -
> drivers/video/fbdev/Kconfig | 8 -
> drivers/video/fbdev/Makefile | 1 -
> drivers/video/fbdev/dnfb.c | 307 ----------
> 20 files changed, 19 insertions(+), 1445 deletions(-)
> delete mode 100644 arch/m68k/apollo/Makefile
> delete mode 100644 arch/m68k/apollo/apollo.h
> delete mode 100644 arch/m68k/apollo/config.c
> delete mode 100644 arch/m68k/apollo/dn_ints.c
> delete mode 100644 arch/m68k/configs/apollo_defconfig
> delete mode 100644 arch/m68k/include/asm/apollohw.h
> delete mode 100644 arch/m68k/include/uapi/asm/bootinfo-apollo.h
> delete mode 100644 drivers/video/fbdev/dnfb.c
There is an M68K maintainer who should be Cc-ed on this patch.
(now done)
--
~Randy
^ permalink raw reply
* [PATCH] arch: m68k: remove incomplete, unusable Apollo hardware support
From: Ethan Nelson-Moore @ 2026-02-09 1:30 UTC (permalink / raw)
To: linux-api
The m68k architecture contains very incomplete support for running on
Apollo Domain hardware. There are only timer, console, and framebuffer
drivers, and no storage or network drivers, so there is no way to
practically use it. It is not even capable of rebooting by itself (see
dn_dummy_reset() in arch/m68k/apollo/config.c).
arch/m68k/apollo has only received tree-wide changes and fixes by
inspection in the entire Git history (since Linux 2.6.12-rc2), so there
is clearly no interest in completing support for Apollo hardware.
Remove it to reduce future maintenance workload.
There are no uses of the removed <asm/bootinfo-apollo.h> UAPI header or
the constants removed from the <asm/bootinfo.h> UAPI header on GitHub
or Debian Code Search.
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
---
arch/m68k/Kbuild | 1 -
arch/m68k/Kconfig.devices | 4 +-
arch/m68k/Kconfig.machine | 8 -
arch/m68k/apollo/Makefile | 6 -
arch/m68k/apollo/apollo.h | 4 -
arch/m68k/apollo/config.c | 240 --------
arch/m68k/apollo/dn_ints.c | 50 --
arch/m68k/configs/apollo_defconfig | 595 -------------------
arch/m68k/configs/multi_defconfig | 1 -
arch/m68k/include/asm/apollohw.h | 90 ---
arch/m68k/include/asm/config.h | 2 -
arch/m68k/include/asm/irq.h | 2 -
arch/m68k/include/asm/setup.h | 32 +-
arch/m68k/include/uapi/asm/bootinfo-apollo.h | 29 -
arch/m68k/include/uapi/asm/bootinfo.h | 5 +-
arch/m68k/kernel/head.S | 70 +--
arch/m68k/kernel/setup_mm.c | 9 -
drivers/video/fbdev/Kconfig | 8 -
drivers/video/fbdev/Makefile | 1 -
drivers/video/fbdev/dnfb.c | 307 ----------
20 files changed, 19 insertions(+), 1445 deletions(-)
delete mode 100644 arch/m68k/apollo/Makefile
delete mode 100644 arch/m68k/apollo/apollo.h
delete mode 100644 arch/m68k/apollo/config.c
delete mode 100644 arch/m68k/apollo/dn_ints.c
delete mode 100644 arch/m68k/configs/apollo_defconfig
delete mode 100644 arch/m68k/include/asm/apollohw.h
delete mode 100644 arch/m68k/include/uapi/asm/bootinfo-apollo.h
delete mode 100644 drivers/video/fbdev/dnfb.c
diff --git a/arch/m68k/Kbuild b/arch/m68k/Kbuild
index 7762af9f6def..421bad0780e1 100644
--- a/arch/m68k/Kbuild
+++ b/arch/m68k/Kbuild
@@ -5,7 +5,6 @@ obj-$(CONFIG_AMIGA) += amiga/
obj-$(CONFIG_ATARI) += atari/
obj-$(CONFIG_MAC) += mac/
obj-$(CONFIG_HP300) += hp300/
-obj-$(CONFIG_APOLLO) += apollo/
obj-$(CONFIG_MVME147) += mvme147/
obj-$(CONFIG_MVME16x) += mvme16x/
obj-$(CONFIG_BVME6000) += bvme6000/
diff --git a/arch/m68k/Kconfig.devices b/arch/m68k/Kconfig.devices
index e6e3efac1840..75370aadba6a 100644
--- a/arch/m68k/Kconfig.devices
+++ b/arch/m68k/Kconfig.devices
@@ -9,8 +9,8 @@ config ARCH_MAY_HAVE_PC_FDC
menu "Platform devices"
config HEARTBEAT
- bool "Use power LED as a heartbeat" if AMIGA || APOLLO || ATARI || Q40
- default y if !AMIGA && !APOLLO && !ATARI && !Q40 && HP300
+ bool "Use power LED as a heartbeat" if AMIGA || ATARI || Q40
+ default y if !AMIGA && !ATARI && !Q40 && HP300
help
Use the power-on LED on your machine as a load meter. The exact
behavior is platform-dependent, but normally the flash frequency is
diff --git a/arch/m68k/Kconfig.machine b/arch/m68k/Kconfig.machine
index de39f23b180e..f67eb3d202c6 100644
--- a/arch/m68k/Kconfig.machine
+++ b/arch/m68k/Kconfig.machine
@@ -38,14 +38,6 @@ config MAC
browse the documentation available at <http://www.mac.linux-m68k.org/>;
otherwise say N.
-config APOLLO
- bool "Apollo support"
- depends on MMU
- select LEGACY_TIMER_TICK
- help
- Say Y here if you want to run Linux on an MC680x0-based Apollo
- Domain workstation such as the DN3500.
-
config VME
bool "VME (Motorola and BVM) support"
depends on MMU
diff --git a/arch/m68k/apollo/Makefile b/arch/m68k/apollo/Makefile
deleted file mode 100644
index 676c74b26878..000000000000
--- a/arch/m68k/apollo/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-#
-# Makefile for Linux arch/m68k/apollo source directory
-#
-
-obj-y := config.o dn_ints.o
diff --git a/arch/m68k/apollo/apollo.h b/arch/m68k/apollo/apollo.h
deleted file mode 100644
index 1fe9d856df30..000000000000
--- a/arch/m68k/apollo/apollo.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-
-/* dn_ints.c */
-void dn_init_IRQ(void);
diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c
deleted file mode 100644
index e324c5f671de..000000000000
--- a/arch/m68k/apollo/config.c
+++ /dev/null
@@ -1,240 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/rtc.h>
-#include <linux/interrupt.h>
-
-#include <asm/setup.h>
-#include <asm/bootinfo.h>
-#include <asm/bootinfo-apollo.h>
-#include <asm/byteorder.h>
-#include <asm/apollohw.h>
-#include <asm/irq.h>
-#include <asm/machdep.h>
-#include <asm/config.h>
-
-#include "apollo.h"
-
-u_long sio01_physaddr;
-u_long sio23_physaddr;
-u_long rtc_physaddr;
-u_long pica_physaddr;
-u_long picb_physaddr;
-u_long cpuctrl_physaddr;
-u_long timer_physaddr;
-u_long apollo_model;
-
-extern void dn_sched_init(void);
-extern int dn_dummy_hwclk(int, struct rtc_time *);
-static void dn_dummy_reset(void);
-#ifdef CONFIG_HEARTBEAT
-static void dn_heartbeat(int on);
-#endif
-static irqreturn_t dn_timer_int(int irq,void *);
-static void dn_get_model(char *model);
-static const char *apollo_models[] = {
- [APOLLO_DN3000-APOLLO_DN3000] = "DN3000 (Otter)",
- [APOLLO_DN3010-APOLLO_DN3000] = "DN3010 (Otter)",
- [APOLLO_DN3500-APOLLO_DN3000] = "DN3500 (Cougar II)",
- [APOLLO_DN4000-APOLLO_DN3000] = "DN4000 (Mink)",
- [APOLLO_DN4500-APOLLO_DN3000] = "DN4500 (Roadrunner)"
-};
-
-int __init apollo_parse_bootinfo(const struct bi_record *record)
-{
- int unknown = 0;
- const void *data = record->data;
-
- switch (be16_to_cpu(record->tag)) {
- case BI_APOLLO_MODEL:
- apollo_model = be32_to_cpup(data);
- break;
-
- default:
- unknown=1;
- }
-
- return unknown;
-}
-
-static void __init dn_setup_model(void)
-{
- pr_info("Apollo hardware found: [%s]\n",
- apollo_models[apollo_model - APOLLO_DN3000]);
-
- switch(apollo_model) {
- case APOLLO_UNKNOWN:
- panic("Unknown apollo model");
- break;
- case APOLLO_DN3000:
- case APOLLO_DN3010:
- sio01_physaddr=SAU8_SIO01_PHYSADDR;
- rtc_physaddr=SAU8_RTC_PHYSADDR;
- pica_physaddr=SAU8_PICA;
- picb_physaddr=SAU8_PICB;
- cpuctrl_physaddr=SAU8_CPUCTRL;
- timer_physaddr=SAU8_TIMER;
- break;
- case APOLLO_DN4000:
- sio01_physaddr=SAU7_SIO01_PHYSADDR;
- sio23_physaddr=SAU7_SIO23_PHYSADDR;
- rtc_physaddr=SAU7_RTC_PHYSADDR;
- pica_physaddr=SAU7_PICA;
- picb_physaddr=SAU7_PICB;
- cpuctrl_physaddr=SAU7_CPUCTRL;
- timer_physaddr=SAU7_TIMER;
- break;
- case APOLLO_DN4500:
- panic("Apollo model not yet supported");
- break;
- case APOLLO_DN3500:
- sio01_physaddr=SAU7_SIO01_PHYSADDR;
- sio23_physaddr=SAU7_SIO23_PHYSADDR;
- rtc_physaddr=SAU7_RTC_PHYSADDR;
- pica_physaddr=SAU7_PICA;
- picb_physaddr=SAU7_PICB;
- cpuctrl_physaddr=SAU7_CPUCTRL;
- timer_physaddr=SAU7_TIMER;
- break;
- default:
- panic("Undefined apollo model");
- break;
- }
-
-
-}
-
-static void dn_serial_print(const char *str)
-{
- while (*str) {
- if (*str == '\n') {
- sio01.rhrb_thrb = (unsigned char)'\r';
- while (!(sio01.srb_csrb & 0x4))
- ;
- }
- sio01.rhrb_thrb = (unsigned char)*str++;
- while (!(sio01.srb_csrb & 0x4))
- ;
- }
-}
-
-void __init config_apollo(void)
-{
- int i;
-
- dn_setup_model();
-
- mach_sched_init=dn_sched_init; /* */
- mach_init_IRQ=dn_init_IRQ;
- mach_hwclk = dn_dummy_hwclk; /* */
- mach_reset = dn_dummy_reset; /* */
-#ifdef CONFIG_HEARTBEAT
- mach_heartbeat = dn_heartbeat;
-#endif
- mach_get_model = dn_get_model;
-
- cpuctrl=0xaa00;
-
- /* clear DMA translation table */
- for(i=0;i<0x400;i++)
- addr_xlat_map[i]=0;
-
-}
-
-irqreturn_t dn_timer_int(int irq, void *dev_id)
-{
- unsigned char *at = (unsigned char *)apollo_timer;
-
- legacy_timer_tick(1);
- timer_heartbeat();
-
- READ_ONCE(*(at + 3));
- READ_ONCE(*(at + 5));
-
- return IRQ_HANDLED;
-}
-
-void dn_sched_init(void)
-{
- /* program timer 1 */
- *(volatile unsigned char *)(apollo_timer + 3) = 0x01;
- *(volatile unsigned char *)(apollo_timer + 1) = 0x40;
- *(volatile unsigned char *)(apollo_timer + 5) = 0x09;
- *(volatile unsigned char *)(apollo_timer + 7) = 0xc4;
-
- /* enable IRQ of PIC B */
- *(volatile unsigned char *)(pica+1)&=(~8);
-
-#if 0
- pr_info("*(0x10803) %02x\n",
- *(volatile unsigned char *)(apollo_timer + 0x3));
- pr_info("*(0x10803) %02x\n",
- *(volatile unsigned char *)(apollo_timer + 0x3));
-#endif
-
- if (request_irq(IRQ_APOLLO, dn_timer_int, 0, "time", NULL))
- pr_err("Couldn't register timer interrupt\n");
-}
-
-int dn_dummy_hwclk(int op, struct rtc_time *t) {
-
-
- if(!op) { /* read */
- t->tm_sec=rtc->second;
- t->tm_min=rtc->minute;
- t->tm_hour=rtc->hours;
- t->tm_mday=rtc->day_of_month;
- t->tm_wday=rtc->day_of_week;
- t->tm_mon = rtc->month - 1;
- t->tm_year=rtc->year;
- if (t->tm_year < 70)
- t->tm_year += 100;
- } else {
- rtc->second=t->tm_sec;
- rtc->minute=t->tm_min;
- rtc->hours=t->tm_hour;
- rtc->day_of_month=t->tm_mday;
- if(t->tm_wday!=-1)
- rtc->day_of_week=t->tm_wday;
- rtc->month = t->tm_mon + 1;
- rtc->year = t->tm_year % 100;
- }
-
- return 0;
-
-}
-
-static void dn_dummy_reset(void)
-{
- dn_serial_print("The end !\n");
-
- for(;;);
-
-}
-
-static void dn_get_model(char *model)
-{
- strcpy(model, "Apollo ");
- if (apollo_model >= APOLLO_DN3000 && apollo_model <= APOLLO_DN4500)
- strcat(model, apollo_models[apollo_model - APOLLO_DN3000]);
-}
-
-#ifdef CONFIG_HEARTBEAT
-static int dn_cpuctrl=0xff00;
-
-static void dn_heartbeat(int on) {
-
- if(on) {
- dn_cpuctrl&=~0x100;
- cpuctrl=dn_cpuctrl;
- }
- else {
- dn_cpuctrl&=~0x100;
- dn_cpuctrl|=0x100;
- cpuctrl=dn_cpuctrl;
- }
-}
-#endif
-
diff --git a/arch/m68k/apollo/dn_ints.c b/arch/m68k/apollo/dn_ints.c
deleted file mode 100644
index ba96a92f8f18..000000000000
--- a/arch/m68k/apollo/dn_ints.c
+++ /dev/null
@@ -1,50 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-
-#include <asm/traps.h>
-#include <asm/apollohw.h>
-
-#include "apollo.h"
-
-static unsigned int apollo_irq_startup(struct irq_data *data)
-{
- unsigned int irq = data->irq;
-
- if (irq < 8)
- *(volatile unsigned char *)(pica+1) &= ~(1 << irq);
- else
- *(volatile unsigned char *)(picb+1) &= ~(1 << (irq - 8));
- return 0;
-}
-
-static void apollo_irq_shutdown(struct irq_data *data)
-{
- unsigned int irq = data->irq;
-
- if (irq < 8)
- *(volatile unsigned char *)(pica+1) |= (1 << irq);
- else
- *(volatile unsigned char *)(picb+1) |= (1 << (irq - 8));
-}
-
-static void apollo_irq_eoi(struct irq_data *data)
-{
- *(volatile unsigned char *)(pica) = 0x20;
- *(volatile unsigned char *)(picb) = 0x20;
-}
-
-static struct irq_chip apollo_irq_chip = {
- .name = "apollo",
- .irq_startup = apollo_irq_startup,
- .irq_shutdown = apollo_irq_shutdown,
- .irq_eoi = apollo_irq_eoi,
-};
-
-
-void __init dn_init_IRQ(void)
-{
- m68k_setup_user_interrupt(VEC_USER + 96, 16);
- m68k_setup_irq_controller(&apollo_irq_chip, handle_fasteoi_irq,
- IRQ_APOLLO, 16);
-}
diff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig
deleted file mode 100644
index d9d1f3c4c70d..000000000000
--- a/arch/m68k/configs/apollo_defconfig
+++ /dev/null
@@ -1,595 +0,0 @@
-CONFIG_LOCALVERSION="-apollo"
-CONFIG_SYSVIPC=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_BSD_PROCESS_ACCT=y
-CONFIG_BSD_PROCESS_ACCT_V3=y
-CONFIG_LOG_BUF_SHIFT=16
-# CONFIG_UTS_NS is not set
-# CONFIG_IPC_NS is not set
-# CONFIG_PID_NS is not set
-# CONFIG_NET_NS is not set
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_KEXEC=y
-CONFIG_BOOTINFO_PROC=y
-CONFIG_M68020=y
-CONFIG_M68030=y
-CONFIG_M68040=y
-CONFIG_M68060=y
-CONFIG_APOLLO=y
-CONFIG_HEARTBEAT=y
-CONFIG_PROC_HARDWARE=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_TRIM_UNUSED_KSYMS=y
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_AMIGA_PARTITION=y
-CONFIG_ATARI_PARTITION=y
-CONFIG_MAC_PARTITION=y
-CONFIG_BSD_DISKLABEL=y
-CONFIG_MINIX_SUBPARTITION=y
-CONFIG_SOLARIS_X86_PARTITION=y
-CONFIG_UNIXWARE_DISKLABEL=y
-CONFIG_SUN_PARTITION=y
-# CONFIG_EFI_PARTITION is not set
-CONFIG_SYSV68_PARTITION=y
-CONFIG_MQ_IOSCHED_DEADLINE=m
-CONFIG_MQ_IOSCHED_KYBER=m
-CONFIG_IOSCHED_BFQ=m
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
-CONFIG_BINFMT_MISC=m
-# CONFIG_COMPACTION is not set
-CONFIG_DMAPOOL_TEST=m
-CONFIG_USERFAULTFD=y
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_PACKET_DIAG=m
-CONFIG_UNIX=y
-CONFIG_UNIX_DIAG=m
-CONFIG_TLS=m
-CONFIG_XFRM_MIGRATE=y
-CONFIG_NET_KEY=y
-CONFIG_XDP_SOCKETS=y
-CONFIG_XDP_SOCKETS_DIAG=m
-CONFIG_INET=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-CONFIG_IP_PNP_BOOTP=y
-CONFIG_IP_PNP_RARP=y
-CONFIG_NET_IPIP=m
-CONFIG_NET_IPGRE_DEMUX=m
-CONFIG_NET_IPGRE=m
-CONFIG_NET_IPVTI=m
-CONFIG_NET_FOU_IP_TUNNELS=y
-CONFIG_INET_AH=m
-CONFIG_INET_ESP=m
-CONFIG_INET_ESP_OFFLOAD=m
-CONFIG_INET_IPCOMP=m
-CONFIG_INET_DIAG=m
-CONFIG_INET_UDP_DIAG=m
-CONFIG_INET_RAW_DIAG=m
-CONFIG_IPV6=m
-CONFIG_IPV6_ROUTER_PREF=y
-CONFIG_INET6_AH=m
-CONFIG_INET6_ESP=m
-CONFIG_INET6_ESP_OFFLOAD=m
-CONFIG_INET6_IPCOMP=m
-CONFIG_IPV6_ILA=m
-CONFIG_IPV6_VTI=m
-CONFIG_IPV6_GRE=m
-CONFIG_NETFILTER=y
-CONFIG_NETFILTER_NETLINK_HOOK=m
-CONFIG_NF_CONNTRACK=m
-CONFIG_NF_CONNTRACK_ZONES=y
-CONFIG_NF_CONNTRACK_AMANDA=m
-CONFIG_NF_CONNTRACK_FTP=m
-CONFIG_NF_CONNTRACK_H323=m
-CONFIG_NF_CONNTRACK_IRC=m
-CONFIG_NF_CONNTRACK_NETBIOS_NS=m
-CONFIG_NF_CONNTRACK_SNMP=m
-CONFIG_NF_CONNTRACK_PPTP=m
-CONFIG_NF_CONNTRACK_SANE=m
-CONFIG_NF_CONNTRACK_SIP=m
-CONFIG_NF_CONNTRACK_TFTP=m
-CONFIG_NF_TABLES=m
-CONFIG_NF_TABLES_INET=y
-CONFIG_NF_TABLES_NETDEV=y
-CONFIG_NFT_NUMGEN=m
-CONFIG_NFT_CT=m
-CONFIG_NFT_FLOW_OFFLOAD=m
-CONFIG_NFT_CONNLIMIT=m
-CONFIG_NFT_LOG=m
-CONFIG_NFT_LIMIT=m
-CONFIG_NFT_MASQ=m
-CONFIG_NFT_REDIR=m
-CONFIG_NFT_NAT=m
-CONFIG_NFT_TUNNEL=m
-CONFIG_NFT_QUEUE=m
-CONFIG_NFT_QUOTA=m
-CONFIG_NFT_REJECT=m
-CONFIG_NFT_COMPAT=m
-CONFIG_NFT_HASH=m
-CONFIG_NFT_FIB_INET=m
-CONFIG_NFT_XFRM=m
-CONFIG_NFT_SOCKET=m
-CONFIG_NFT_OSF=m
-CONFIG_NFT_TPROXY=m
-CONFIG_NFT_SYNPROXY=m
-CONFIG_NFT_DUP_NETDEV=m
-CONFIG_NFT_FWD_NETDEV=m
-CONFIG_NFT_FIB_NETDEV=m
-CONFIG_NFT_REJECT_NETDEV=m
-CONFIG_NF_FLOW_TABLE_INET=m
-CONFIG_NF_FLOW_TABLE=m
-CONFIG_NETFILTER_XTABLES_LEGACY=y
-CONFIG_NETFILTER_XT_SET=m
-CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
-CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
-CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
-CONFIG_NETFILTER_XT_TARGET_DSCP=m
-CONFIG_NETFILTER_XT_TARGET_HMARK=m
-CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m
-CONFIG_NETFILTER_XT_TARGET_LOG=m
-CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFLOG=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
-CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
-CONFIG_NETFILTER_XT_TARGET_TEE=m
-CONFIG_NETFILTER_XT_TARGET_TPROXY=m
-CONFIG_NETFILTER_XT_TARGET_TRACE=m
-CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
-CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
-CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
-CONFIG_NETFILTER_XT_MATCH_BPF=m
-CONFIG_NETFILTER_XT_MATCH_CLUSTER=m
-CONFIG_NETFILTER_XT_MATCH_COMMENT=m
-CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
-CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m
-CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
-CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
-CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
-CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m
-CONFIG_NETFILTER_XT_MATCH_DSCP=m
-CONFIG_NETFILTER_XT_MATCH_ESP=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
-CONFIG_NETFILTER_XT_MATCH_HELPER=m
-CONFIG_NETFILTER_XT_MATCH_IPCOMP=m
-CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
-CONFIG_NETFILTER_XT_MATCH_LENGTH=m
-CONFIG_NETFILTER_XT_MATCH_LIMIT=m
-CONFIG_NETFILTER_XT_MATCH_MAC=m
-CONFIG_NETFILTER_XT_MATCH_MARK=m
-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
-CONFIG_NETFILTER_XT_MATCH_NFACCT=m
-CONFIG_NETFILTER_XT_MATCH_OSF=m
-CONFIG_NETFILTER_XT_MATCH_OWNER=m
-CONFIG_NETFILTER_XT_MATCH_POLICY=m
-CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
-CONFIG_NETFILTER_XT_MATCH_QUOTA=m
-CONFIG_NETFILTER_XT_MATCH_RATEEST=m
-CONFIG_NETFILTER_XT_MATCH_REALM=m
-CONFIG_NETFILTER_XT_MATCH_RECENT=m
-CONFIG_NETFILTER_XT_MATCH_SOCKET=m
-CONFIG_NETFILTER_XT_MATCH_STATE=m
-CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
-CONFIG_NETFILTER_XT_MATCH_STRING=m
-CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
-CONFIG_NETFILTER_XT_MATCH_TIME=m
-CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_IP_SET=m
-CONFIG_IP_SET_BITMAP_IP=m
-CONFIG_IP_SET_BITMAP_IPMAC=m
-CONFIG_IP_SET_BITMAP_PORT=m
-CONFIG_IP_SET_HASH_IP=m
-CONFIG_IP_SET_HASH_IPMARK=m
-CONFIG_IP_SET_HASH_IPPORT=m
-CONFIG_IP_SET_HASH_IPPORTIP=m
-CONFIG_IP_SET_HASH_IPPORTNET=m
-CONFIG_IP_SET_HASH_IPMAC=m
-CONFIG_IP_SET_HASH_MAC=m
-CONFIG_IP_SET_HASH_NETPORTNET=m
-CONFIG_IP_SET_HASH_NET=m
-CONFIG_IP_SET_HASH_NETNET=m
-CONFIG_IP_SET_HASH_NETPORT=m
-CONFIG_IP_SET_HASH_NETIFACE=m
-CONFIG_IP_SET_LIST_SET=m
-CONFIG_NFT_DUP_IPV4=m
-CONFIG_NFT_FIB_IPV4=m
-CONFIG_NF_TABLES_ARP=y
-CONFIG_NF_LOG_ARP=m
-CONFIG_NF_LOG_IPV4=m
-CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_AH=m
-CONFIG_IP_NF_MATCH_ECN=m
-CONFIG_IP_NF_MATCH_RPFILTER=m
-CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_TARGET_REJECT=m
-CONFIG_IP_NF_TARGET_SYNPROXY=m
-CONFIG_IP_NF_NAT=m
-CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_NETMAP=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
-CONFIG_IP_NF_TARGET_ECN=m
-CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_RAW=m
-CONFIG_IP_NF_ARPFILTER=m
-CONFIG_IP_NF_ARP_MANGLE=m
-CONFIG_NFT_DUP_IPV6=m
-CONFIG_NFT_FIB_IPV6=m
-CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_AH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_MATCH_FRAG=m
-CONFIG_IP6_NF_MATCH_OPTS=m
-CONFIG_IP6_NF_MATCH_HL=m
-CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_RPFILTER=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_MATCH_SRH=m
-CONFIG_IP6_NF_TARGET_HL=m
-CONFIG_IP6_NF_TARGET_REJECT=m
-CONFIG_IP6_NF_TARGET_SYNPROXY=m
-CONFIG_IP6_NF_RAW=m
-CONFIG_IP6_NF_NAT=m
-CONFIG_IP6_NF_TARGET_MASQUERADE=m
-CONFIG_IP6_NF_TARGET_NPT=m
-CONFIG_NF_TABLES_BRIDGE=m
-CONFIG_NFT_BRIDGE_META=m
-CONFIG_NFT_BRIDGE_REJECT=m
-CONFIG_NF_CONNTRACK_BRIDGE=m
-CONFIG_BRIDGE_NF_EBTABLES_LEGACY=m
-CONFIG_BRIDGE_NF_EBTABLES=m
-CONFIG_BRIDGE_EBT_BROUTE=m
-CONFIG_BRIDGE_EBT_T_FILTER=m
-CONFIG_BRIDGE_EBT_T_NAT=m
-CONFIG_BRIDGE_EBT_802_3=m
-CONFIG_BRIDGE_EBT_AMONG=m
-CONFIG_BRIDGE_EBT_ARP=m
-CONFIG_BRIDGE_EBT_IP=m
-CONFIG_BRIDGE_EBT_IP6=m
-CONFIG_BRIDGE_EBT_LIMIT=m
-CONFIG_BRIDGE_EBT_MARK=m
-CONFIG_BRIDGE_EBT_PKTTYPE=m
-CONFIG_BRIDGE_EBT_STP=m
-CONFIG_BRIDGE_EBT_VLAN=m
-CONFIG_BRIDGE_EBT_ARPREPLY=m
-CONFIG_BRIDGE_EBT_DNAT=m
-CONFIG_BRIDGE_EBT_MARK_T=m
-CONFIG_BRIDGE_EBT_REDIRECT=m
-CONFIG_BRIDGE_EBT_SNAT=m
-CONFIG_BRIDGE_EBT_LOG=m
-CONFIG_BRIDGE_EBT_NFLOG=m
-CONFIG_IP_SCTP=m
-CONFIG_RDS=m
-CONFIG_RDS_TCP=m
-CONFIG_L2TP=m
-CONFIG_BRIDGE=m
-CONFIG_ATALK=m
-CONFIG_6LOWPAN=m
-CONFIG_6LOWPAN_GHC_EXT_HDR_HOP=m
-CONFIG_6LOWPAN_GHC_UDP=m
-CONFIG_6LOWPAN_GHC_ICMPV6=m
-CONFIG_6LOWPAN_GHC_EXT_HDR_DEST=m
-CONFIG_6LOWPAN_GHC_EXT_HDR_FRAG=m
-CONFIG_6LOWPAN_GHC_EXT_HDR_ROUTE=m
-CONFIG_DNS_RESOLVER=y
-CONFIG_BATMAN_ADV=m
-# CONFIG_BATMAN_ADV_BATMAN_V is not set
-CONFIG_NETLINK_DIAG=m
-CONFIG_MPLS=y
-CONFIG_NET_MPLS_GSO=m
-CONFIG_MPLS_ROUTING=m
-CONFIG_MPLS_IPTUNNEL=m
-CONFIG_NET_NSH=m
-CONFIG_AF_KCM=m
-# CONFIG_WIRELESS is not set
-CONFIG_PSAMPLE=m
-CONFIG_NET_IFE=m
-CONFIG_DEVTMPFS=y
-CONFIG_DEVTMPFS_MOUNT=y
-CONFIG_TEST_ASYNC_DRIVER_PROBE=m
-CONFIG_CONNECTOR=m
-CONFIG_ZRAM=m
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_DEV_DRBD=m
-CONFIG_BLK_DEV_NBD=m
-CONFIG_BLK_DEV_RAM=y
-CONFIG_ATA_OVER_ETH=m
-CONFIG_DUMMY_IRQ=m
-CONFIG_RAID_ATTRS=m
-CONFIG_SCSI=y
-CONFIG_BLK_DEV_SD=y
-CONFIG_CHR_DEV_ST=m
-CONFIG_BLK_DEV_SR=y
-CONFIG_CHR_DEV_SG=m
-CONFIG_SCSI_CONSTANTS=y
-CONFIG_SCSI_SAS_ATTRS=m
-CONFIG_ISCSI_TCP=m
-CONFIG_ISCSI_BOOT_SYSFS=m
-CONFIG_MD=y
-CONFIG_MD_LINEAR=m
-CONFIG_BLK_DEV_DM=m
-CONFIG_DM_UNSTRIPED=m
-CONFIG_DM_CRYPT=m
-CONFIG_DM_SNAPSHOT=m
-CONFIG_DM_THIN_PROVISIONING=m
-CONFIG_DM_WRITECACHE=m
-CONFIG_DM_ERA=m
-CONFIG_DM_CLONE=m
-CONFIG_DM_MIRROR=m
-CONFIG_DM_RAID=m
-CONFIG_DM_ZERO=m
-CONFIG_DM_MULTIPATH=m
-CONFIG_DM_UEVENT=y
-CONFIG_DM_LOG_WRITES=m
-CONFIG_DM_INTEGRITY=m
-CONFIG_TARGET_CORE=m
-CONFIG_TCM_IBLOCK=m
-CONFIG_TCM_FILEIO=m
-CONFIG_TCM_PSCSI=m
-CONFIG_NETDEVICES=y
-CONFIG_DUMMY=m
-CONFIG_WIREGUARD=m
-CONFIG_OVPN=m
-CONFIG_EQUALIZER=m
-CONFIG_NET_TEAM=m
-CONFIG_NET_TEAM_MODE_BROADCAST=m
-CONFIG_NET_TEAM_MODE_ROUNDROBIN=m
-CONFIG_NET_TEAM_MODE_RANDOM=m
-CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m
-CONFIG_NET_TEAM_MODE_LOADBALANCE=m
-CONFIG_MACVLAN=m
-CONFIG_MACVTAP=m
-CONFIG_IPVLAN=m
-CONFIG_IPVTAP=m
-CONFIG_VXLAN=m
-CONFIG_GENEVE=m
-CONFIG_BAREUDP=m
-CONFIG_GTP=m
-CONFIG_PFCP=m
-CONFIG_MACSEC=m
-CONFIG_NETCONSOLE=m
-CONFIG_NETCONSOLE_DYNAMIC=y
-CONFIG_TUN=m
-CONFIG_VETH=m
-CONFIG_PPP=m
-CONFIG_PPP_BSDCOMP=m
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_FILTER=y
-CONFIG_PPP_MPPE=m
-CONFIG_PPPOE=m
-CONFIG_PPTP=m
-CONFIG_PPPOL2TP=m
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_SLIP=m
-CONFIG_SLIP_COMPRESSED=y
-CONFIG_SLIP_SMART=y
-CONFIG_SLIP_MODE_SLIP6=y
-# CONFIG_WLAN is not set
-CONFIG_INPUT_EVDEV=m
-# CONFIG_KEYBOARD_ATKBD is not set
-# CONFIG_MOUSE_PS2 is not set
-CONFIG_MOUSE_SERIAL=m
-CONFIG_SERIO=m
-CONFIG_USERIO=m
-# CONFIG_LEGACY_PTYS is not set
-# CONFIG_HW_RANDOM is not set
-CONFIG_NTP_PPS=y
-CONFIG_PPS_CLIENT_LDISC=m
-CONFIG_PTP_1588_CLOCK=m
-# CONFIG_HWMON is not set
-CONFIG_FB=y
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION=y
-CONFIG_LOGO=y
-# CONFIG_LOGO_LINUX_VGA16 is not set
-# CONFIG_LOGO_LINUX_CLUT224 is not set
-CONFIG_HID=m
-CONFIG_HIDRAW=y
-CONFIG_UHID=m
-# CONFIG_HID_GENERIC is not set
-# CONFIG_HID_ITE is not set
-# CONFIG_HID_REDRAGON is not set
-# CONFIG_USB_SUPPORT is not set
-CONFIG_RTC_CLASS=y
-# CONFIG_RTC_NVMEM is not set
-CONFIG_RTC_DRV_GENERIC=m
-# CONFIG_VIRTIO_MENU is not set
-# CONFIG_VHOST_MENU is not set
-# CONFIG_IOMMU_SUPPORT is not set
-CONFIG_DAX=m
-CONFIG_EXT4_FS=y
-CONFIG_JFS_FS=m
-CONFIG_XFS_FS=m
-CONFIG_OCFS2_FS=m
-# CONFIG_OCFS2_DEBUG_MASKLOG is not set
-CONFIG_BTRFS_FS=m
-CONFIG_FANOTIFY=y
-CONFIG_QUOTA_NETLINK_INTERFACE=y
-CONFIG_AUTOFS_FS=m
-CONFIG_FUSE_FS=m
-CONFIG_CUSE=m
-CONFIG_OVERLAY_FS=m
-CONFIG_ISO9660_FS=y
-CONFIG_JOLIET=y
-CONFIG_ZISOFS=y
-CONFIG_UDF_FS=m
-CONFIG_MSDOS_FS=m
-CONFIG_VFAT_FS=m
-CONFIG_EXFAT_FS=m
-CONFIG_NTFS3_FS=m
-CONFIG_NTFS3_LZX_XPRESS=y
-CONFIG_PROC_KCORE=y
-CONFIG_PROC_CHILDREN=y
-CONFIG_TMPFS=y
-CONFIG_ORANGEFS_FS=m
-CONFIG_AFFS_FS=m
-CONFIG_ECRYPT_FS=m
-CONFIG_ECRYPT_FS_MESSAGING=y
-CONFIG_HFS_FS=m
-CONFIG_HFSPLUS_FS=m
-CONFIG_CRAMFS=m
-CONFIG_SQUASHFS=m
-CONFIG_SQUASHFS_LZ4=y
-CONFIG_SQUASHFS_LZO=y
-CONFIG_MINIX_FS=m
-CONFIG_OMFS_FS=m
-CONFIG_HPFS_FS=m
-CONFIG_QNX4FS_FS=m
-CONFIG_QNX6FS_FS=m
-CONFIG_UFS_FS=m
-CONFIG_EROFS_FS=m
-CONFIG_NFS_FS=y
-CONFIG_NFS_V4=m
-CONFIG_NFS_SWAP=y
-CONFIG_ROOT_NFS=y
-CONFIG_NFSD=m
-CONFIG_RPCSEC_GSS_KRB5=m
-CONFIG_CIFS=m
-# CONFIG_CIFS_STATS2 is not set
-# CONFIG_CIFS_DEBUG is not set
-CONFIG_CODA_FS=m
-CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_CODEPAGE_737=m
-CONFIG_NLS_CODEPAGE_775=m
-CONFIG_NLS_CODEPAGE_850=m
-CONFIG_NLS_CODEPAGE_852=m
-CONFIG_NLS_CODEPAGE_855=m
-CONFIG_NLS_CODEPAGE_857=m
-CONFIG_NLS_CODEPAGE_860=m
-CONFIG_NLS_CODEPAGE_861=m
-CONFIG_NLS_CODEPAGE_862=m
-CONFIG_NLS_CODEPAGE_863=m
-CONFIG_NLS_CODEPAGE_864=m
-CONFIG_NLS_CODEPAGE_865=m
-CONFIG_NLS_CODEPAGE_866=m
-CONFIG_NLS_CODEPAGE_869=m
-CONFIG_NLS_CODEPAGE_936=m
-CONFIG_NLS_CODEPAGE_950=m
-CONFIG_NLS_CODEPAGE_932=m
-CONFIG_NLS_CODEPAGE_949=m
-CONFIG_NLS_CODEPAGE_874=m
-CONFIG_NLS_ISO8859_8=m
-CONFIG_NLS_CODEPAGE_1250=m
-CONFIG_NLS_CODEPAGE_1251=m
-CONFIG_NLS_ASCII=m
-CONFIG_NLS_ISO8859_1=y
-CONFIG_NLS_ISO8859_2=m
-CONFIG_NLS_ISO8859_3=m
-CONFIG_NLS_ISO8859_4=m
-CONFIG_NLS_ISO8859_5=m
-CONFIG_NLS_ISO8859_6=m
-CONFIG_NLS_ISO8859_7=m
-CONFIG_NLS_ISO8859_9=m
-CONFIG_NLS_ISO8859_13=m
-CONFIG_NLS_ISO8859_14=m
-CONFIG_NLS_ISO8859_15=m
-CONFIG_NLS_KOI8_R=m
-CONFIG_NLS_KOI8_U=m
-CONFIG_NLS_MAC_ROMAN=m
-CONFIG_NLS_MAC_CELTIC=m
-CONFIG_NLS_MAC_CENTEURO=m
-CONFIG_NLS_MAC_CROATIAN=m
-CONFIG_NLS_MAC_CYRILLIC=m
-CONFIG_NLS_MAC_GAELIC=m
-CONFIG_NLS_MAC_GREEK=m
-CONFIG_NLS_MAC_ICELAND=m
-CONFIG_NLS_MAC_INUIT=m
-CONFIG_NLS_MAC_ROMANIAN=m
-CONFIG_NLS_MAC_TURKISH=m
-CONFIG_DLM=m
-CONFIG_ENCRYPTED_KEYS=m
-CONFIG_HARDENED_USERCOPY=y
-CONFIG_CRYPTO_USER=m
-CONFIG_CRYPTO_NULL=m
-CONFIG_CRYPTO_CRYPTD=m
-CONFIG_CRYPTO_BENCHMARK=m
-CONFIG_CRYPTO_RSA=m
-CONFIG_CRYPTO_DH=m
-CONFIG_CRYPTO_ECDH=m
-CONFIG_CRYPTO_ECDSA=m
-CONFIG_CRYPTO_ECRDSA=m
-CONFIG_CRYPTO_AES=y
-CONFIG_CRYPTO_AES_TI=m
-CONFIG_CRYPTO_ANUBIS=m
-CONFIG_CRYPTO_ARIA=m
-CONFIG_CRYPTO_BLOWFISH=m
-CONFIG_CRYPTO_CAMELLIA=m
-CONFIG_CRYPTO_CAST5=m
-CONFIG_CRYPTO_CAST6=m
-CONFIG_CRYPTO_DES=m
-CONFIG_CRYPTO_FCRYPT=m
-CONFIG_CRYPTO_KHAZAD=m
-CONFIG_CRYPTO_SEED=m
-CONFIG_CRYPTO_SERPENT=m
-CONFIG_CRYPTO_SM4_GENERIC=m
-CONFIG_CRYPTO_TEA=m
-CONFIG_CRYPTO_TWOFISH=m
-CONFIG_CRYPTO_ADIANTUM=m
-CONFIG_CRYPTO_ARC4=m
-CONFIG_CRYPTO_CTS=m
-CONFIG_CRYPTO_HCTR2=m
-CONFIG_CRYPTO_LRW=m
-CONFIG_CRYPTO_PCBC=m
-CONFIG_CRYPTO_XTS=m
-CONFIG_CRYPTO_AEGIS128=m
-CONFIG_CRYPTO_MD4=m
-CONFIG_CRYPTO_MICHAEL_MIC=m
-CONFIG_CRYPTO_RMD160=m
-CONFIG_CRYPTO_SHA1=m
-CONFIG_CRYPTO_SM3_GENERIC=m
-CONFIG_CRYPTO_WP512=m
-CONFIG_CRYPTO_XCBC=m
-CONFIG_CRYPTO_LZO=m
-CONFIG_CRYPTO_842=m
-CONFIG_CRYPTO_LZ4=m
-CONFIG_CRYPTO_LZ4HC=m
-CONFIG_CRYPTO_ZSTD=m
-CONFIG_CRYPTO_DRBG_HASH=y
-CONFIG_CRYPTO_DRBG_CTR=y
-CONFIG_CRYPTO_USER_API_HASH=m
-CONFIG_CRYPTO_USER_API_SKCIPHER=m
-CONFIG_CRYPTO_USER_API_RNG=m
-CONFIG_CRYPTO_USER_API_AEAD=m
-# CONFIG_CRYPTO_HW is not set
-CONFIG_PRIME_NUMBERS=m
-CONFIG_CRC_BENCHMARK=y
-CONFIG_XZ_DEC_TEST=m
-CONFIG_GLOB_SELFTEST=m
-# CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_TEST_LOCKUP=m
-CONFIG_WW_MUTEX_SELFTEST=m
-CONFIG_EARLY_PRINTK=y
-CONFIG_KUNIT=m
-CONFIG_KUNIT_ALL_TESTS=m
-CONFIG_TEST_DHRY=m
-CONFIG_TEST_MIN_HEAP=m
-CONFIG_TEST_DIV64=m
-CONFIG_TEST_MULDIV64=m
-CONFIG_REED_SOLOMON_TEST=m
-CONFIG_ATOMIC64_SELFTEST=m
-CONFIG_ASYNC_RAID6_TEST=m
-CONFIG_TEST_HEXDUMP=m
-CONFIG_TEST_KSTRTOX=m
-CONFIG_TEST_BITMAP=m
-CONFIG_TEST_UUID=m
-CONFIG_TEST_XARRAY=m
-CONFIG_TEST_MAPLE_TREE=m
-CONFIG_TEST_RHASHTABLE=m
-CONFIG_TEST_IDA=m
-CONFIG_TEST_BITOPS=m
-CONFIG_TEST_VMALLOC=m
-CONFIG_TEST_BPF=m
-CONFIG_FIND_BIT_BENCHMARK=m
-CONFIG_TEST_FIRMWARE=m
-CONFIG_TEST_SYSCTL=m
-CONFIG_LINEAR_RANGES_TEST=m
-CONFIG_TEST_UDELAY=m
-CONFIG_TEST_STATIC_KEYS=m
-CONFIG_TEST_KMOD=m
-CONFIG_TEST_MEMCAT_P=m
-CONFIG_TEST_MEMINIT=m
-CONFIG_TEST_FREE_PAGES=m
diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig
index 74f0a1f6d871..b06de259c697 100644
--- a/arch/m68k/configs/multi_defconfig
+++ b/arch/m68k/configs/multi_defconfig
@@ -19,7 +19,6 @@ CONFIG_M68KFPU_EMU=y
CONFIG_AMIGA=y
CONFIG_ATARI=y
CONFIG_MAC=y
-CONFIG_APOLLO=y
CONFIG_VME=y
CONFIG_MVME147=y
CONFIG_MVME16x=y
diff --git a/arch/m68k/include/asm/apollohw.h b/arch/m68k/include/asm/apollohw.h
deleted file mode 100644
index 52066f3b8658..000000000000
--- a/arch/m68k/include/asm/apollohw.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* apollohw.h : some structures to access apollo HW */
-
-#ifndef _ASMm68k_APOLLOHW_H_
-#define _ASMm68k_APOLLOHW_H_
-
-#include <linux/types.h>
-
-#include <asm/bootinfo-apollo.h>
-
-
-extern u_long apollo_model;
-
-
-/*
- see scn2681 data sheet for more info.
- member names are read_write.
-*/
-
-#define DECLARE_2681_FIELD(x) unsigned char x; unsigned char dummy##x
-
-struct SCN2681 {
-
- DECLARE_2681_FIELD(mra);
- DECLARE_2681_FIELD(sra_csra);
- DECLARE_2681_FIELD(BRGtest_cra);
- DECLARE_2681_FIELD(rhra_thra);
- DECLARE_2681_FIELD(ipcr_acr);
- DECLARE_2681_FIELD(isr_imr);
- DECLARE_2681_FIELD(ctu_ctur);
- DECLARE_2681_FIELD(ctl_ctlr);
- DECLARE_2681_FIELD(mrb);
- DECLARE_2681_FIELD(srb_csrb);
- DECLARE_2681_FIELD(tst_crb);
- DECLARE_2681_FIELD(rhrb_thrb);
- DECLARE_2681_FIELD(reserved);
- DECLARE_2681_FIELD(ip_opcr);
- DECLARE_2681_FIELD(startCnt_setOutBit);
- DECLARE_2681_FIELD(stopCnt_resetOutBit);
-
-};
-
-struct mc146818 {
- unsigned char second, alarm_second;
- unsigned char minute, alarm_minute;
- unsigned char hours, alarm_hours;
- unsigned char day_of_week, day_of_month;
- unsigned char month, year;
-};
-
-
-#define IO_BASE 0x80000000
-
-extern u_long sio01_physaddr;
-extern u_long sio23_physaddr;
-extern u_long rtc_physaddr;
-extern u_long pica_physaddr;
-extern u_long picb_physaddr;
-extern u_long cpuctrl_physaddr;
-extern u_long timer_physaddr;
-
-#define SAU7_SIO01_PHYSADDR 0x10400
-#define SAU7_SIO23_PHYSADDR 0x10500
-#define SAU7_RTC_PHYSADDR 0x10900
-#define SAU7_PICA 0x11000
-#define SAU7_PICB 0x11100
-#define SAU7_CPUCTRL 0x10100
-#define SAU7_TIMER 0x010800
-
-#define SAU8_SIO01_PHYSADDR 0x8400
-#define SAU8_RTC_PHYSADDR 0x8900
-#define SAU8_PICA 0x9400
-#define SAU8_PICB 0x9500
-#define SAU8_CPUCTRL 0x8100
-#define SAU8_TIMER 0x8800
-
-#define sio01 ((*(volatile struct SCN2681 *)(IO_BASE + sio01_physaddr)))
-#define sio23 ((*(volatile struct SCN2681 *)(IO_BASE + sio23_physaddr)))
-#define rtc (((volatile struct mc146818 *)(IO_BASE + rtc_physaddr)))
-#define cpuctrl (*(volatile unsigned int *)(IO_BASE + cpuctrl_physaddr))
-#define pica (IO_BASE + pica_physaddr)
-#define picb (IO_BASE + picb_physaddr)
-#define apollo_timer (IO_BASE + timer_physaddr)
-#define addr_xlat_map ((unsigned short *)(IO_BASE + 0x17000))
-
-#define isaIO2mem(x) (((((x) & 0x3f8) << 7) | (((x) & 0xfc00) >> 6) | ((x) & 0x7)) + 0x40000 + IO_BASE)
-
-#define IRQ_APOLLO IRQ_USER
-
-#endif
diff --git a/arch/m68k/include/asm/config.h b/arch/m68k/include/asm/config.h
index 9bb888ab5009..9c73a73a7b3c 100644
--- a/arch/m68k/include/asm/config.h
+++ b/arch/m68k/include/asm/config.h
@@ -9,7 +9,6 @@
#define _M68K_CONFIG_H
extern int amiga_parse_bootinfo(const struct bi_record *record);
-extern int apollo_parse_bootinfo(const struct bi_record *record);
extern int atari_parse_bootinfo(const struct bi_record *record);
extern int bvme6000_parse_bootinfo(const struct bi_record *record);
extern int hp300_parse_bootinfo(const struct bi_record *record);
@@ -20,7 +19,6 @@ extern int q40_parse_bootinfo(const struct bi_record *record);
extern int virt_parse_bootinfo(const struct bi_record *record);
extern void config_amiga(void);
-extern void config_apollo(void);
extern void config_atari(void);
extern void config_bvme6000(void);
extern void config_hp300(void);
diff --git a/arch/m68k/include/asm/irq.h b/arch/m68k/include/asm/irq.h
index 2263e92d418a..51cd970b0778 100644
--- a/arch/m68k/include/asm/irq.h
+++ b/arch/m68k/include/asm/irq.h
@@ -26,8 +26,6 @@
#define NR_IRQS 43
#elif defined(CONFIG_AMIGA) || !defined(CONFIG_MMU)
#define NR_IRQS 32
-#elif defined(CONFIG_APOLLO)
-#define NR_IRQS 24
#else /* CONFIG_HP300 etc. */
#define NR_IRQS 8
#endif
diff --git a/arch/m68k/include/asm/setup.h b/arch/m68k/include/asm/setup.h
index e4ec169f5c7d..1719d0ee59ea 100644
--- a/arch/m68k/include/asm/setup.h
+++ b/arch/m68k/include/asm/setup.h
@@ -34,7 +34,7 @@ extern unsigned long m68k_machtype;
#if !defined(CONFIG_AMIGA)
# define MACH_IS_AMIGA (0)
-#elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
+#elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) \
|| defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
|| defined(CONFIG_HP300) || defined(CONFIG_Q40) \
|| defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) \
@@ -48,7 +48,7 @@ extern unsigned long m68k_machtype;
#if !defined(CONFIG_ATARI)
# define MACH_IS_ATARI (0)
-#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
+#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) \
|| defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
|| defined(CONFIG_HP300) || defined(CONFIG_Q40) \
|| defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) \
@@ -62,7 +62,7 @@ extern unsigned long m68k_machtype;
#if !defined(CONFIG_MAC)
# define MACH_IS_MAC (0)
-#elif defined(CONFIG_AMIGA) || defined(CONFIG_ATARI) || defined(CONFIG_APOLLO) \
+#elif defined(CONFIG_AMIGA) || defined(CONFIG_ATARI) \
|| defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
|| defined(CONFIG_HP300) || defined(CONFIG_Q40) \
|| defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) \
@@ -82,24 +82,10 @@ extern unsigned long m68k_machtype;
#define MACH_IS_SUN3 (0)
#endif
-#if !defined (CONFIG_APOLLO)
-# define MACH_IS_APOLLO (0)
-#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
- || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
- || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
- || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) \
- || defined(CONFIG_VIRT)
-# define MACH_IS_APOLLO (m68k_machtype == MACH_APOLLO)
-#else
-# define MACH_APOLLO_ONLY
-# define MACH_IS_APOLLO (1)
-# define MACH_TYPE (MACH_APOLLO)
-#endif
-
#if !defined (CONFIG_MVME147)
# define MACH_IS_MVME147 (0)
#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
- || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) \
+ || defined(CONFIG_BVME6000) \
|| defined(CONFIG_HP300) || defined(CONFIG_Q40) \
|| defined(CONFIG_SUN3X) || defined(CONFIG_MVME16x) \
|| defined(CONFIG_VIRT)
@@ -113,7 +99,7 @@ extern unsigned long m68k_machtype;
#if !defined (CONFIG_MVME16x)
# define MACH_IS_MVME16x (0)
#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
- || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) \
+ || defined(CONFIG_BVME6000) \
|| defined(CONFIG_HP300) || defined(CONFIG_Q40) \
|| defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) \
|| defined(CONFIG_VIRT)
@@ -127,7 +113,7 @@ extern unsigned long m68k_machtype;
#if !defined (CONFIG_BVME6000)
# define MACH_IS_BVME6000 (0)
#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
- || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
+ || defined(CONFIG_MVME16x) \
|| defined(CONFIG_HP300) || defined(CONFIG_Q40) \
|| defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) \
|| defined(CONFIG_VIRT)
@@ -141,7 +127,7 @@ extern unsigned long m68k_machtype;
#if !defined (CONFIG_HP300)
# define MACH_IS_HP300 (0)
#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
- || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
+ || defined(CONFIG_MVME16x) \
|| defined(CONFIG_BVME6000) || defined(CONFIG_Q40) \
|| defined(CONFIG_SUN3X) || defined(CONFIG_MVME147) \
|| defined(CONFIG_VIRT)
@@ -169,7 +155,7 @@ extern unsigned long m68k_machtype;
#if !defined (CONFIG_SUN3X)
# define MACH_IS_SUN3X (0)
#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
- || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
+ || defined(CONFIG_MVME16x) \
|| defined(CONFIG_BVME6000) || defined(CONFIG_HP300) \
|| defined(CONFIG_Q40) || defined(CONFIG_MVME147) \
|| defined(CONFIG_VIRT)
@@ -183,7 +169,7 @@ extern unsigned long m68k_machtype;
#if !defined(CONFIG_VIRT)
# define MACH_IS_VIRT (0)
#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
- || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
+ || defined(CONFIG_MVME16x) \
|| defined(CONFIG_BVME6000) || defined(CONFIG_HP300) \
|| defined(CONFIG_Q40) || defined(CONFIG_SUN3X) \
|| defined(CONFIG_MVME147)
diff --git a/arch/m68k/include/uapi/asm/bootinfo-apollo.h b/arch/m68k/include/uapi/asm/bootinfo-apollo.h
deleted file mode 100644
index c226f7957938..000000000000
--- a/arch/m68k/include/uapi/asm/bootinfo-apollo.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-/*
-** asm/bootinfo-apollo.h -- Apollo-specific boot information definitions
-*/
-
-#ifndef _UAPI_ASM_M68K_BOOTINFO_APOLLO_H
-#define _UAPI_ASM_M68K_BOOTINFO_APOLLO_H
-
-
- /*
- * Apollo-specific tags
- */
-
-#define BI_APOLLO_MODEL 0x8000 /* model (__be32) */
-
-
- /*
- * Apollo models (BI_APOLLO_MODEL)
- */
-
-#define APOLLO_UNKNOWN 0
-#define APOLLO_DN3000 1
-#define APOLLO_DN3010 2
-#define APOLLO_DN3500 3
-#define APOLLO_DN4000 4
-#define APOLLO_DN4500 5
-
-
-#endif /* _UAPI_ASM_M68K_BOOTINFO_APOLLO_H */
diff --git a/arch/m68k/include/uapi/asm/bootinfo.h b/arch/m68k/include/uapi/asm/bootinfo.h
index 28d2d44c08d0..a199a7ecd3cd 100644
--- a/arch/m68k/include/uapi/asm/bootinfo.h
+++ b/arch/m68k/include/uapi/asm/bootinfo.h
@@ -80,7 +80,7 @@ struct mem_info {
#define MACH_AMIGA 1
#define MACH_ATARI 2
#define MACH_MAC 3
-#define MACH_APOLLO 4
+/* 4 was MACH_APOLLO */
#define MACH_SUN3 5
#define MACH_MVME147 6
#define MACH_MVME16x 7
@@ -134,7 +134,7 @@ struct mem_info {
#define MMUB_68030 1 /* Internal MMU */
#define MMUB_68040 2 /* Internal MMU */
#define MMUB_68060 3 /* Internal MMU */
-#define MMUB_APOLLO 4 /* Custom Apollo */
+/* 4 was MMUB_APOLLO */
#define MMUB_SUN3 5 /* Custom Sun-3 */
#define MMUB_COLDFIRE 6 /* Internal MMU */
@@ -143,7 +143,6 @@ struct mem_info {
#define MMU_68040 (1 << MMUB_68040)
#define MMU_68060 (1 << MMUB_68060)
#define MMU_SUN3 (1 << MMUB_SUN3)
-#define MMU_APOLLO (1 << MMUB_APOLLO)
#define MMU_COLDFIRE (1 << MMUB_COLDFIRE)
diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S
index 2e4ef0358887..573b30100679 100644
--- a/arch/m68k/kernel/head.S
+++ b/arch/m68k/kernel/head.S
@@ -449,7 +449,7 @@ func_define mmu_get_ptr_table_entry,2
func_define mmu_get_page_table_entry,2
func_define mmu_print
func_define get_new_page
-#if defined(CONFIG_HP300) || defined(CONFIG_APOLLO)
+#ifdef CONFIG_HP300
func_define set_leds
#endif
@@ -528,17 +528,10 @@ func_define putn,1
#define is_mvme16x(lab) cmpl &MACH_MVME16x,%pc@(m68k_machtype); jeq lab
#define is_bvme6000(lab) cmpl &MACH_BVME6000,%pc@(m68k_machtype); jeq lab
#define is_not_hp300(lab) cmpl &MACH_HP300,%pc@(m68k_machtype); jne lab
-#define is_not_apollo(lab) cmpl &MACH_APOLLO,%pc@(m68k_machtype); jne lab
#define is_not_q40(lab) cmpl &MACH_Q40,%pc@(m68k_machtype); jne lab
#define is_not_sun3x(lab) cmpl &MACH_SUN3X,%pc@(m68k_machtype); jne lab
#define is_not_virt(lab) cmpl &MACH_VIRT,%pc@(m68k_machtype); jne lab
-#define hasnt_leds(lab) cmpl &MACH_HP300,%pc@(m68k_machtype); \
- jeq 42f; \
- cmpl &MACH_APOLLO,%pc@(m68k_machtype); \
- jne lab ;\
- 42:\
-
#define is_040_or_060(lab) btst &CPUTYPE_0460,%pc@(L(cputype)+3); jne lab
#define is_not_040_or_060(lab) btst &CPUTYPE_0460,%pc@(L(cputype)+3); jeq lab
#define is_040(lab) btst &CPUTYPE_040,%pc@(L(cputype)+3); jne lab
@@ -551,8 +544,8 @@ func_define putn,1
the console is running. Writing a 1 bit turns the corresponding LED
_off_ - on the 340 bit 7 is towards the back panel of the machine. */
.macro leds mask
-#if defined(CONFIG_HP300) || defined(CONFIG_APOLLO)
- hasnt_leds(.Lled\@)
+#ifdef CONFIG_HP300
+ is_not_hp300(.Lled\@)
pea \mask
func_call set_leds
addql #4,%sp
@@ -1250,16 +1243,6 @@ L(notsun3x):
L(novirt):
#endif
-#ifdef CONFIG_APOLLO
- is_not_apollo(L(notapollo))
-
- putc 'P'
- mmu_map #0x80000000,#0,#0x02000000,#_PAGE_NOCACHE030
-
-L(notapollo):
- jbra L(mmu_init_done)
-#endif
-
L(mmu_init_done):
putc 'G'
@@ -1445,16 +1428,6 @@ L(mmu_fixup_done):
/* enable copro */
oriw #0x4000,0x61000000
1:
-#endif
-
-#ifdef CONFIG_APOLLO
- is_not_apollo(1f)
-
- /*
- * Fix up the iobase before printing
- */
- movel #0x80000000,L(iobase)
-1:
#endif
putc 'I'
@@ -2982,10 +2955,6 @@ L(serial_init_not_mac):
L(serial_init_not_mvme16x):
#endif
-#ifdef CONFIG_APOLLO
-/* We count on the PROM initializing SIO1 */
-#endif
-
#ifdef CONFIG_HP300
/* We count on the boot loader initialising the UART */
#endif
@@ -3167,17 +3136,6 @@ func_start serial_putc,%d0/%d1/%a0/%a1
2:
#endif
-#ifdef CONFIG_APOLLO
- is_not_apollo(2f)
- movl %pc@(L(iobase)),%a1
- moveb %d0,%a1@(LTHRB0)
-1: moveb %a1@(LSRB0),%d0
- andb #0x4,%d0
- beq 1b
- jbra L(serial_putc_done)
-2:
-#endif
-
#ifdef CONFIG_HP300
is_not_hp300(3f)
movl %pc@(L(iobase)),%a1
@@ -3293,23 +3251,14 @@ ENTRY(debug_cons_nputs)
rts
#endif /* CONFIG_EARLY_PRINTK */
-#if defined(CONFIG_HP300) || defined(CONFIG_APOLLO)
+#ifdef CONFIG_HP300
func_start set_leds,%d0/%a0
movel ARG1,%d0
-#ifdef CONFIG_HP300
is_not_hp300(1f)
movel %pc@(L(iobase)),%a0
moveb %d0,%a0@(0x1ffff)
- jra 2f
-#endif
+ jra 1f
1:
-#ifdef CONFIG_APOLLO
- movel %pc@(L(iobase)),%a0
- lsll #8,%d0
- eorw #0xff00,%d0
- moveb %d0,%a0@(LCPUCTRL)
-#endif
-2:
func_return set_leds
#endif
@@ -3768,8 +3717,7 @@ __INITDATA
m68k_init_mapped_size:
.long 0
-#if defined(CONFIG_ATARI) || defined(CONFIG_AMIGA) || \
- defined(CONFIG_HP300) || defined(CONFIG_APOLLO)
+#if defined(CONFIG_ATARI) || defined(CONFIG_AMIGA) || defined(CONFIG_HP300)
L(custom):
L(iobase):
.long 0
@@ -3850,12 +3798,6 @@ L(mac_sccbase):
.long 0
#endif /* CONFIG_MAC */
-#if defined (CONFIG_APOLLO)
-LSRB0 = 0x10412
-LTHRB0 = 0x10416
-LCPUCTRL = 0x10100
-#endif
-
#if defined(CONFIG_HP300)
DCADATA = 0x11
DCALSR = 0x1b
diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
index c7e8de0d34bb..2451dda2f701 100644
--- a/arch/m68k/kernel/setup_mm.c
+++ b/arch/m68k/kernel/setup_mm.c
@@ -178,8 +178,6 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
unknown = mvme147_parse_bootinfo(record);
else if (MACH_IS_HP300)
unknown = hp300_parse_bootinfo(record);
- else if (MACH_IS_APOLLO)
- unknown = apollo_parse_bootinfo(record);
else if (MACH_IS_VIRT)
unknown = virt_parse_bootinfo(record);
else
@@ -275,11 +273,6 @@ void __init setup_arch(char **cmdline_p)
config_sun3();
break;
#endif
-#ifdef CONFIG_APOLLO
- case MACH_APOLLO:
- config_apollo();
- break;
-#endif
#ifdef CONFIG_MVME147
case MACH_MVME147:
config_mvme147();
@@ -433,8 +426,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
mmu = "68060";
else if (m68k_mmutype & MMU_SUN3)
mmu = "Sun-3";
- else if (m68k_mmutype & MMU_APOLLO)
- mmu = "Apollo";
else if (m68k_mmutype & MMU_COLDFIRE)
mmu = "ColdFire";
else
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index a733f90eca55..2796e3dd7eaa 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -184,14 +184,6 @@ config FB_CYBER2000_I2C
Integraphics CyberPro 20x0 and 5000 VGA chips. This is used
on the Netwinder machines for the SAA7111 video capture.
-config FB_APOLLO
- bool
- depends on (FB = y) && APOLLO
- default y
- select FB_CFB_FILLRECT
- select FB_CFB_IMAGEBLIT
- select FB_IOMEM_FOPS
-
config FB_Q40
bool
depends on (FB = y) && Q40
diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile
index b3d12f977c06..bc2e45da30d6 100644
--- a/drivers/video/fbdev/Makefile
+++ b/drivers/video/fbdev/Makefile
@@ -63,7 +63,6 @@ obj-$(CONFIG_FB_HGA) += hgafb.o
obj-$(CONFIG_FB_XVR500) += sunxvr500.o
obj-$(CONFIG_FB_XVR2500) += sunxvr2500.o
obj-$(CONFIG_FB_XVR1000) += sunxvr1000.o
-obj-$(CONFIG_FB_APOLLO) += dnfb.o
obj-$(CONFIG_FB_Q40) += q40fb.o
obj-$(CONFIG_FB_TGA) += tgafb.o
obj-$(CONFIG_FB_HP300) += hpfb.o
diff --git a/drivers/video/fbdev/dnfb.c b/drivers/video/fbdev/dnfb.c
deleted file mode 100644
index c4d24540d9ef..000000000000
--- a/drivers/video/fbdev/dnfb.c
+++ /dev/null
@@ -1,307 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/string.h>
-#include <linux/mm.h>
-#include <linux/delay.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-
-#include <asm/setup.h>
-#include <asm/irq.h>
-#include <asm/amigahw.h>
-#include <asm/amigaints.h>
-#include <asm/apollohw.h>
-#include <linux/fb.h>
-#include <linux/module.h>
-
-/* apollo video HW definitions */
-
-/*
- * Control Registers. IOBASE + $x
- *
- * Note: these are the Memory/IO BASE definitions for a mono card set to the
- * alternate address
- *
- * Control 3A and 3B serve identical functions except that 3A
- * deals with control 1 and 3b deals with Color LUT reg.
- */
-
-#define AP_IOBASE 0x3b0 /* Base address of 1 plane board. */
-#define AP_STATUS isaIO2mem(AP_IOBASE+0) /* Status register. Read */
-#define AP_WRITE_ENABLE isaIO2mem(AP_IOBASE+0) /* Write Enable Register Write */
-#define AP_DEVICE_ID isaIO2mem(AP_IOBASE+1) /* Device ID Register. Read */
-#define AP_ROP_1 isaIO2mem(AP_IOBASE+2) /* Raster Operation reg. Write Word */
-#define AP_DIAG_MEM_REQ isaIO2mem(AP_IOBASE+4) /* Diagnostic Memory Request. Write Word */
-#define AP_CONTROL_0 isaIO2mem(AP_IOBASE+8) /* Control Register 0. Read/Write */
-#define AP_CONTROL_1 isaIO2mem(AP_IOBASE+0xa) /* Control Register 1. Read/Write */
-#define AP_CONTROL_3A isaIO2mem(AP_IOBASE+0xe) /* Control Register 3a. Read/Write */
-#define AP_CONTROL_2 isaIO2mem(AP_IOBASE+0xc) /* Control Register 2. Read/Write */
-
-
-#define FRAME_BUFFER_START 0x0FA0000
-#define FRAME_BUFFER_LEN 0x40000
-
-/* CREG 0 */
-#define VECTOR_MODE 0x40 /* 010x.xxxx */
-#define DBLT_MODE 0x80 /* 100x.xxxx */
-#define NORMAL_MODE 0xE0 /* 111x.xxxx */
-#define SHIFT_BITS 0x1F /* xxx1.1111 */
- /* other bits are Shift value */
-
-/* CREG 1 */
-#define AD_BLT 0x80 /* 1xxx.xxxx */
-#define NORMAL 0x80 /* 1xxx.xxxx */ /* What is happening here ?? */
-#define INVERSE 0x00 /* 0xxx.xxxx */ /* Clearing this reverses the screen */
-#define PIX_BLT 0x00 /* 0xxx.xxxx */
-
-#define AD_HIBIT 0x40 /* xIxx.xxxx */
-
-#define ROP_EN 0x10 /* xxx1.xxxx */
-#define DST_EQ_SRC 0x00 /* xxx0.xxxx */
-#define nRESET_SYNC 0x08 /* xxxx.1xxx */
-#define SYNC_ENAB 0x02 /* xxxx.xx1x */
-
-#define BLANK_DISP 0x00 /* xxxx.xxx0 */
-#define ENAB_DISP 0x01 /* xxxx.xxx1 */
-
-#define NORM_CREG1 (nRESET_SYNC | SYNC_ENAB | ENAB_DISP) /* no reset sync */
-
-/* CREG 2 */
-
-/*
- * Following 3 defines are common to 1, 4 and 8 plane.
- */
-
-#define S_DATA_1s 0x00 /* 00xx.xxxx */ /* set source to all 1's -- vector drawing */
-#define S_DATA_PIX 0x40 /* 01xx.xxxx */ /* takes source from ls-bits and replicates over 16 bits */
-#define S_DATA_PLN 0xC0 /* 11xx.xxxx */ /* normal, each data access =16-bits in
- one plane of image mem */
-
-/* CREG 3A/CREG 3B */
-# define RESET_CREG 0x80 /* 1000.0000 */
-
-/* ROP REG - all one nibble */
-/* ********* NOTE : this is used r0,r1,r2,r3 *********** */
-#define ROP(r2,r3,r0,r1) ( (U_SHORT)((r0)|((r1)<<4)|((r2)<<8)|((r3)<<12)) )
-#define DEST_ZERO 0x0
-#define SRC_AND_DEST 0x1
-#define SRC_AND_nDEST 0x2
-#define SRC 0x3
-#define nSRC_AND_DEST 0x4
-#define DEST 0x5
-#define SRC_XOR_DEST 0x6
-#define SRC_OR_DEST 0x7
-#define SRC_NOR_DEST 0x8
-#define SRC_XNOR_DEST 0x9
-#define nDEST 0xA
-#define SRC_OR_nDEST 0xB
-#define nSRC 0xC
-#define nSRC_OR_DEST 0xD
-#define SRC_NAND_DEST 0xE
-#define DEST_ONE 0xF
-
-#define SWAP(A) ((A>>8) | ((A&0xff) <<8))
-
-/* frame buffer operations */
-
-static int dnfb_blank(int blank, struct fb_info *info);
-static void dnfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
-
-static const struct fb_ops dn_fb_ops = {
- .owner = THIS_MODULE,
- __FB_DEFAULT_IOMEM_OPS_RDWR,
- .fb_blank = dnfb_blank,
- .fb_fillrect = cfb_fillrect,
- .fb_copyarea = dnfb_copyarea,
- .fb_imageblit = cfb_imageblit,
- __FB_DEFAULT_IOMEM_OPS_MMAP,
-};
-
-static const struct fb_var_screeninfo dnfb_var = {
- .xres = 1280,
- .yres = 1024,
- .xres_virtual = 2048,
- .yres_virtual = 1024,
- .bits_per_pixel = 1,
- .height = -1,
- .width = -1,
- .vmode = FB_VMODE_NONINTERLACED,
-};
-
-static const struct fb_fix_screeninfo dnfb_fix = {
- .id = "Apollo Mono",
- .smem_start = (FRAME_BUFFER_START + IO_BASE),
- .smem_len = FRAME_BUFFER_LEN,
- .type = FB_TYPE_PACKED_PIXELS,
- .visual = FB_VISUAL_MONO10,
- .line_length = 256,
-};
-
-static int dnfb_blank(int blank, struct fb_info *info)
-{
- if (blank)
- out_8(AP_CONTROL_3A, 0x0);
- else
- out_8(AP_CONTROL_3A, 0x1);
- return 0;
-}
-
-static
-void dnfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
-{
-
- int incr, y_delta, pre_read = 0, x_end, x_word_count;
- uint start_mask, end_mask, dest;
- ushort *src, dummy;
- short i, j;
-
- incr = (area->dy <= area->sy) ? 1 : -1;
-
- src = (ushort *)(info->screen_base + area->sy * info->fix.line_length +
- (area->sx >> 4));
- dest = area->dy * (info->fix.line_length >> 1) + (area->dx >> 4);
-
- if (incr > 0) {
- y_delta = (info->fix.line_length * 8) - area->sx - area->width;
- x_end = area->dx + area->width - 1;
- x_word_count = (x_end >> 4) - (area->dx >> 4) + 1;
- start_mask = 0xffff0000 >> (area->dx & 0xf);
- end_mask = 0x7ffff >> (x_end & 0xf);
- out_8(AP_CONTROL_0,
- (((area->dx & 0xf) - (area->sx & 0xf)) % 16) | (0x4 << 5));
- if ((area->dx & 0xf) < (area->sx & 0xf))
- pre_read = 1;
- } else {
- y_delta = -((info->fix.line_length * 8) - area->sx - area->width);
- x_end = area->dx - area->width + 1;
- x_word_count = (area->dx >> 4) - (x_end >> 4) + 1;
- start_mask = 0x7ffff >> (area->dx & 0xf);
- end_mask = 0xffff0000 >> (x_end & 0xf);
- out_8(AP_CONTROL_0,
- ((-((area->sx & 0xf) - (area->dx & 0xf))) % 16) |
- (0x4 << 5));
- if ((area->dx & 0xf) > (area->sx & 0xf))
- pre_read = 1;
- }
-
- for (i = 0; i < area->height; i++) {
-
- out_8(AP_CONTROL_3A, 0xc | (dest >> 16));
-
- if (pre_read) {
- dummy = *src;
- src += incr;
- }
-
- if (x_word_count) {
- out_8(AP_WRITE_ENABLE, start_mask);
- *src = dest;
- src += incr;
- dest += incr;
- out_8(AP_WRITE_ENABLE, 0);
-
- for (j = 1; j < (x_word_count - 1); j++) {
- *src = dest;
- src += incr;
- dest += incr;
- }
-
- out_8(AP_WRITE_ENABLE, start_mask);
- *src = dest;
- dest += incr;
- src += incr;
- } else {
- out_8(AP_WRITE_ENABLE, start_mask | end_mask);
- *src = dest;
- dest += incr;
- src += incr;
- }
- src += (y_delta / 16);
- dest += (y_delta / 16);
- }
- out_8(AP_CONTROL_0, NORMAL_MODE);
-}
-
-/*
- * Initialization
- */
-
-static int dnfb_probe(struct platform_device *dev)
-{
- struct fb_info *info;
- int err = 0;
-
- info = framebuffer_alloc(0, &dev->dev);
- if (!info)
- return -ENOMEM;
-
- info->fbops = &dn_fb_ops;
- info->fix = dnfb_fix;
- info->var = dnfb_var;
- info->var.red.length = 1;
- info->var.red.offset = 0;
- info->var.green = info->var.blue = info->var.red;
- info->screen_base = (u_char *) info->fix.smem_start;
-
- err = fb_alloc_cmap(&info->cmap, 2, 0);
- if (err < 0)
- goto release_framebuffer;
-
- err = register_framebuffer(info);
- if (err < 0) {
- fb_dealloc_cmap(&info->cmap);
- goto release_framebuffer;
- }
- platform_set_drvdata(dev, info);
-
- /* now we have registered we can safely setup the hardware */
- out_8(AP_CONTROL_3A, RESET_CREG);
- out_be16(AP_WRITE_ENABLE, 0x0);
- out_8(AP_CONTROL_0, NORMAL_MODE);
- out_8(AP_CONTROL_1, (AD_BLT | DST_EQ_SRC | NORM_CREG1));
- out_8(AP_CONTROL_2, S_DATA_PLN);
- out_be16(AP_ROP_1, SWAP(0x3));
-
- printk("apollo frame buffer alive and kicking !\n");
- return err;
-
-release_framebuffer:
- framebuffer_release(info);
- return err;
-}
-
-static struct platform_driver dnfb_driver = {
- .probe = dnfb_probe,
- .driver = {
- .name = "dnfb",
- },
-};
-
-static struct platform_device dnfb_device = {
- .name = "dnfb",
-};
-
-static int __init dnfb_init(void)
-{
- int ret;
-
- if (!MACH_IS_APOLLO)
- return -ENODEV;
-
- if (fb_get_options("dnfb", NULL))
- return -ENODEV;
-
- ret = platform_driver_register(&dnfb_driver);
-
- if (!ret) {
- ret = platform_device_register(&dnfb_device);
- if (ret)
- platform_driver_unregister(&dnfb_driver);
- }
- return ret;
-}
-
-module_init(dnfb_init);
-
-MODULE_LICENSE("GPL");
--
2.43.0
^ permalink raw reply related
* Re: [RFC v1] man/man2/close.2: CAVEATS: Document divergence from POSIX.1-2024
From: Vincent Lefevre @ 2026-02-06 15:13 UTC (permalink / raw)
To: Rich Felker
Cc: Alejandro Colomar, Jan Kara, Alexander Viro, Christian Brauner,
linux-fsdevel, linux-api, libc-alpha
In-Reply-To: <20250517133251.GY1509@brightrain.aerifal.cx>
On 2025-05-17 09:32:52 -0400, Rich Felker wrote:
> On Fri, May 16, 2025 at 04:39:57PM +0200, Vincent Lefevre wrote:
> > On 2025-05-16 09:05:47 -0400, Rich Felker wrote:
> > > FWIW musl adopted the EINPROGRESS as soon as we were made aware of the
> > > issue, and later changed it to returning 0 since applications
> > > (particularly, any written prior to this interpretation) are prone to
> > > interpret EINPROGRESS as an error condition rather than success and
> > > possibly misinterpret it as meaning the fd is still open and valid to
> > > pass to close again.
> >
> > If I understand correctly, this is a poor choice. POSIX.1-2024 says:
> >
> > ERRORS
> > The close() and posix_close() functions shall fail if:
> > [...]
> > [EINPROGRESS]
> > The function was interrupted by a signal and fildes was closed
> > but the close operation is continuing asynchronously.
> >
> > But this does not mean that the asynchronous close operation will
> > succeed.
>
> There are no asynchronous behaviors specified for there to be a
> conformance distinction here. The only observable behaviors happen
> instantly, mainly the release of the file descriptor and the process's
> handle on the underlying resource. Abstractly, there is no async
> operation that could succeed or fail.
Sorry, this is old. But a consequence may be memory leak if something
unexpected occurred during what was done asynchronously. There is no
guarantee that *every* resource has been released.
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)
^ permalink raw reply
* Re: [PATCH bpf-next v9 9/9] selftests/bpf: Add tests to verify map create failure log
From: Leon Hwang @ 2026-02-06 2:50 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Willem de Bruijn, Jason Xing, Tao Chen,
Mykyta Yatsenko, Kumar Kartikeya Dwivedi, Anton Protopopov,
Amery Hung, Rong Tao, LKML, Linux API,
open list:KERNEL SELFTEST FRAMEWORK, kernel-patches-bot
In-Reply-To: <CAADnVQKYwi2bNc8Hsg-r9dF0ACYYEzRyZDc33G2Kr_o0bu3bow@mail.gmail.com>
On 6/2/26 07:18, Alexei Starovoitov wrote:
> On Wed, Feb 4, 2026 at 7:54 PM Leon Hwang <leon.hwang@linux.dev> wrote:
>>
>>
>>
>> On 5/2/26 04:14, Alexei Starovoitov wrote:
>>> On Mon, Feb 2, 2026 at 6:43 AM Leon Hwang <leon.hwang@linux.dev> wrote:
>>>>
>>>> +
>>>> +#define BPF_LOG_FIXED 8
>>>> +
>>>> +static void test_map_create(enum bpf_map_type map_type, const char *map_name,
>>>> + struct bpf_map_create_opts *opts, const char *exp_msg)
>>>> +{
>>>> + const int key_size = 4, value_size = 4, max_entries = 1;
>>>> + char log_buf[128];
>>>> + int fd;
>>>> + LIBBPF_OPTS(bpf_log_opts, log_opts);
>>>> +
>>>> + log_buf[0] = '\0';
>>>> + log_opts.log_buf = log_buf;
>>>> + log_opts.log_size = sizeof(log_buf);
>>>> + log_opts.log_level = BPF_LOG_FIXED;
>>>
>>> Why? Which part of the test needs the log with this flag?
>>
>> BPF_LOG_FIXED looks odd here.
>>
>> This test sets 'log_level = BPF_LOG_FIXED' to match the behavior of
>> bpf_vlog_init() as initialized by bpf_log_attr_create_vlog() in
>> patch #7. BPF_LOG_FIXED is intended to be the default log_level
>> there.
>
> I don't think you answered my question.
> bpf_vlog_init() is using whatever log_level user space provided.
> Why do you pass BPF_LOG_FIXED ?
>
The intention behind passing BPF_LOG_FIXED was to ensure the log used
the buffer in a fixed mode, since the allocated buffer was large enough
to hold the full log message from the kernel. It was not intended to
test against log_level itself.
After reviewing commit 121664093803 ("bpf: Switch BPF verifier log to be
a rotating log by default"), I realized that BPF_LOG_FIXED was
introduced specifically to disable the rotating log behavior. In this
test case, that distinction is not relevant, so BPF_LOG_FIXED is indeed
unnecessary.
I tested with 'log_level is 0' and 'log_level is non-zero'. The tests
fail when log_level is 0, and pass when log_level is non-zero. So I will
switch to using 'log_level = 1' in the next revision.
Thanks,
Leon
^ permalink raw reply
* Re: [PATCH bpf-next v9 4/9] bpf: Add syscall common attributes support for prog_load
From: Leon Hwang @ 2026-02-06 2:45 UTC (permalink / raw)
To: Andrii Nakryiko
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Willem de Bruijn, Jason Xing, Tao Chen,
Mykyta Yatsenko, Kumar Kartikeya Dwivedi, Anton Protopopov,
Amery Hung, Rong Tao, linux-kernel, linux-api, linux-kselftest,
kernel-patches-bot
In-Reply-To: <CAEf4BzZWawrE+mXaPNPAT8zcz0Qy+5QYA6r4JzEVw7UAcUH-uA@mail.gmail.com>
On 6/2/26 06:18, Andrii Nakryiko wrote:
> On Wed, Feb 4, 2026 at 7:42 PM Leon Hwang <leon.hwang@linux.dev> wrote:
[...]
>>>> +
>>>> + if (!attr->log_buf && attr_common->log_buf) {
>>>> + attr->log_buf = attr_common->log_buf;
>>>> + attr->log_size = attr_common->log_size;
>>>> + attr->log_level = attr_common->log_level;
>>>
>>> why are we setting this? Do we still have code that can access
>>> attr->log_buf even though we pass attr_log everywhere? If yes, should
>>> we still have that "split brain" code?
>>>
>>
>> 'attr->log_buf' is accessed only in bpf_check().
>
> bpf_check should be changed then, see below
>
>>
>>> If we don't have this assignment, then I think we don't need to have
>>> bpf_prog_load-specific and btf_load-specific log_attr_init() helpers.
>>> They can be unified into generic log_attr_init, where for
>>> bpf_prog_load you'll pass offsetof(log_true_size) +
>>> attr->log_{buf,size,level}, and for btf_load you'll pass different
>>> offset of and btf-specific attr->btf_log*
>>>
>>> This helper will just be making decision whether to use common_attr's
>>> log fields or passed directly command-specific ones.
>>>
>>> Or what am I missing?
>>>
>>
>> If the log attributes differ, where should the effective
>> log_* values be stored?
>>
>> Should they live in struct bpf_common_attr, or should we extend
>> struct bpf_log_attr to carry them?
>>
>> Note that in v8, Alexei suggested struct bpf_log_attr only needs
>> u32 offsetof_true_size;
>> bpfptr_t uattr;
>>
>> so I’d like to clarify the intended direction here. Once that’s clear, a
>> single generic log_attr_init() should be sufficient to handle this.
>>
>
> The intended direction is to have log buf/size/level in one place
> (after attr and common_attr validations), so we keep internal logic
> simple. Let's put all of that and log_true_size **pointer** (we don't
> have to much with offsetof, just calculate user addr for
> log_true_size, which just might be NULL) into bpf_log_attrs and teach
> all code to look and work *only* with that struct, ignoring anything
> log related from attr.
>
It’s clear now.
I’ll follow this direction in the next revision and consolidate all
log-related fields (including the log_true_size pointer) into
bpf_log_attr, so that internal code relies solely on that struct.
Thanks,
Leon
^ permalink raw reply
* Re: [PATCH bpf-next v9 9/9] selftests/bpf: Add tests to verify map create failure log
From: Alexei Starovoitov @ 2026-02-05 23:18 UTC (permalink / raw)
To: Leon Hwang
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Willem de Bruijn, Jason Xing, Tao Chen,
Mykyta Yatsenko, Kumar Kartikeya Dwivedi, Anton Protopopov,
Amery Hung, Rong Tao, LKML, Linux API,
open list:KERNEL SELFTEST FRAMEWORK, kernel-patches-bot
In-Reply-To: <11bb515b-35fd-44f3-9647-9c39580ce6a1@linux.dev>
On Wed, Feb 4, 2026 at 7:54 PM Leon Hwang <leon.hwang@linux.dev> wrote:
>
>
>
> On 5/2/26 04:14, Alexei Starovoitov wrote:
> > On Mon, Feb 2, 2026 at 6:43 AM Leon Hwang <leon.hwang@linux.dev> wrote:
> >>
> >> +
> >> +#define BPF_LOG_FIXED 8
> >> +
> >> +static void test_map_create(enum bpf_map_type map_type, const char *map_name,
> >> + struct bpf_map_create_opts *opts, const char *exp_msg)
> >> +{
> >> + const int key_size = 4, value_size = 4, max_entries = 1;
> >> + char log_buf[128];
> >> + int fd;
> >> + LIBBPF_OPTS(bpf_log_opts, log_opts);
> >> +
> >> + log_buf[0] = '\0';
> >> + log_opts.log_buf = log_buf;
> >> + log_opts.log_size = sizeof(log_buf);
> >> + log_opts.log_level = BPF_LOG_FIXED;
> >
> > Why? Which part of the test needs the log with this flag?
>
> BPF_LOG_FIXED looks odd here.
>
> This test sets 'log_level = BPF_LOG_FIXED' to match the behavior of
> bpf_vlog_init() as initialized by bpf_log_attr_create_vlog() in
> patch #7. BPF_LOG_FIXED is intended to be the default log_level
> there.
I don't think you answered my question.
bpf_vlog_init() is using whatever log_level user space provided.
Why do you pass BPF_LOG_FIXED ?
^ permalink raw reply
* Re: [PATCH bpf-next v9 4/9] bpf: Add syscall common attributes support for prog_load
From: Andrii Nakryiko @ 2026-02-05 22:18 UTC (permalink / raw)
To: Leon Hwang
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Willem de Bruijn, Jason Xing, Tao Chen,
Mykyta Yatsenko, Kumar Kartikeya Dwivedi, Anton Protopopov,
Amery Hung, Rong Tao, linux-kernel, linux-api, linux-kselftest,
kernel-patches-bot
In-Reply-To: <a31b7f19-a22a-44ab-8ecd-9df9dead9c3d@linux.dev>
On Wed, Feb 4, 2026 at 7:42 PM Leon Hwang <leon.hwang@linux.dev> wrote:
>
>
>
> On 5/2/26 03:48, Andrii Nakryiko wrote:
> > On Mon, Feb 2, 2026 at 6:42 AM Leon Hwang <leon.hwang@linux.dev> wrote:
> >>
> >> BPF_PROG_LOAD can now provide log parameters through both union bpf_attr
> >> and struct bpf_common_attr. Define clear conflict and precedence rules:
> >>
> >> - if both are provided and log_buf/log_size/log_level match, use them;
> >> - if only one side provides a log buffer, use that one;
> >> - if both provide log buffers but differ, return -EINVAL.
> >>
> >> Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
> >> ---
> >> include/linux/bpf_verifier.h | 3 ++-
> >> kernel/bpf/log.c | 24 ++++++++++++++++++++++--
> >> kernel/bpf/syscall.c | 3 ++-
> >> 3 files changed, 26 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
> >> index c805b85b6f7a..0d106fddbbc5 100644
> >> --- a/include/linux/bpf_verifier.h
> >> +++ b/include/linux/bpf_verifier.h
> >> @@ -638,7 +638,8 @@ struct bpf_log_attr {
> >> };
> >>
> >> int bpf_prog_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *attr,
> >> - bpfptr_t uattr, u32 size);
> >> + bpfptr_t uattr, u32 size, struct bpf_common_attr *attr_common,
> >> + bpfptr_t uattr_common, u32 size_common);
> >> int bpf_log_attr_finalize(struct bpf_log_attr *attr, struct bpf_verifier_log *log);
> >>
> >> #define BPF_MAX_SUBPROGS 256
> >> diff --git a/kernel/bpf/log.c b/kernel/bpf/log.c
> >> index ff579fcba36f..345005ba98dd 100644
> >> --- a/kernel/bpf/log.c
> >> +++ b/kernel/bpf/log.c
> >> @@ -873,10 +873,30 @@ static void bpf_log_attr_init(struct bpf_log_attr *attr_log, int offsetof_true_s
> >> attr_log->uattr = uattr;
> >> }
> >>
> >> +static bool bpf_log_attrs_diff(struct bpf_common_attr *common, u64 log_buf, u32 log_size,
> >> + u32 log_level)
> >> +{
> >> + return log_buf && common->log_buf && (log_buf != common->log_buf ||
> >> + log_size != common->log_size ||
> >> + log_level != common->log_level);
> >
> > let's validate (unless we do this somewhere else) that if log_buf is
> > set, then log_size and log_level (? not sure, maybe zero is fine) are
> > set, or all three are not set. Same for common->log* fields...
> >
>
> Ack.
>
> Will validate 'log_buf && log_size && log_level' first.
>
> >
> >> +}
> >> +
> >> int bpf_prog_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *attr,
> >> - bpfptr_t uattr, u32 size)
> >> + bpfptr_t uattr, u32 size, struct bpf_common_attr *attr_common,
> >> + bpfptr_t uattr_common, u32 size_common)
> >> {
> >> - bpf_log_attr_init(attr_log, offsetof(union bpf_attr, log_true_size), uattr, size);
> >> + if (bpf_log_attrs_diff(attr_common, attr->log_buf, attr->log_size, attr->log_level))
> >> + return -EINVAL;
> >> +
> >> + if (!attr->log_buf && attr_common->log_buf) {
> >> + attr->log_buf = attr_common->log_buf;
> >> + attr->log_size = attr_common->log_size;
> >> + attr->log_level = attr_common->log_level;
> >
> > why are we setting this? Do we still have code that can access
> > attr->log_buf even though we pass attr_log everywhere? If yes, should
> > we still have that "split brain" code?
> >
>
> 'attr->log_buf' is accessed only in bpf_check().
bpf_check should be changed then, see below
>
> > If we don't have this assignment, then I think we don't need to have
> > bpf_prog_load-specific and btf_load-specific log_attr_init() helpers.
> > They can be unified into generic log_attr_init, where for
> > bpf_prog_load you'll pass offsetof(log_true_size) +
> > attr->log_{buf,size,level}, and for btf_load you'll pass different
> > offset of and btf-specific attr->btf_log*
> >
> > This helper will just be making decision whether to use common_attr's
> > log fields or passed directly command-specific ones.
> >
> > Or what am I missing?
> >
>
> If the log attributes differ, where should the effective
> log_* values be stored?
>
> Should they live in struct bpf_common_attr, or should we extend
> struct bpf_log_attr to carry them?
>
> Note that in v8, Alexei suggested struct bpf_log_attr only needs
> u32 offsetof_true_size;
> bpfptr_t uattr;
>
> so I’d like to clarify the intended direction here. Once that’s clear, a
> single generic log_attr_init() should be sufficient to handle this.
>
The intended direction is to have log buf/size/level in one place
(after attr and common_attr validations), so we keep internal logic
simple. Let's put all of that and log_true_size **pointer** (we don't
have to much with offsetof, just calculate user addr for
log_true_size, which just might be NULL) into bpf_log_attrs and teach
all code to look and work *only* with that struct, ignoring anything
log related from attr.
> Thanks,
> Leon
>
> >
> >> + bpf_log_attr_init(attr_log, offsetof(struct bpf_common_attr, log_true_size),
> >> + uattr_common, size_common);
> >> + } else {
> >> + bpf_log_attr_init(attr_log, offsetof(union bpf_attr, log_true_size), uattr, size);
> >> + }
> >> return 0;
> >> }
> >>
> >> diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
> >> index e81199361241..7125ea445c6c 100644
> >> --- a/kernel/bpf/syscall.c
> >> +++ b/kernel/bpf/syscall.c
> >> @@ -6232,7 +6232,8 @@ static int __sys_bpf(enum bpf_cmd cmd, bpfptr_t uattr, unsigned int size,
> >> err = map_freeze(&attr);
> >> break;
> >> case BPF_PROG_LOAD:
> >> - err = bpf_prog_load_log_attr_init(&attr_log, &attr, uattr, size);
> >> + err = bpf_prog_load_log_attr_init(&attr_log, &attr, uattr, size, &attr_common,
> >> + uattr_common, size_common);
> >> err = err ?: bpf_prog_load(&attr, uattr, &attr_log);
> >> break;
> >> case BPF_OBJ_PIN:
> >> --
> >> 2.52.0
> >>
>
^ permalink raw reply
* Re: [RFC v1] man/man2/close.2: CAVEATS: Document divergence from POSIX.1-2024
From: Jan Kara @ 2026-02-05 9:34 UTC (permalink / raw)
To: Zack Weinberg
Cc: Jeff Layton, Trevor Gross, Jan Kara, The 8472, Rich Felker,
Alejandro Colomar, Vincent Lefevre, Alexander Viro,
Christian Brauner, linux-fsdevel, linux-api, GNU libc development
In-Reply-To: <037a7546-cbbf-4c00-bebd-57cee38785e1@app.fastmail.com>
I've noticed we didn't reply to one question here:
On Wed 28-01-26 11:58:07, Zack Weinberg wrote:
> On Mon, Jan 26, 2026, at 7:49 PM, Jeff Layton wrote:
> > Checking the implementations e.g. FUSE and NFS *will* return delayed
> > writeback errors on *first* descriptor close even if there are other
> > still open descriptors for the description AFAICS.
> ...
> > fsync(2) must make sure data is persistently stored and return error if
> > it was not. Thus as a VFS person I'd consider it a filesystem bug if an
> > error preveting reading data later was not returned from fsync(2). OTOH
> > that doesn't necessarily mean that later close doesn't return an error -
> > e.g. FUSE does communicate with the server on close that can fail and
> > error can be returned.
> >
> > With this in mind let me now try to answer your remaining questions:
> >
> >> >> - The OFD was opened with O_RDONLY
> >
> > If the filesystem supports atime, close can in principle report that atime
> > update failed.
> >
> >> >> - The OFD was opened with O_RDWR but has never actually
> >> >> been written to
> >
> > The same as above but with inode mtime updates.
> >
> >> >> - No data has been written to the OFD since the last call to
> >> >> fsync() for that OFD
> >
> > No writeback errors should happen in this case. As I wrote above I'd
> > consider this a filesystem bug.
> >
> >> >>
> >> >> - No data has been written to the OFD since the last call to
> >> >> fdatasync() for that OFD
> >
> > Errors can happen because some inode metadata (in practice probably only
> > inode time stamps) may still need to be written out.
> >
> > So in the cases described above (except for fsync()) you may get delayed
> > errors on close. But since in all those cases no data is lost, I don't
> > think 99.9% of applications care at all...
>
> ... regrettably I think this does mean the close(3) manpage still needs
> to tell people to watch out for errors, and should probably say that
> errors _can_ happen even if the file wasn’t written to, but are much
> less likely to be important in that case.
>
> And my “how to close stdout in a thread-safe manner” sample code is
> wrong, because I was wrong to think that the error reporting only
> happened on the _final_ close, when the OFD is destroyed.
>
> ... What happens if the close is implicit in a dup2() operation? Here’s
> that erroneous “how to close stdout” fragment, with comments
> indicating what I thought could and could not fail at the time I wrote
> it:
>
> // These allocate new fds, which can always fail, e.g. because
> // the program already has too many files open.
> int new_stdout = open("/dev/null", O_WRONLY);
> if (new_stdout == -1) perror_exit("/dev/null");
> int old_stdout = dup(1);
> if (old_stdout == -1) perror_exit("dup(1)");
>
> flockfile(stdout);
> if (fflush(stdout)) perror_exit("stdout: write error");
> dup2(new_stdout, 1); // cannot fail, atomically replaces fd 1
> funlockfile(stdout);
>
> // this close may receive delayed write errors from previous writes
> // to stdout
> if (close(old_stdout)) perror_exit("stdout: write error");
>
> // this close cannot fail, because it only drops an alternative
> // reference to the open file description now installed as fd 1
> close(new_stdout);
>
> Note in particular that the first close _operation_ on fd 1 is in
> consequence of dup2(new_stdout, 1). The dup2() manpage specifically
> says “the close is performed silently (i.e. any errors during the
> close are not reported by dup()” but, if stdout points to a file on
> an NFS mount, are those errors _lost_, or will they actually be
> reported by the subsequent close(old_stdout)?
It is simply lost (the error is propagated from the filesystem to VFS which
just ignores it).
> Incidentally, the dup2() manpage has a very similar example in its
> NOTES section, also presuming that close only reports errors on the
> _final_ close, not when it “merely” drops reference >=2 to an OFD.
>
> (I’m starting to think we need dup3(old, new, O_SWAP_FDS). Or is that
> already a thing somehow?)
I don't think a functionality like this currently exists.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply
* Re: [PATCH bpf-next v9 9/9] selftests/bpf: Add tests to verify map create failure log
From: Leon Hwang @ 2026-02-05 3:53 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Willem de Bruijn, Jason Xing, Tao Chen,
Mykyta Yatsenko, Kumar Kartikeya Dwivedi, Anton Protopopov,
Amery Hung, Rong Tao, LKML, Linux API,
open list:KERNEL SELFTEST FRAMEWORK, kernel-patches-bot
In-Reply-To: <CAADnVQLXWQ8Miq2WBoXRDsEVP1QPwk=a5=Rj_uPN+9qKHZZmZw@mail.gmail.com>
On 5/2/26 04:14, Alexei Starovoitov wrote:
> On Mon, Feb 2, 2026 at 6:43 AM Leon Hwang <leon.hwang@linux.dev> wrote:
>>
>> +
>> +#define BPF_LOG_FIXED 8
>> +
>> +static void test_map_create(enum bpf_map_type map_type, const char *map_name,
>> + struct bpf_map_create_opts *opts, const char *exp_msg)
>> +{
>> + const int key_size = 4, value_size = 4, max_entries = 1;
>> + char log_buf[128];
>> + int fd;
>> + LIBBPF_OPTS(bpf_log_opts, log_opts);
>> +
>> + log_buf[0] = '\0';
>> + log_opts.log_buf = log_buf;
>> + log_opts.log_size = sizeof(log_buf);
>> + log_opts.log_level = BPF_LOG_FIXED;
>
> Why? Which part of the test needs the log with this flag?
BPF_LOG_FIXED looks odd here.
This test sets 'log_level = BPF_LOG_FIXED' to match the behavior of
bpf_vlog_init() as initialized by bpf_log_attr_create_vlog() in
patch #7. BPF_LOG_FIXED is intended to be the default log_level
there.
Thanks,
Leon
^ permalink raw reply
* Re: [PATCH bpf-next v9 8/9] libbpf: Add syscall common attributes support for map_create
From: Leon Hwang @ 2026-02-05 3:45 UTC (permalink / raw)
To: Andrii Nakryiko
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Willem de Bruijn, Jason Xing, Tao Chen,
Mykyta Yatsenko, Kumar Kartikeya Dwivedi, Anton Protopopov,
Amery Hung, Rong Tao, linux-kernel, linux-api, linux-kselftest,
kernel-patches-bot
In-Reply-To: <CAEf4Bzb=96Ja38VGBr9YGGSSjaWwhkfH_oWjMJULykA-a7jZxA@mail.gmail.com>
On 5/2/26 03:48, Andrii Nakryiko wrote:
> On Mon, Feb 2, 2026 at 6:43 AM Leon Hwang <leon.hwang@linux.dev> wrote:
>>
>> With the previous commit adding common attribute support for
>> BPF_MAP_CREATE, users can now retrieve detailed error messages when map
>> creation fails via the log_buf field.
>>
>> Introduce struct bpf_log_opts with the following fields:
>> log_buf, log_size, log_level, and log_true_size.
>>
>> Extend bpf_map_create_opts with a new field log_opts, allowing users to
>> capture and inspect log messages on map creation failures.
>>
>> Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
>> ---
>> tools/lib/bpf/bpf.c | 16 +++++++++++++++-
>> tools/lib/bpf/bpf.h | 17 ++++++++++++++++-
>> 2 files changed, 31 insertions(+), 2 deletions(-)
>>
>
> LGTM
>
> Acked-by: Andrii Nakryiko <andrii@kernel.org>
>
Thanks for your review.
>> diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
>> index 9d8740761b7a..0c3e40844d80 100644
>> --- a/tools/lib/bpf/bpf.c
>> +++ b/tools/lib/bpf/bpf.c
>> @@ -209,6 +209,9 @@ int bpf_map_create(enum bpf_map_type map_type,
>> const struct bpf_map_create_opts *opts)
>> {
>> const size_t attr_sz = offsetofend(union bpf_attr, excl_prog_hash_size);
>> + const size_t attr_common_sz = sizeof(struct bpf_common_attr);
>> + struct bpf_common_attr attr_common;
>> + struct bpf_log_opts *log_opts;
>> union bpf_attr attr;
>> int fd;
>>
>> @@ -242,7 +245,18 @@ int bpf_map_create(enum bpf_map_type map_type,
>> attr.excl_prog_hash = ptr_to_u64(OPTS_GET(opts, excl_prog_hash, NULL));
>> attr.excl_prog_hash_size = OPTS_GET(opts, excl_prog_hash_size, 0);
>>
>> - fd = sys_bpf_fd(BPF_MAP_CREATE, &attr, attr_sz);
>> + log_opts = OPTS_GET(opts, log_opts, NULL);
>> + if (log_opts && feat_supported(NULL, FEAT_BPF_SYSCALL_COMMON_ATTRS)) {
>> + memset(&attr_common, 0, attr_common_sz);
>> + attr_common.log_buf = ptr_to_u64(OPTS_GET(log_opts, log_buf, NULL));
>> + attr_common.log_size = OPTS_GET(log_opts, log_size, 0);
>> + attr_common.log_level = OPTS_GET(log_opts, log_level, 0);
>> + fd = sys_bpf_ext_fd(BPF_MAP_CREATE, &attr, attr_sz, &attr_common, attr_common_sz);
>> + OPTS_SET(log_opts, log_true_size, attr_common.log_true_size);
>> + } else {
>> + fd = sys_bpf_fd(BPF_MAP_CREATE, &attr, attr_sz);
>> + OPTS_SET(log_opts, log_true_size, 0);
>> + }
>> return libbpf_err_errno(fd);
>> }
>>
>> diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h
>> index 2c8e88ddb674..59673f094f86 100644
>> --- a/tools/lib/bpf/bpf.h
>> +++ b/tools/lib/bpf/bpf.h
>> @@ -37,6 +37,18 @@ extern "C" {
>>
>> LIBBPF_API int libbpf_set_memlock_rlim(size_t memlock_bytes);
>>
>> +struct bpf_log_opts {
>> + size_t sz; /* size of this struct for forward/backward compatibility */
>> +
>> + char *log_buf;
>> + __u32 log_size;
>> + __u32 log_level;
>> + __u32 log_true_size;
>
> please mention in the comment here that this is an out parameter set
> by the kernel
>
Ack.
I'll add a comment in the next revision.
Thanks,
Leon
>> +
>> + size_t :0;
>> +};
>> +#define bpf_log_opts__last_field log_true_size
>> +
>> struct bpf_map_create_opts {
>> size_t sz; /* size of this struct for forward/backward compatibility */
>>
>> @@ -57,9 +69,12 @@ struct bpf_map_create_opts {
>>
>> const void *excl_prog_hash;
>> __u32 excl_prog_hash_size;
>> +
>> + struct bpf_log_opts *log_opts;
>> +
>> size_t :0;
>> };
>> -#define bpf_map_create_opts__last_field excl_prog_hash_size
>> +#define bpf_map_create_opts__last_field log_opts
>>
>> LIBBPF_API int bpf_map_create(enum bpf_map_type map_type,
>> const char *map_name,
>> --
>> 2.52.0
>>
^ permalink raw reply
* Re: [PATCH bpf-next v9 4/9] bpf: Add syscall common attributes support for prog_load
From: Leon Hwang @ 2026-02-05 3:42 UTC (permalink / raw)
To: Andrii Nakryiko
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Willem de Bruijn, Jason Xing, Tao Chen,
Mykyta Yatsenko, Kumar Kartikeya Dwivedi, Anton Protopopov,
Amery Hung, Rong Tao, linux-kernel, linux-api, linux-kselftest,
kernel-patches-bot
In-Reply-To: <CAEf4Bza-PM9ExqJS=Q_oj7Cqc5dvmbN_Zv9-4UnJNtsZU28FoQ@mail.gmail.com>
On 5/2/26 03:48, Andrii Nakryiko wrote:
> On Mon, Feb 2, 2026 at 6:42 AM Leon Hwang <leon.hwang@linux.dev> wrote:
>>
>> BPF_PROG_LOAD can now provide log parameters through both union bpf_attr
>> and struct bpf_common_attr. Define clear conflict and precedence rules:
>>
>> - if both are provided and log_buf/log_size/log_level match, use them;
>> - if only one side provides a log buffer, use that one;
>> - if both provide log buffers but differ, return -EINVAL.
>>
>> Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
>> ---
>> include/linux/bpf_verifier.h | 3 ++-
>> kernel/bpf/log.c | 24 ++++++++++++++++++++++--
>> kernel/bpf/syscall.c | 3 ++-
>> 3 files changed, 26 insertions(+), 4 deletions(-)
>>
>> diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
>> index c805b85b6f7a..0d106fddbbc5 100644
>> --- a/include/linux/bpf_verifier.h
>> +++ b/include/linux/bpf_verifier.h
>> @@ -638,7 +638,8 @@ struct bpf_log_attr {
>> };
>>
>> int bpf_prog_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *attr,
>> - bpfptr_t uattr, u32 size);
>> + bpfptr_t uattr, u32 size, struct bpf_common_attr *attr_common,
>> + bpfptr_t uattr_common, u32 size_common);
>> int bpf_log_attr_finalize(struct bpf_log_attr *attr, struct bpf_verifier_log *log);
>>
>> #define BPF_MAX_SUBPROGS 256
>> diff --git a/kernel/bpf/log.c b/kernel/bpf/log.c
>> index ff579fcba36f..345005ba98dd 100644
>> --- a/kernel/bpf/log.c
>> +++ b/kernel/bpf/log.c
>> @@ -873,10 +873,30 @@ static void bpf_log_attr_init(struct bpf_log_attr *attr_log, int offsetof_true_s
>> attr_log->uattr = uattr;
>> }
>>
>> +static bool bpf_log_attrs_diff(struct bpf_common_attr *common, u64 log_buf, u32 log_size,
>> + u32 log_level)
>> +{
>> + return log_buf && common->log_buf && (log_buf != common->log_buf ||
>> + log_size != common->log_size ||
>> + log_level != common->log_level);
>
> let's validate (unless we do this somewhere else) that if log_buf is
> set, then log_size and log_level (? not sure, maybe zero is fine) are
> set, or all three are not set. Same for common->log* fields...
>
Ack.
Will validate 'log_buf && log_size && log_level' first.
>
>> +}
>> +
>> int bpf_prog_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *attr,
>> - bpfptr_t uattr, u32 size)
>> + bpfptr_t uattr, u32 size, struct bpf_common_attr *attr_common,
>> + bpfptr_t uattr_common, u32 size_common)
>> {
>> - bpf_log_attr_init(attr_log, offsetof(union bpf_attr, log_true_size), uattr, size);
>> + if (bpf_log_attrs_diff(attr_common, attr->log_buf, attr->log_size, attr->log_level))
>> + return -EINVAL;
>> +
>> + if (!attr->log_buf && attr_common->log_buf) {
>> + attr->log_buf = attr_common->log_buf;
>> + attr->log_size = attr_common->log_size;
>> + attr->log_level = attr_common->log_level;
>
> why are we setting this? Do we still have code that can access
> attr->log_buf even though we pass attr_log everywhere? If yes, should
> we still have that "split brain" code?
>
'attr->log_buf' is accessed only in bpf_check().
> If we don't have this assignment, then I think we don't need to have
> bpf_prog_load-specific and btf_load-specific log_attr_init() helpers.
> They can be unified into generic log_attr_init, where for
> bpf_prog_load you'll pass offsetof(log_true_size) +
> attr->log_{buf,size,level}, and for btf_load you'll pass different
> offset of and btf-specific attr->btf_log*
>
> This helper will just be making decision whether to use common_attr's
> log fields or passed directly command-specific ones.
>
> Or what am I missing?
>
If the log attributes differ, where should the effective
log_* values be stored?
Should they live in struct bpf_common_attr, or should we extend
struct bpf_log_attr to carry them?
Note that in v8, Alexei suggested struct bpf_log_attr only needs
u32 offsetof_true_size;
bpfptr_t uattr;
so I’d like to clarify the intended direction here. Once that’s clear, a
single generic log_attr_init() should be sufficient to handle this.
Thanks,
Leon
>
>> + bpf_log_attr_init(attr_log, offsetof(struct bpf_common_attr, log_true_size),
>> + uattr_common, size_common);
>> + } else {
>> + bpf_log_attr_init(attr_log, offsetof(union bpf_attr, log_true_size), uattr, size);
>> + }
>> return 0;
>> }
>>
>> diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
>> index e81199361241..7125ea445c6c 100644
>> --- a/kernel/bpf/syscall.c
>> +++ b/kernel/bpf/syscall.c
>> @@ -6232,7 +6232,8 @@ static int __sys_bpf(enum bpf_cmd cmd, bpfptr_t uattr, unsigned int size,
>> err = map_freeze(&attr);
>> break;
>> case BPF_PROG_LOAD:
>> - err = bpf_prog_load_log_attr_init(&attr_log, &attr, uattr, size);
>> + err = bpf_prog_load_log_attr_init(&attr_log, &attr, uattr, size, &attr_common,
>> + uattr_common, size_common);
>> err = err ?: bpf_prog_load(&attr, uattr, &attr_log);
>> break;
>> case BPF_OBJ_PIN:
>> --
>> 2.52.0
>>
^ permalink raw reply
* Re: [PATCH bpf-next v9 3/9] bpf: Refactor reporting log_true_size for prog_load
From: Leon Hwang @ 2026-02-05 2:20 UTC (permalink / raw)
To: Andrii Nakryiko
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Willem de Bruijn, Jason Xing, Tao Chen,
Mykyta Yatsenko, Kumar Kartikeya Dwivedi, Anton Protopopov,
Amery Hung, Rong Tao, linux-kernel, linux-api, linux-kselftest,
kernel-patches-bot
In-Reply-To: <CAEf4Bza+n2-tq0cGvAit23OduWbqO6teF211iPnOfp0s_ZwEPw@mail.gmail.com>
On 5/2/26 03:48, Andrii Nakryiko wrote:
> On Mon, Feb 2, 2026 at 6:42 AM Leon Hwang <leon.hwang@linux.dev> wrote:
>>
>> The next commit will add support for reporting logs via extended common
>> attributes, including 'log_true_size'.
>>
>> To prepare for that, refactor the 'log_true_size' reporting logic by
>> introducing a new struct bpf_log_attr to encapsulate log-related behavior:
>>
>> * bpf_prog_load_log_attr_init(): initialize the log fields, which will
>> support extended common attributes in the next commit.
>> * bpf_log_attr_finalize(): handle log finalization and write back
>> 'log_true_size' to userspace.
>>
>> Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
>> ---
>> include/linux/bpf.h | 4 +++-
>> include/linux/bpf_verifier.h | 10 ++++++++++
>> kernel/bpf/log.c | 35 +++++++++++++++++++++++++++++++++++
>> kernel/bpf/syscall.c | 8 +++++---
>> kernel/bpf/verifier.c | 13 +++----------
>> 5 files changed, 56 insertions(+), 14 deletions(-)
>>
>> diff --git a/include/linux/bpf.h b/include/linux/bpf.h
>> index cd9b96434904..d4dbcc7ad156 100644
>> --- a/include/linux/bpf.h
>> +++ b/include/linux/bpf.h
>> @@ -2913,7 +2913,9 @@ int bpf_check_uarg_tail_zero(bpfptr_t uaddr, size_t expected_size,
>> size_t actual_size);
>>
>> /* verify correctness of eBPF program */
>> -int bpf_check(struct bpf_prog **fp, union bpf_attr *attr, bpfptr_t uattr, u32 uattr_size);
>> +struct bpf_log_attr;
>> +int bpf_check(struct bpf_prog **fp, union bpf_attr *attr, bpfptr_t uattr,
>> + struct bpf_log_attr *attr_log);
>>
>> #ifndef CONFIG_BPF_JIT_ALWAYS_ON
>> void bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth);
>> diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
>> index 8355b585cd18..c805b85b6f7a 100644
>> --- a/include/linux/bpf_verifier.h
>> +++ b/include/linux/bpf_verifier.h
>> @@ -631,6 +631,16 @@ static inline bool bpf_verifier_log_needed(const struct bpf_verifier_log *log)
>> return log && log->level;
>> }
>>
>> +struct bpf_log_attr {
>> + u32 offsetof_true_size;
>> + u32 uattr_size;
>> + bpfptr_t uattr;
>> +};
>> +
>> +int bpf_prog_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *attr,
>> + bpfptr_t uattr, u32 size);
>> +int bpf_log_attr_finalize(struct bpf_log_attr *attr, struct bpf_verifier_log *log);
>> +
>> #define BPF_MAX_SUBPROGS 256
>>
>> struct bpf_subprog_arg_info {
>> diff --git a/kernel/bpf/log.c b/kernel/bpf/log.c
>> index a0c3b35de2ce..ff579fcba36f 100644
>> --- a/kernel/bpf/log.c
>> +++ b/kernel/bpf/log.c
>> @@ -863,3 +863,38 @@ void print_insn_state(struct bpf_verifier_env *env, const struct bpf_verifier_st
>> }
>> print_verifier_state(env, vstate, frameno, false);
>> }
>> +
>> +static void bpf_log_attr_init(struct bpf_log_attr *attr_log, int offsetof_true_size, bpfptr_t uattr,
>> + u32 uattr_size)
>> +{
>> + memset(attr_log, 0, sizeof(*attr_log));
>> + attr_log->offsetof_true_size = offsetof_true_size;
>> + attr_log->uattr_size = uattr_size;
>> + attr_log->uattr = uattr;
>> +}
>> +
>> +int bpf_prog_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *attr,
>> + bpfptr_t uattr, u32 size)
>> +{
>> + bpf_log_attr_init(attr_log, offsetof(union bpf_attr, log_true_size), uattr, size);
>> + return 0;
>> +}
>> +
>> +int bpf_log_attr_finalize(struct bpf_log_attr *attr, struct bpf_verifier_log *log)
>> +{
>> + u32 log_true_size;
>> + size_t size;
>> + int err;
>> +
>> + if (!log)
>> + return 0;
>
> can this ever happen? why guard against this?
>
In patch #7, 'log' can be NULL when users do not provide 'log_buf'.
However, bpf_vlog_finalize() already guards against this case, so I'll
drop this check.
>> +
>> + err = bpf_vlog_finalize(log, &log_true_size);
>> +
>> + size = sizeof(log_true_size);
>> + if (attr->uattr_size >= attr->offsetof_true_size + size &&
>> + copy_to_bpfptr_offset(attr->uattr, attr->offsetof_true_size, &log_true_size, size))
>> + err = -EFAULT;
>
> minor nit: return -EFAULT;
>
Ack.
Thanks,
Leon
^ permalink raw reply
* Re: [PATCH net-next v2 0/4] net: uapi: Provide an UAPI definition of 'struct sockaddr'
From: Jakub Kicinski @ 2026-02-05 1:55 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Eric Dumazet, Kuniyuki Iwashima, Paolo Abeni, Willem de Bruijn,
David S. Miller, Simon Horman, Shuah Khan, Matthieu Baerts,
Mat Martineau, Geliang Tang, Mickaël Salaün,
Günther Noack, Alexei Starovoitov, Daniel Borkmann,
Jesper Dangaard Brouer, John Fastabend, Stanislav Fomichev,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Hao Luo, Jiri Olsa, netdev, linux-kernel,
linux-api, Arnd Bergmann, linux-kselftest, mptcp,
linux-security-module, bpf, libc-alpha, Carlos O'Donell,
Adhemerval Zanella, Rich Felker, klibc, Florian Weimer
In-Reply-To: <20260204064248-d9c4ab78-f6d4-4ac6-8d55-e939bc1df6d2@linutronix.de>
On Wed, 4 Feb 2026 06:51:46 +0100 Thomas Weißschuh wrote:
> > make -j16 O="$kobj" INSTALL_HDR_PATH="${kobj}/hdr" headers_install
> > popd
> >
> > pushd uapi
> > find . -type f -name '*.h' -exec cp -v "${kobj}/hdr/include/{}" {} \;
>
> Here only those headers which already exist in ethtool's uapi/ directory
> are copied. As linux/typelimits.h is new, it is now missing.
> Honestly, if a user fiddles with the internals of the UAPI headers like
> this, it is on them to update their code if the internal structure
> changes. In your case a simple 'touch uapi/linux/typelimits.h'
> before running the script will be enough. Also internal.h now requires
> an explicit inclusion of <limits.h>, as that is not satisfied by the
> UAPI anymore.
Hopefully you understand that while due to uapi header copy this is not
a huge issue for ethtool itself, but it is a proof that your changes
can break normal user space applications which do not vendor in uapi.
^ permalink raw reply
* Re: [PATCH bpf-next v9 9/9] selftests/bpf: Add tests to verify map create failure log
From: Alexei Starovoitov @ 2026-02-04 20:14 UTC (permalink / raw)
To: Leon Hwang
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Willem de Bruijn, Jason Xing, Tao Chen,
Mykyta Yatsenko, Kumar Kartikeya Dwivedi, Anton Protopopov,
Amery Hung, Rong Tao, LKML, Linux API,
open list:KERNEL SELFTEST FRAMEWORK, kernel-patches-bot
In-Reply-To: <20260202144046.30651-10-leon.hwang@linux.dev>
On Mon, Feb 2, 2026 at 6:43 AM Leon Hwang <leon.hwang@linux.dev> wrote:
>
> +
> +#define BPF_LOG_FIXED 8
> +
> +static void test_map_create(enum bpf_map_type map_type, const char *map_name,
> + struct bpf_map_create_opts *opts, const char *exp_msg)
> +{
> + const int key_size = 4, value_size = 4, max_entries = 1;
> + char log_buf[128];
> + int fd;
> + LIBBPF_OPTS(bpf_log_opts, log_opts);
> +
> + log_buf[0] = '\0';
> + log_opts.log_buf = log_buf;
> + log_opts.log_size = sizeof(log_buf);
> + log_opts.log_level = BPF_LOG_FIXED;
Why? Which part of the test needs the log with this flag?
^ permalink raw reply
* Re: [PATCH bpf-next v9 4/9] bpf: Add syscall common attributes support for prog_load
From: Andrii Nakryiko @ 2026-02-04 19:48 UTC (permalink / raw)
To: Leon Hwang
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Willem de Bruijn, Jason Xing, Tao Chen,
Mykyta Yatsenko, Kumar Kartikeya Dwivedi, Anton Protopopov,
Amery Hung, Rong Tao, linux-kernel, linux-api, linux-kselftest,
kernel-patches-bot
In-Reply-To: <20260202144046.30651-5-leon.hwang@linux.dev>
On Mon, Feb 2, 2026 at 6:42 AM Leon Hwang <leon.hwang@linux.dev> wrote:
>
> BPF_PROG_LOAD can now provide log parameters through both union bpf_attr
> and struct bpf_common_attr. Define clear conflict and precedence rules:
>
> - if both are provided and log_buf/log_size/log_level match, use them;
> - if only one side provides a log buffer, use that one;
> - if both provide log buffers but differ, return -EINVAL.
>
> Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
> ---
> include/linux/bpf_verifier.h | 3 ++-
> kernel/bpf/log.c | 24 ++++++++++++++++++++++--
> kernel/bpf/syscall.c | 3 ++-
> 3 files changed, 26 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
> index c805b85b6f7a..0d106fddbbc5 100644
> --- a/include/linux/bpf_verifier.h
> +++ b/include/linux/bpf_verifier.h
> @@ -638,7 +638,8 @@ struct bpf_log_attr {
> };
>
> int bpf_prog_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *attr,
> - bpfptr_t uattr, u32 size);
> + bpfptr_t uattr, u32 size, struct bpf_common_attr *attr_common,
> + bpfptr_t uattr_common, u32 size_common);
> int bpf_log_attr_finalize(struct bpf_log_attr *attr, struct bpf_verifier_log *log);
>
> #define BPF_MAX_SUBPROGS 256
> diff --git a/kernel/bpf/log.c b/kernel/bpf/log.c
> index ff579fcba36f..345005ba98dd 100644
> --- a/kernel/bpf/log.c
> +++ b/kernel/bpf/log.c
> @@ -873,10 +873,30 @@ static void bpf_log_attr_init(struct bpf_log_attr *attr_log, int offsetof_true_s
> attr_log->uattr = uattr;
> }
>
> +static bool bpf_log_attrs_diff(struct bpf_common_attr *common, u64 log_buf, u32 log_size,
> + u32 log_level)
> +{
> + return log_buf && common->log_buf && (log_buf != common->log_buf ||
> + log_size != common->log_size ||
> + log_level != common->log_level);
let's validate (unless we do this somewhere else) that if log_buf is
set, then log_size and log_level (? not sure, maybe zero is fine) are
set, or all three are not set. Same for common->log* fields...
> +}
> +
> int bpf_prog_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *attr,
> - bpfptr_t uattr, u32 size)
> + bpfptr_t uattr, u32 size, struct bpf_common_attr *attr_common,
> + bpfptr_t uattr_common, u32 size_common)
> {
> - bpf_log_attr_init(attr_log, offsetof(union bpf_attr, log_true_size), uattr, size);
> + if (bpf_log_attrs_diff(attr_common, attr->log_buf, attr->log_size, attr->log_level))
> + return -EINVAL;
> +
> + if (!attr->log_buf && attr_common->log_buf) {
> + attr->log_buf = attr_common->log_buf;
> + attr->log_size = attr_common->log_size;
> + attr->log_level = attr_common->log_level;
why are we setting this? Do we still have code that can access
attr->log_buf even though we pass attr_log everywhere? If yes, should
we still have that "split brain" code?
If we don't have this assignment, then I think we don't need to have
bpf_prog_load-specific and btf_load-specific log_attr_init() helpers.
They can be unified into generic log_attr_init, where for
bpf_prog_load you'll pass offsetof(log_true_size) +
attr->log_{buf,size,level}, and for btf_load you'll pass different
offset of and btf-specific attr->btf_log*
This helper will just be making decision whether to use common_attr's
log fields or passed directly command-specific ones.
Or what am I missing?
> + bpf_log_attr_init(attr_log, offsetof(struct bpf_common_attr, log_true_size),
> + uattr_common, size_common);
> + } else {
> + bpf_log_attr_init(attr_log, offsetof(union bpf_attr, log_true_size), uattr, size);
> + }
> return 0;
> }
>
> diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
> index e81199361241..7125ea445c6c 100644
> --- a/kernel/bpf/syscall.c
> +++ b/kernel/bpf/syscall.c
> @@ -6232,7 +6232,8 @@ static int __sys_bpf(enum bpf_cmd cmd, bpfptr_t uattr, unsigned int size,
> err = map_freeze(&attr);
> break;
> case BPF_PROG_LOAD:
> - err = bpf_prog_load_log_attr_init(&attr_log, &attr, uattr, size);
> + err = bpf_prog_load_log_attr_init(&attr_log, &attr, uattr, size, &attr_common,
> + uattr_common, size_common);
> err = err ?: bpf_prog_load(&attr, uattr, &attr_log);
> break;
> case BPF_OBJ_PIN:
> --
> 2.52.0
>
^ permalink raw reply
* Re: [PATCH bpf-next v9 3/9] bpf: Refactor reporting log_true_size for prog_load
From: Andrii Nakryiko @ 2026-02-04 19:48 UTC (permalink / raw)
To: Leon Hwang
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Willem de Bruijn, Jason Xing, Tao Chen,
Mykyta Yatsenko, Kumar Kartikeya Dwivedi, Anton Protopopov,
Amery Hung, Rong Tao, linux-kernel, linux-api, linux-kselftest,
kernel-patches-bot
In-Reply-To: <20260202144046.30651-4-leon.hwang@linux.dev>
On Mon, Feb 2, 2026 at 6:42 AM Leon Hwang <leon.hwang@linux.dev> wrote:
>
> The next commit will add support for reporting logs via extended common
> attributes, including 'log_true_size'.
>
> To prepare for that, refactor the 'log_true_size' reporting logic by
> introducing a new struct bpf_log_attr to encapsulate log-related behavior:
>
> * bpf_prog_load_log_attr_init(): initialize the log fields, which will
> support extended common attributes in the next commit.
> * bpf_log_attr_finalize(): handle log finalization and write back
> 'log_true_size' to userspace.
>
> Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
> ---
> include/linux/bpf.h | 4 +++-
> include/linux/bpf_verifier.h | 10 ++++++++++
> kernel/bpf/log.c | 35 +++++++++++++++++++++++++++++++++++
> kernel/bpf/syscall.c | 8 +++++---
> kernel/bpf/verifier.c | 13 +++----------
> 5 files changed, 56 insertions(+), 14 deletions(-)
>
> diff --git a/include/linux/bpf.h b/include/linux/bpf.h
> index cd9b96434904..d4dbcc7ad156 100644
> --- a/include/linux/bpf.h
> +++ b/include/linux/bpf.h
> @@ -2913,7 +2913,9 @@ int bpf_check_uarg_tail_zero(bpfptr_t uaddr, size_t expected_size,
> size_t actual_size);
>
> /* verify correctness of eBPF program */
> -int bpf_check(struct bpf_prog **fp, union bpf_attr *attr, bpfptr_t uattr, u32 uattr_size);
> +struct bpf_log_attr;
> +int bpf_check(struct bpf_prog **fp, union bpf_attr *attr, bpfptr_t uattr,
> + struct bpf_log_attr *attr_log);
>
> #ifndef CONFIG_BPF_JIT_ALWAYS_ON
> void bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth);
> diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
> index 8355b585cd18..c805b85b6f7a 100644
> --- a/include/linux/bpf_verifier.h
> +++ b/include/linux/bpf_verifier.h
> @@ -631,6 +631,16 @@ static inline bool bpf_verifier_log_needed(const struct bpf_verifier_log *log)
> return log && log->level;
> }
>
> +struct bpf_log_attr {
> + u32 offsetof_true_size;
> + u32 uattr_size;
> + bpfptr_t uattr;
> +};
> +
> +int bpf_prog_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *attr,
> + bpfptr_t uattr, u32 size);
> +int bpf_log_attr_finalize(struct bpf_log_attr *attr, struct bpf_verifier_log *log);
> +
> #define BPF_MAX_SUBPROGS 256
>
> struct bpf_subprog_arg_info {
> diff --git a/kernel/bpf/log.c b/kernel/bpf/log.c
> index a0c3b35de2ce..ff579fcba36f 100644
> --- a/kernel/bpf/log.c
> +++ b/kernel/bpf/log.c
> @@ -863,3 +863,38 @@ void print_insn_state(struct bpf_verifier_env *env, const struct bpf_verifier_st
> }
> print_verifier_state(env, vstate, frameno, false);
> }
> +
> +static void bpf_log_attr_init(struct bpf_log_attr *attr_log, int offsetof_true_size, bpfptr_t uattr,
> + u32 uattr_size)
> +{
> + memset(attr_log, 0, sizeof(*attr_log));
> + attr_log->offsetof_true_size = offsetof_true_size;
> + attr_log->uattr_size = uattr_size;
> + attr_log->uattr = uattr;
> +}
> +
> +int bpf_prog_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *attr,
> + bpfptr_t uattr, u32 size)
> +{
> + bpf_log_attr_init(attr_log, offsetof(union bpf_attr, log_true_size), uattr, size);
> + return 0;
> +}
> +
> +int bpf_log_attr_finalize(struct bpf_log_attr *attr, struct bpf_verifier_log *log)
> +{
> + u32 log_true_size;
> + size_t size;
> + int err;
> +
> + if (!log)
> + return 0;
can this ever happen? why guard against this?
> +
> + err = bpf_vlog_finalize(log, &log_true_size);
> +
> + size = sizeof(log_true_size);
> + if (attr->uattr_size >= attr->offsetof_true_size + size &&
> + copy_to_bpfptr_offset(attr->uattr, attr->offsetof_true_size, &log_true_size, size))
> + err = -EFAULT;
minor nit: return -EFAULT;
> +
> + return err;
> +}
[...]
^ permalink raw reply
* Re: [PATCH bpf-next v9 2/9] libbpf: Add support for extended bpf syscall
From: Andrii Nakryiko @ 2026-02-04 19:48 UTC (permalink / raw)
To: Leon Hwang
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Willem de Bruijn, Jason Xing, Tao Chen,
Mykyta Yatsenko, Kumar Kartikeya Dwivedi, Anton Protopopov,
Amery Hung, Rong Tao, linux-kernel, linux-api, linux-kselftest,
kernel-patches-bot
In-Reply-To: <20260202144046.30651-3-leon.hwang@linux.dev>
On Mon, Feb 2, 2026 at 6:41 AM Leon Hwang <leon.hwang@linux.dev> wrote:
>
> To support the extended BPF syscall introduced in the previous commit,
> introduce the following internal APIs:
>
> * 'sys_bpf_ext()'
> * 'sys_bpf_ext_fd()'
> They wrap the raw 'syscall()' interface to support passing extended
> attributes.
> * 'probe_sys_bpf_ext()'
> Check whether current kernel supports the BPF syscall common attributes.
>
> Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
> ---
> tools/lib/bpf/bpf.c | 36 +++++++++++++++++++++++++++++++++
> tools/lib/bpf/features.c | 8 ++++++++
> tools/lib/bpf/libbpf_internal.h | 3 +++
> 3 files changed, 47 insertions(+)
>
LGTM
Acked-by: Andrii Nakryiko <andrii@kernel.org>
[...]
^ permalink raw reply
* Re: [PATCH bpf-next v9 8/9] libbpf: Add syscall common attributes support for map_create
From: Andrii Nakryiko @ 2026-02-04 19:48 UTC (permalink / raw)
To: Leon Hwang
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Willem de Bruijn, Jason Xing, Tao Chen,
Mykyta Yatsenko, Kumar Kartikeya Dwivedi, Anton Protopopov,
Amery Hung, Rong Tao, linux-kernel, linux-api, linux-kselftest,
kernel-patches-bot
In-Reply-To: <20260202144046.30651-9-leon.hwang@linux.dev>
On Mon, Feb 2, 2026 at 6:43 AM Leon Hwang <leon.hwang@linux.dev> wrote:
>
> With the previous commit adding common attribute support for
> BPF_MAP_CREATE, users can now retrieve detailed error messages when map
> creation fails via the log_buf field.
>
> Introduce struct bpf_log_opts with the following fields:
> log_buf, log_size, log_level, and log_true_size.
>
> Extend bpf_map_create_opts with a new field log_opts, allowing users to
> capture and inspect log messages on map creation failures.
>
> Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
> ---
> tools/lib/bpf/bpf.c | 16 +++++++++++++++-
> tools/lib/bpf/bpf.h | 17 ++++++++++++++++-
> 2 files changed, 31 insertions(+), 2 deletions(-)
>
LGTM
Acked-by: Andrii Nakryiko <andrii@kernel.org>
> diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
> index 9d8740761b7a..0c3e40844d80 100644
> --- a/tools/lib/bpf/bpf.c
> +++ b/tools/lib/bpf/bpf.c
> @@ -209,6 +209,9 @@ int bpf_map_create(enum bpf_map_type map_type,
> const struct bpf_map_create_opts *opts)
> {
> const size_t attr_sz = offsetofend(union bpf_attr, excl_prog_hash_size);
> + const size_t attr_common_sz = sizeof(struct bpf_common_attr);
> + struct bpf_common_attr attr_common;
> + struct bpf_log_opts *log_opts;
> union bpf_attr attr;
> int fd;
>
> @@ -242,7 +245,18 @@ int bpf_map_create(enum bpf_map_type map_type,
> attr.excl_prog_hash = ptr_to_u64(OPTS_GET(opts, excl_prog_hash, NULL));
> attr.excl_prog_hash_size = OPTS_GET(opts, excl_prog_hash_size, 0);
>
> - fd = sys_bpf_fd(BPF_MAP_CREATE, &attr, attr_sz);
> + log_opts = OPTS_GET(opts, log_opts, NULL);
> + if (log_opts && feat_supported(NULL, FEAT_BPF_SYSCALL_COMMON_ATTRS)) {
> + memset(&attr_common, 0, attr_common_sz);
> + attr_common.log_buf = ptr_to_u64(OPTS_GET(log_opts, log_buf, NULL));
> + attr_common.log_size = OPTS_GET(log_opts, log_size, 0);
> + attr_common.log_level = OPTS_GET(log_opts, log_level, 0);
> + fd = sys_bpf_ext_fd(BPF_MAP_CREATE, &attr, attr_sz, &attr_common, attr_common_sz);
> + OPTS_SET(log_opts, log_true_size, attr_common.log_true_size);
> + } else {
> + fd = sys_bpf_fd(BPF_MAP_CREATE, &attr, attr_sz);
> + OPTS_SET(log_opts, log_true_size, 0);
> + }
> return libbpf_err_errno(fd);
> }
>
> diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h
> index 2c8e88ddb674..59673f094f86 100644
> --- a/tools/lib/bpf/bpf.h
> +++ b/tools/lib/bpf/bpf.h
> @@ -37,6 +37,18 @@ extern "C" {
>
> LIBBPF_API int libbpf_set_memlock_rlim(size_t memlock_bytes);
>
> +struct bpf_log_opts {
> + size_t sz; /* size of this struct for forward/backward compatibility */
> +
> + char *log_buf;
> + __u32 log_size;
> + __u32 log_level;
> + __u32 log_true_size;
please mention in the comment here that this is an out parameter set
by the kernel
> +
> + size_t :0;
> +};
> +#define bpf_log_opts__last_field log_true_size
> +
> struct bpf_map_create_opts {
> size_t sz; /* size of this struct for forward/backward compatibility */
>
> @@ -57,9 +69,12 @@ struct bpf_map_create_opts {
>
> const void *excl_prog_hash;
> __u32 excl_prog_hash_size;
> +
> + struct bpf_log_opts *log_opts;
> +
> size_t :0;
> };
> -#define bpf_map_create_opts__last_field excl_prog_hash_size
> +#define bpf_map_create_opts__last_field log_opts
>
> LIBBPF_API int bpf_map_create(enum bpf_map_type map_type,
> const char *map_name,
> --
> 2.52.0
>
^ permalink raw reply
* Re: [PATCH net-next v2 0/4] net: uapi: Provide an UAPI definition of 'struct sockaddr'
From: Thomas Weißschuh @ 2026-02-04 5:51 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Eric Dumazet, Kuniyuki Iwashima, Paolo Abeni, Willem de Bruijn,
David S. Miller, Simon Horman, Shuah Khan, Matthieu Baerts,
Mat Martineau, Geliang Tang, Mickaël Salaün,
Günther Noack, Alexei Starovoitov, Daniel Borkmann,
Jesper Dangaard Brouer, John Fastabend, Stanislav Fomichev,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Hao Luo, Jiri Olsa, netdev, linux-kernel,
linux-api, Arnd Bergmann, linux-kselftest, mptcp,
linux-security-module, bpf, libc-alpha, Carlos O'Donell,
Adhemerval Zanella, Rich Felker, klibc, Florian Weimer
In-Reply-To: <20260203144011.32d5b223@kernel.org>
On Tue, Feb 03, 2026 at 02:40:11PM -0800, Jakub Kicinski wrote:
> On Tue, 3 Feb 2026 12:42:22 +0100 Thomas Weißschuh wrote:
> > > FWIW the typelimits change broke compilation of ethtool, we'll see if
> > > anyone "outside kernel community itself" complains.
> >
> > Can you point me to that breakage? I was unable to find it.
>
> Not reported on the ML, and it's kinda annoying to repro because
> the uAPI header sync script isn't committed :/ You have to check
> this out
>
> https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/
>
> and run a script like this to sync headers from the kernel (then build):
>
> #!/bin/bash -e
>
> sn="${0##*/}"
> export ARCH="x86_64"
>
> if [ ! -d "$LINUX_GIT" ]; then
> echo "${sn}: LINUX_GIT not set" >&2
> exit 1
> fi
>
> pushd "$LINUX_GIT"
> if [ -n "$1" ]; then
> git checkout "$1"
> fi
> desc=$(git describe --exact-match 2>/dev/null \
> || git show -s --abbrev=12 --pretty='commit %h')
> kobj=$(mktemp -d)
> make -j16 O="$kobj" allmodconfig
> make -j16 O="$kobj" prepare
These are not necessary.
The UAPI generation does not need a kernel configuration.
> make -j16 O="$kobj" INSTALL_HDR_PATH="${kobj}/hdr" headers_install
> popd
>
> pushd uapi
> find . -type f -name '*.h' -exec cp -v "${kobj}/hdr/include/{}" {} \;
Here only those headers which already exist in ethtool's uapi/ directory
are copied. As linux/typelimits.h is new, it is now missing.
Honestly, if a user fiddles with the internals of the UAPI headers like
this, it is on them to update their code if the internal structure
changes. In your case a simple 'touch uapi/linux/typelimits.h'
before running the script will be enough. Also internal.h now requires
an explicit inclusion of <limits.h>, as that is not satisfied by the
UAPI anymore.
> popd
> rm -rf "$kobj"
>
> git add uapi
> git commit -s -F - <<EOT
> update UAPI header copies
>
> Update to kernel ${desc}.
>
> EOT
^ permalink raw reply
* Re: [PATCH net-next v2 0/4] net: uapi: Provide an UAPI definition of 'struct sockaddr'
From: Jakub Kicinski @ 2026-02-03 22:40 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Eric Dumazet, Kuniyuki Iwashima, Paolo Abeni, Willem de Bruijn,
David S. Miller, Simon Horman, Shuah Khan, Matthieu Baerts,
Mat Martineau, Geliang Tang, Mickaël Salaün,
Günther Noack, Alexei Starovoitov, Daniel Borkmann,
Jesper Dangaard Brouer, John Fastabend, Stanislav Fomichev,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Hao Luo, Jiri Olsa, netdev, linux-kernel,
linux-api, Arnd Bergmann, linux-kselftest, mptcp,
linux-security-module, bpf, libc-alpha, Carlos O'Donell,
Adhemerval Zanella, Rich Felker, klibc, Florian Weimer
In-Reply-To: <20260203122715-eeb304f9-4b42-4fc6-a527-658182a92ba5@linutronix.de>
On Tue, 3 Feb 2026 12:42:22 +0100 Thomas Weißschuh wrote:
> > FWIW the typelimits change broke compilation of ethtool, we'll see if
> > anyone "outside kernel community itself" complains.
>
> Can you point me to that breakage? I was unable to find it.
Not reported on the ML, and it's kinda annoying to repro because
the uAPI header sync script isn't committed :/ You have to check
this out
https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/
and run a script like this to sync headers from the kernel (then build):
#!/bin/bash -e
sn="${0##*/}"
export ARCH="x86_64"
if [ ! -d "$LINUX_GIT" ]; then
echo "${sn}: LINUX_GIT not set" >&2
exit 1
fi
pushd "$LINUX_GIT"
if [ -n "$1" ]; then
git checkout "$1"
fi
desc=$(git describe --exact-match 2>/dev/null \
|| git show -s --abbrev=12 --pretty='commit %h')
kobj=$(mktemp -d)
make -j16 O="$kobj" allmodconfig
make -j16 O="$kobj" prepare
make -j16 O="$kobj" INSTALL_HDR_PATH="${kobj}/hdr" headers_install
popd
pushd uapi
find . -type f -name '*.h' -exec cp -v "${kobj}/hdr/include/{}" {} \;
popd
rm -rf "$kobj"
git add uapi
git commit -s -F - <<EOT
update UAPI header copies
Update to kernel ${desc}.
EOT
^ permalink raw reply
* Re: [PATCH net-next v2 0/4] net: uapi: Provide an UAPI definition of 'struct sockaddr'
From: Thomas Weißschuh @ 2026-02-03 11:42 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Eric Dumazet, Kuniyuki Iwashima, Paolo Abeni, Willem de Bruijn,
David S. Miller, Simon Horman, Shuah Khan, Matthieu Baerts,
Mat Martineau, Geliang Tang, Mickaël Salaün,
Günther Noack, Alexei Starovoitov, Daniel Borkmann,
Jesper Dangaard Brouer, John Fastabend, Stanislav Fomichev,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Hao Luo, Jiri Olsa, netdev, linux-kernel,
linux-api, Arnd Bergmann, linux-kselftest, mptcp,
linux-security-module, bpf, libc-alpha, Carlos O'Donell,
Adhemerval Zanella, Rich Felker, klibc, Florian Weimer
In-Reply-To: <20260131092517.6639d84c@kernel.org>
On Sat, Jan 31, 2026 at 09:25:17AM -0800, Jakub Kicinski wrote:
> On Sat, 31 Jan 2026 11:26:32 +0100 Thomas Weißschuh wrote:
> > Jan 30, 2026 17:17:46 Jakub Kicinski <kuba@kernel.org>:
> >
> > > On Fri, 30 Jan 2026 11:34:15 +0100 Thomas Weißschuh wrote:
> > >> Some of them get broken by the new 'struct sockaddr', but some others are
> > >> already broken just by the new transitive inclusion of libc-compat.h.
> > >> So any header starting to use the compatibility machinery may trigger breakage
> > >> in code including UAPI headers before libc header, even for completely new type
> > >> definitions which themselves would not conflict with libc.
> > >
> > > Let's split the uAPI header changes from any selftest changes.
> > > If you're saying the the selftests no longer build after the uAPI
> > > header changes then of course we can't apply the patches.
> >
> > Yes, the selftests don't build anymore after the uAPI changes.
> >
> > "can't apply" as in
> > * "can't apply separately"
> > * "are unacceptable in general"
>
> this one
>
> > * "are too late for this cycle"
> > ?
> >
> > None of this is urgent.
> > We can do the selftests in one cycle and the uAPI in another one.
> > Feel free to pick up the patches as you see fit.
> > (The mptcp changes already go through their tree, so need to be dropped here)
> > I can also resubmit the patches differently if preferred.
>
> The selftests are just a canary in the coalmine. If we break a bunch of
> selftests chances are we'll also break compilation of real applications
> for people. Subjective, but I don't see a sufficient upside here to do
> that.
Okay. We'll have around this inconsistency then.
> FWIW the typelimits change broke compilation of ethtool, we'll see if
> anyone "outside kernel community itself" complains.
Can you point me to that breakage? I was unable to find it.
Thomas
^ permalink raw reply
* [PATCH bpf-next v9 9/9] selftests/bpf: Add tests to verify map create failure log
From: Leon Hwang @ 2026-02-02 14:40 UTC (permalink / raw)
To: bpf
Cc: Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Leon Hwang, Willem de Bruijn, Jason Xing,
Tao Chen, Mykyta Yatsenko, Kumar Kartikeya Dwivedi,
Anton Protopopov, Amery Hung, Rong Tao, linux-kernel, linux-api,
linux-kselftest, kernel-patches-bot
In-Reply-To: <20260202144046.30651-1-leon.hwang@linux.dev>
Add tests to verify that the kernel reports the expected error messages
when map creation fails.
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
---
.../selftests/bpf/prog_tests/map_init.c | 168 ++++++++++++++++++
1 file changed, 168 insertions(+)
diff --git a/tools/testing/selftests/bpf/prog_tests/map_init.c b/tools/testing/selftests/bpf/prog_tests/map_init.c
index 14a31109dd0e..89e6daf2fcfd 100644
--- a/tools/testing/selftests/bpf/prog_tests/map_init.c
+++ b/tools/testing/selftests/bpf/prog_tests/map_init.c
@@ -212,3 +212,171 @@ void test_map_init(void)
if (test__start_subtest("pcpu_lru_map_init"))
test_pcpu_lru_map_init();
}
+
+#define BPF_LOG_FIXED 8
+
+static void test_map_create(enum bpf_map_type map_type, const char *map_name,
+ struct bpf_map_create_opts *opts, const char *exp_msg)
+{
+ const int key_size = 4, value_size = 4, max_entries = 1;
+ char log_buf[128];
+ int fd;
+ LIBBPF_OPTS(bpf_log_opts, log_opts);
+
+ log_buf[0] = '\0';
+ log_opts.log_buf = log_buf;
+ log_opts.log_size = sizeof(log_buf);
+ log_opts.log_level = BPF_LOG_FIXED;
+ opts->log_opts = &log_opts;
+ fd = bpf_map_create(map_type, map_name, key_size, value_size, max_entries, opts);
+ if (!ASSERT_LT(fd, 0, "bpf_map_create")) {
+ close(fd);
+ return;
+ }
+
+ ASSERT_STREQ(log_buf, exp_msg, "log_buf");
+ ASSERT_EQ(log_opts.log_true_size, strlen(exp_msg) + 1, "log_true_size");
+}
+
+static void test_map_create_array(struct bpf_map_create_opts *opts, const char *exp_msg)
+{
+ test_map_create(BPF_MAP_TYPE_ARRAY, "test_map_create", opts, exp_msg);
+}
+
+static void test_invalid_vmlinux_value_type_id_struct_ops(void)
+{
+ const char *msg = "btf_vmlinux_value_type_id can only be used with struct_ops maps.\n";
+ LIBBPF_OPTS(bpf_map_create_opts, opts,
+ .btf_vmlinux_value_type_id = 1,
+ );
+
+ test_map_create_array(&opts, msg);
+}
+
+static void test_invalid_vmlinux_value_type_id_kv_type_id(void)
+{
+ const char *msg = "btf_vmlinux_value_type_id is mutually exclusive with btf_key_type_id and btf_value_type_id.\n";
+ LIBBPF_OPTS(bpf_map_create_opts, opts,
+ .btf_vmlinux_value_type_id = 1,
+ .btf_key_type_id = 1,
+ );
+
+ test_map_create(BPF_MAP_TYPE_STRUCT_OPS, "test_map_create", &opts, msg);
+}
+
+static void test_invalid_value_type_id(void)
+{
+ const char *msg = "Invalid btf_value_type_id.\n";
+ LIBBPF_OPTS(bpf_map_create_opts, opts,
+ .btf_key_type_id = 1,
+ );
+
+ test_map_create_array(&opts, msg);
+}
+
+static void test_invalid_map_extra(void)
+{
+ const char *msg = "Invalid map_extra.\n";
+ LIBBPF_OPTS(bpf_map_create_opts, opts,
+ .map_extra = 1,
+ );
+
+ test_map_create_array(&opts, msg);
+}
+
+static void test_invalid_numa_node(void)
+{
+ const char *msg = "Invalid numa_node.\n";
+ LIBBPF_OPTS(bpf_map_create_opts, opts,
+ .map_flags = BPF_F_NUMA_NODE,
+ .numa_node = 0xFF,
+ );
+
+ test_map_create_array(&opts, msg);
+}
+
+static void test_invalid_map_type(void)
+{
+ const char *msg = "Invalid map_type.\n";
+ LIBBPF_OPTS(bpf_map_create_opts, opts);
+
+ test_map_create(__MAX_BPF_MAP_TYPE, "test_map_create", &opts, msg);
+}
+
+static void test_invalid_token_fd(void)
+{
+ const char *msg = "Invalid map_token_fd.\n";
+ LIBBPF_OPTS(bpf_map_create_opts, opts,
+ .map_flags = BPF_F_TOKEN_FD,
+ .token_fd = 0xFF,
+ );
+
+ test_map_create_array(&opts, msg);
+}
+
+static void test_invalid_map_name(void)
+{
+ const char *msg = "Invalid map_name.\n";
+ LIBBPF_OPTS(bpf_map_create_opts, opts);
+
+ test_map_create(BPF_MAP_TYPE_ARRAY, "test-!@#", &opts, msg);
+}
+
+static void test_invalid_btf_fd(void)
+{
+ const char *msg = "Invalid btf_fd.\n";
+ LIBBPF_OPTS(bpf_map_create_opts, opts,
+ .btf_fd = -1,
+ .btf_key_type_id = 1,
+ .btf_value_type_id = 1,
+ );
+
+ test_map_create_array(&opts, msg);
+}
+
+static void test_excl_prog_hash_size_1(void)
+{
+ const char *msg = "Invalid excl_prog_hash_size.\n";
+ const char *hash = "DEADCODE";
+ LIBBPF_OPTS(bpf_map_create_opts, opts,
+ .excl_prog_hash = hash,
+ );
+
+ test_map_create_array(&opts, msg);
+}
+
+static void test_excl_prog_hash_size_2(void)
+{
+ const char *msg = "Invalid excl_prog_hash_size.\n";
+ LIBBPF_OPTS(bpf_map_create_opts, opts,
+ .excl_prog_hash_size = 1,
+ );
+
+ test_map_create_array(&opts, msg);
+}
+
+void test_map_create_failure(void)
+{
+ if (test__start_subtest("invalid_vmlinux_value_type_id_struct_ops"))
+ test_invalid_vmlinux_value_type_id_struct_ops();
+ if (test__start_subtest("invalid_vmlinux_value_type_id_kv_type_id"))
+ test_invalid_vmlinux_value_type_id_kv_type_id();
+ if (test__start_subtest("invalid_value_type_id"))
+ test_invalid_value_type_id();
+ if (test__start_subtest("invalid_map_extra"))
+ test_invalid_map_extra();
+ if (test__start_subtest("invalid_numa_node"))
+ test_invalid_numa_node();
+ if (test__start_subtest("invalid_map_type"))
+ test_invalid_map_type();
+ if (test__start_subtest("invalid_token_fd"))
+ test_invalid_token_fd();
+ if (test__start_subtest("invalid_map_name"))
+ test_invalid_map_name();
+ if (test__start_subtest("invalid_btf_fd"))
+ test_invalid_btf_fd();
+ if (test__start_subtest("invalid_excl_prog_hash_size_1"))
+ test_excl_prog_hash_size_1();
+ if (test__start_subtest("invalid_excl_prog_hash_size_2"))
+ test_excl_prog_hash_size_2();
+}
--
2.52.0
^ permalink raw reply related
* [PATCH bpf-next v9 8/9] libbpf: Add syscall common attributes support for map_create
From: Leon Hwang @ 2026-02-02 14:40 UTC (permalink / raw)
To: bpf
Cc: Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Leon Hwang, Willem de Bruijn, Jason Xing,
Tao Chen, Mykyta Yatsenko, Kumar Kartikeya Dwivedi,
Anton Protopopov, Amery Hung, Rong Tao, linux-kernel, linux-api,
linux-kselftest, kernel-patches-bot
In-Reply-To: <20260202144046.30651-1-leon.hwang@linux.dev>
With the previous commit adding common attribute support for
BPF_MAP_CREATE, users can now retrieve detailed error messages when map
creation fails via the log_buf field.
Introduce struct bpf_log_opts with the following fields:
log_buf, log_size, log_level, and log_true_size.
Extend bpf_map_create_opts with a new field log_opts, allowing users to
capture and inspect log messages on map creation failures.
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
---
tools/lib/bpf/bpf.c | 16 +++++++++++++++-
tools/lib/bpf/bpf.h | 17 ++++++++++++++++-
2 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
index 9d8740761b7a..0c3e40844d80 100644
--- a/tools/lib/bpf/bpf.c
+++ b/tools/lib/bpf/bpf.c
@@ -209,6 +209,9 @@ int bpf_map_create(enum bpf_map_type map_type,
const struct bpf_map_create_opts *opts)
{
const size_t attr_sz = offsetofend(union bpf_attr, excl_prog_hash_size);
+ const size_t attr_common_sz = sizeof(struct bpf_common_attr);
+ struct bpf_common_attr attr_common;
+ struct bpf_log_opts *log_opts;
union bpf_attr attr;
int fd;
@@ -242,7 +245,18 @@ int bpf_map_create(enum bpf_map_type map_type,
attr.excl_prog_hash = ptr_to_u64(OPTS_GET(opts, excl_prog_hash, NULL));
attr.excl_prog_hash_size = OPTS_GET(opts, excl_prog_hash_size, 0);
- fd = sys_bpf_fd(BPF_MAP_CREATE, &attr, attr_sz);
+ log_opts = OPTS_GET(opts, log_opts, NULL);
+ if (log_opts && feat_supported(NULL, FEAT_BPF_SYSCALL_COMMON_ATTRS)) {
+ memset(&attr_common, 0, attr_common_sz);
+ attr_common.log_buf = ptr_to_u64(OPTS_GET(log_opts, log_buf, NULL));
+ attr_common.log_size = OPTS_GET(log_opts, log_size, 0);
+ attr_common.log_level = OPTS_GET(log_opts, log_level, 0);
+ fd = sys_bpf_ext_fd(BPF_MAP_CREATE, &attr, attr_sz, &attr_common, attr_common_sz);
+ OPTS_SET(log_opts, log_true_size, attr_common.log_true_size);
+ } else {
+ fd = sys_bpf_fd(BPF_MAP_CREATE, &attr, attr_sz);
+ OPTS_SET(log_opts, log_true_size, 0);
+ }
return libbpf_err_errno(fd);
}
diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h
index 2c8e88ddb674..59673f094f86 100644
--- a/tools/lib/bpf/bpf.h
+++ b/tools/lib/bpf/bpf.h
@@ -37,6 +37,18 @@ extern "C" {
LIBBPF_API int libbpf_set_memlock_rlim(size_t memlock_bytes);
+struct bpf_log_opts {
+ size_t sz; /* size of this struct for forward/backward compatibility */
+
+ char *log_buf;
+ __u32 log_size;
+ __u32 log_level;
+ __u32 log_true_size;
+
+ size_t :0;
+};
+#define bpf_log_opts__last_field log_true_size
+
struct bpf_map_create_opts {
size_t sz; /* size of this struct for forward/backward compatibility */
@@ -57,9 +69,12 @@ struct bpf_map_create_opts {
const void *excl_prog_hash;
__u32 excl_prog_hash_size;
+
+ struct bpf_log_opts *log_opts;
+
size_t :0;
};
-#define bpf_map_create_opts__last_field excl_prog_hash_size
+#define bpf_map_create_opts__last_field log_opts
LIBBPF_API int bpf_map_create(enum bpf_map_type map_type,
const char *map_name,
--
2.52.0
^ permalink raw reply related
* [PATCH bpf-next v9 7/9] bpf: Add syscall common attributes support for map_create
From: Leon Hwang @ 2026-02-02 14:40 UTC (permalink / raw)
To: bpf
Cc: Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Leon Hwang, Willem de Bruijn, Jason Xing,
Tao Chen, Mykyta Yatsenko, Kumar Kartikeya Dwivedi,
Anton Protopopov, Amery Hung, Rong Tao, linux-kernel, linux-api,
linux-kselftest, kernel-patches-bot
In-Reply-To: <20260202144046.30651-1-leon.hwang@linux.dev>
Many BPF_MAP_CREATE validation failures currently return -EINVAL without
any explanation to userspace.
Plumb common syscall log attributes into map_create(), create a verifier
log from bpf_common_attr::log_buf/log_size/log_level, and report
map-creation failure reasons through that buffer.
This improves debuggability by allowing userspace to inspect why map
creation failed and read back log_true_size from common attributes.
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
---
include/linux/bpf_verifier.h | 3 ++
kernel/bpf/log.c | 25 ++++++++++++++
kernel/bpf/syscall.c | 65 ++++++++++++++++++++++++++++++------
3 files changed, 83 insertions(+), 10 deletions(-)
diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
index 1144657bbc2f..eb7e6e0458f5 100644
--- a/include/linux/bpf_verifier.h
+++ b/include/linux/bpf_verifier.h
@@ -643,6 +643,9 @@ int bpf_prog_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *a
int bpf_btf_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *attr,
bpfptr_t uattr, u32 size, struct bpf_common_attr *attr_common,
bpfptr_t uattr_common, u32 size_common);
+struct bpf_verifier_log *bpf_log_attr_create_vlog(struct bpf_log_attr *attr_log,
+ struct bpf_common_attr *common, bpfptr_t uattr,
+ u32 size);
int bpf_log_attr_finalize(struct bpf_log_attr *attr, struct bpf_verifier_log *log);
#define BPF_MAX_SUBPROGS 256
diff --git a/kernel/bpf/log.c b/kernel/bpf/log.c
index db2716586f85..e5a46ad4eb23 100644
--- a/kernel/bpf/log.c
+++ b/kernel/bpf/log.c
@@ -921,6 +921,31 @@ int bpf_btf_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *at
return 0;
}
+struct bpf_verifier_log *bpf_log_attr_create_vlog(struct bpf_log_attr *attr_log,
+ struct bpf_common_attr *common, bpfptr_t uattr,
+ u32 size)
+{
+ struct bpf_verifier_log *log;
+ int err;
+
+ if (!common->log_buf)
+ return NULL;
+
+ log = kzalloc(sizeof(*log), GFP_KERNEL);
+ if (!log)
+ return ERR_PTR(-ENOMEM);
+
+ err = bpf_vlog_init(log, common->log_level, u64_to_user_ptr(common->log_buf),
+ common->log_size);
+ if (err) {
+ kfree(log);
+ return ERR_PTR(err);
+ }
+
+ bpf_log_attr_init(attr_log, offsetof(struct bpf_common_attr, log_true_size), uattr, size);
+ return log;
+}
+
int bpf_log_attr_finalize(struct bpf_log_attr *attr, struct bpf_verifier_log *log)
{
u32 log_true_size;
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 4a8933c1dd38..d26f63bd460e 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -1365,7 +1365,7 @@ static int map_check_btf(struct bpf_map *map, struct bpf_token *token,
#define BPF_MAP_CREATE_LAST_FIELD excl_prog_hash_size
/* called via syscall */
-static int map_create(union bpf_attr *attr, bpfptr_t uattr)
+static int __map_create(union bpf_attr *attr, bpfptr_t uattr, struct bpf_verifier_log *log)
{
const struct bpf_map_ops *ops;
struct bpf_token *token = NULL;
@@ -1377,8 +1377,10 @@ static int map_create(union bpf_attr *attr, bpfptr_t uattr)
int err;
err = CHECK_ATTR(BPF_MAP_CREATE);
- if (err)
+ if (err) {
+ bpf_log(log, "Invalid attr.\n");
return -EINVAL;
+ }
/* check BPF_F_TOKEN_FD flag, remember if it's set, and then clear it
* to avoid per-map type checks tripping on unknown flag
@@ -1387,17 +1389,25 @@ static int map_create(union bpf_attr *attr, bpfptr_t uattr)
attr->map_flags &= ~BPF_F_TOKEN_FD;
if (attr->btf_vmlinux_value_type_id) {
- if (attr->map_type != BPF_MAP_TYPE_STRUCT_OPS ||
- attr->btf_key_type_id || attr->btf_value_type_id)
+ if (attr->map_type != BPF_MAP_TYPE_STRUCT_OPS) {
+ bpf_log(log, "btf_vmlinux_value_type_id can only be used with struct_ops maps.\n");
return -EINVAL;
+ }
+ if (attr->btf_key_type_id || attr->btf_value_type_id) {
+ bpf_log(log, "btf_vmlinux_value_type_id is mutually exclusive with btf_key_type_id and btf_value_type_id.\n");
+ return -EINVAL;
+ }
} else if (attr->btf_key_type_id && !attr->btf_value_type_id) {
+ bpf_log(log, "Invalid btf_value_type_id.\n");
return -EINVAL;
}
if (attr->map_type != BPF_MAP_TYPE_BLOOM_FILTER &&
attr->map_type != BPF_MAP_TYPE_ARENA &&
- attr->map_extra != 0)
+ attr->map_extra != 0) {
+ bpf_log(log, "Invalid map_extra.\n");
return -EINVAL;
+ }
f_flags = bpf_get_file_flag(attr->map_flags);
if (f_flags < 0)
@@ -1405,13 +1415,17 @@ static int map_create(union bpf_attr *attr, bpfptr_t uattr)
if (numa_node != NUMA_NO_NODE &&
((unsigned int)numa_node >= nr_node_ids ||
- !node_online(numa_node)))
+ !node_online(numa_node))) {
+ bpf_log(log, "Invalid numa_node.\n");
return -EINVAL;
+ }
/* find map type and init map: hashtable vs rbtree vs bloom vs ... */
map_type = attr->map_type;
- if (map_type >= ARRAY_SIZE(bpf_map_types))
+ if (map_type >= ARRAY_SIZE(bpf_map_types)) {
+ bpf_log(log, "Invalid map_type.\n");
return -EINVAL;
+ }
map_type = array_index_nospec(map_type, ARRAY_SIZE(bpf_map_types));
ops = bpf_map_types[map_type];
if (!ops)
@@ -1429,8 +1443,10 @@ static int map_create(union bpf_attr *attr, bpfptr_t uattr)
if (token_flag) {
token = bpf_token_get_from_fd(attr->map_token_fd);
- if (IS_ERR(token))
+ if (IS_ERR(token)) {
+ bpf_log(log, "Invalid map_token_fd.\n");
return PTR_ERR(token);
+ }
/* if current token doesn't grant map creation permissions,
* then we can't use this token, so ignore it and rely on
@@ -1513,8 +1529,10 @@ static int map_create(union bpf_attr *attr, bpfptr_t uattr)
err = bpf_obj_name_cpy(map->name, attr->map_name,
sizeof(attr->map_name));
- if (err < 0)
+ if (err < 0) {
+ bpf_log(log, "Invalid map_name.\n");
goto free_map;
+ }
preempt_disable();
map->cookie = gen_cookie_next(&bpf_map_cookie);
@@ -1537,6 +1555,7 @@ static int map_create(union bpf_attr *attr, bpfptr_t uattr)
btf = btf_get_by_fd(attr->btf_fd);
if (IS_ERR(btf)) {
+ bpf_log(log, "Invalid btf_fd.\n");
err = PTR_ERR(btf);
goto free_map;
}
@@ -1564,6 +1583,7 @@ static int map_create(union bpf_attr *attr, bpfptr_t uattr)
bpfptr_t uprog_hash = make_bpfptr(attr->excl_prog_hash, uattr.is_kernel);
if (attr->excl_prog_hash_size != SHA256_DIGEST_SIZE) {
+ bpf_log(log, "Invalid excl_prog_hash_size.\n");
err = -EINVAL;
goto free_map;
}
@@ -1579,6 +1599,7 @@ static int map_create(union bpf_attr *attr, bpfptr_t uattr)
goto free_map;
}
} else if (attr->excl_prog_hash_size) {
+ bpf_log(log, "Invalid excl_prog_hash_size.\n");
err = -EINVAL;
goto free_map;
}
@@ -1617,6 +1638,30 @@ static int map_create(union bpf_attr *attr, bpfptr_t uattr)
return err;
}
+static int map_create(union bpf_attr *attr, bpfptr_t uattr, struct bpf_common_attr *attr_common,
+ bpfptr_t uattr_common, u32 size_common)
+{
+ struct bpf_verifier_log *log;
+ struct bpf_log_attr attr_log;
+ int err, ret;
+
+ log = bpf_log_attr_create_vlog(&attr_log, attr_common, uattr_common, size_common);
+ if (IS_ERR(log))
+ return PTR_ERR(log);
+
+ err = __map_create(attr, uattr, log);
+ if (err >= 0)
+ goto free;
+
+ ret = bpf_log_attr_finalize(&attr_log, log);
+ if (ret)
+ err = ret;
+
+free:
+ kfree(log);
+ return err;
+}
+
void bpf_map_inc(struct bpf_map *map)
{
atomic64_inc(&map->refcnt);
@@ -6214,7 +6259,7 @@ static int __sys_bpf(enum bpf_cmd cmd, bpfptr_t uattr, unsigned int size,
switch (cmd) {
case BPF_MAP_CREATE:
- err = map_create(&attr, uattr);
+ err = map_create(&attr, uattr, &attr_common, uattr_common, size_common);
break;
case BPF_MAP_LOOKUP_ELEM:
err = map_lookup_elem(&attr);
--
2.52.0
^ permalink raw reply related
* [PATCH bpf-next v9 6/9] bpf: Add syscall common attributes support for btf_load
From: Leon Hwang @ 2026-02-02 14:40 UTC (permalink / raw)
To: bpf
Cc: Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Shuah Khan, Christian Brauner, Seth Forshee, Yuichiro Tsuji,
Andrey Albershteyn, Leon Hwang, Willem de Bruijn, Jason Xing,
Tao Chen, Mykyta Yatsenko, Kumar Kartikeya Dwivedi,
Anton Protopopov, Amery Hung, Rong Tao, linux-kernel, linux-api,
linux-kselftest, kernel-patches-bot
In-Reply-To: <20260202144046.30651-1-leon.hwang@linux.dev>
BPF_BTF_LOAD can now provide log parameters through both union bpf_attr
and bpf_common_attr. Apply the same conflict and precedence rules as
prog_load:
- if both are provided and btf_log_buf/btf_log_size/btf_log_level match,
use them;
- if only one side provides a log buffer, use that one;
- if both provide log buffers but differ, return -EINVAL.
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
---
include/linux/bpf_verifier.h | 3 ++-
kernel/bpf/log.c | 18 ++++++++++++++++--
kernel/bpf/syscall.c | 3 ++-
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
index b6e33ee82f63..1144657bbc2f 100644
--- a/include/linux/bpf_verifier.h
+++ b/include/linux/bpf_verifier.h
@@ -641,7 +641,8 @@ int bpf_prog_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *a
bpfptr_t uattr, u32 size, struct bpf_common_attr *attr_common,
bpfptr_t uattr_common, u32 size_common);
int bpf_btf_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *attr,
- bpfptr_t uattr, u32 size);
+ bpfptr_t uattr, u32 size, struct bpf_common_attr *attr_common,
+ bpfptr_t uattr_common, u32 size_common);
int bpf_log_attr_finalize(struct bpf_log_attr *attr, struct bpf_verifier_log *log);
#define BPF_MAX_SUBPROGS 256
diff --git a/kernel/bpf/log.c b/kernel/bpf/log.c
index 8ad88e4aa12c..db2716586f85 100644
--- a/kernel/bpf/log.c
+++ b/kernel/bpf/log.c
@@ -901,9 +901,23 @@ int bpf_prog_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *a
}
int bpf_btf_load_log_attr_init(struct bpf_log_attr *attr_log, union bpf_attr *attr,
- bpfptr_t uattr, u32 size)
+ bpfptr_t uattr, u32 size, struct bpf_common_attr *attr_common,
+ bpfptr_t uattr_common, u32 size_common)
{
- bpf_log_attr_init(attr_log, offsetof(union bpf_attr, btf_log_true_size), uattr, size);
+ if (bpf_log_attrs_diff(attr_common, attr->btf_log_buf, attr->btf_log_size,
+ attr->btf_log_level))
+ return -EINVAL;
+
+ if (!attr->btf_log_buf && attr_common->log_buf) {
+ attr->btf_log_buf = attr_common->log_buf;
+ attr->btf_log_size = attr_common->log_size;
+ attr->btf_log_level = attr_common->log_level;
+ bpf_log_attr_init(attr_log, offsetof(struct bpf_common_attr, log_true_size),
+ uattr_common, size_common);
+ } else {
+ bpf_log_attr_init(attr_log, offsetof(union bpf_attr, btf_log_true_size), uattr,
+ size);
+ }
return 0;
}
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index b6e4ec641dc1..4a8933c1dd38 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -6279,7 +6279,8 @@ static int __sys_bpf(enum bpf_cmd cmd, bpfptr_t uattr, unsigned int size,
err = bpf_raw_tracepoint_open(&attr);
break;
case BPF_BTF_LOAD:
- err = bpf_btf_load_log_attr_init(&attr_log, &attr, uattr, size);
+ err = bpf_btf_load_log_attr_init(&attr_log, &attr, uattr, size, &attr_common,
+ uattr_common, size_common);
err = err ?: bpf_btf_load(&attr, uattr, &attr_log);
break;
case BPF_BTF_GET_FD_BY_ID:
--
2.52.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox