* [PATCH net-next 1/2] net: dsa: mv88e6xxx: Use the DT IRQ trigger mode
From: Andrew Lunn @ 2018-03-19 21:16 UTC (permalink / raw)
To: David Miller; +Cc: netdev, u.kleine-koenig, Andrew Lunn
In-Reply-To: <1521494181-4653-1-git-send-email-andrew@lunn.ch>
By calling request_threaded_irq() with the flag IRQF_TRIGGER_FALLING
we override the trigger mode provided in device tree. And the
interrupt is actually active low, which is what all the current device
tree descriptions use.
Suggested-by: Uwe Kleine-K�nig <u.kleine-koenig@pengutronix.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index fe46b40195fa..84e6febaf881 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -425,7 +425,7 @@ static int mv88e6xxx_g1_irq_setup(struct mv88e6xxx_chip *chip)
err = request_threaded_irq(chip->irq, NULL,
mv88e6xxx_g1_irq_thread_fn,
- IRQF_ONESHOT | IRQF_TRIGGER_FALLING,
+ IRQF_ONESHOT,
dev_name(chip->dev), chip);
if (err)
mv88e6xxx_g1_irq_free_common(chip);
--
2.16.2
^ permalink raw reply related
* Re: recursive static routes
From: Saku Ytti @ 2018-03-19 21:35 UTC (permalink / raw)
To: David Ahern; +Cc: netdev
In-Reply-To: <d99c7e0a-cb3b-6fef-aa39-51e4a2a41e7a@cumulusnetworks.com>
Hey,
> you want per-packet overhead instead of deferring the overhead event
> based updates? network events tend to be much less frequent than
> sending/forwarding packets
Depending on performance cost and complexity cost of options.
--
++ytti
^ permalink raw reply
* Re: [PATCH 11/16] treewide: simplify Kconfig dependencies for removed archs
From: Alexandre Belloni @ 2018-03-19 23:06 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-arch, linux-kernel, linux-block, linux-ide, linux-input,
netdev, linux-wireless, linux-pwm, linux-rtc, linux-spi,
linux-usb, dri-devel, linux-fbdev, linux-watchdog, linux-fsdevel,
linux-mm
In-Reply-To: <20180314144614.1632190-1-arnd@arndb.de>
On 14/03/2018 at 15:43:46 +0100, Arnd Bergmann wrote:
> A lot of Kconfig symbols have architecture specific dependencies.
> In those cases that depend on architectures we have already removed,
> they can be omitted.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> block/bounce.c | 2 +-
> drivers/ide/Kconfig | 2 +-
> drivers/ide/ide-generic.c | 12 +-----------
> drivers/input/joystick/analog.c | 2 +-
> drivers/isdn/hisax/Kconfig | 10 +++++-----
> drivers/net/ethernet/davicom/Kconfig | 2 +-
> drivers/net/ethernet/smsc/Kconfig | 6 +++---
> drivers/net/wireless/cisco/Kconfig | 2 +-
> drivers/pwm/Kconfig | 2 +-
> drivers/rtc/Kconfig | 2 +-
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> drivers/spi/Kconfig | 4 ++--
> drivers/usb/musb/Kconfig | 2 +-
> drivers/video/console/Kconfig | 3 +--
> drivers/watchdog/Kconfig | 6 ------
> drivers/watchdog/Makefile | 6 ------
> fs/Kconfig.binfmt | 5 ++---
> fs/minix/Kconfig | 2 +-
> include/linux/ide.h | 7 +------
> init/Kconfig | 5 ++---
> lib/Kconfig.debug | 13 +++++--------
> lib/test_user_copy.c | 2 --
> mm/Kconfig | 7 -------
> mm/percpu.c | 4 ----
> 23 files changed, 31 insertions(+), 77 deletions(-)
>
> diff --git a/block/bounce.c b/block/bounce.c
> index 6a3e68292273..dd0b93f2a871 100644
> --- a/block/bounce.c
> +++ b/block/bounce.c
> @@ -31,7 +31,7 @@
> static struct bio_set *bounce_bio_set, *bounce_bio_split;
> static mempool_t *page_pool, *isa_page_pool;
>
> -#if defined(CONFIG_HIGHMEM) || defined(CONFIG_NEED_BOUNCE_POOL)
> +#if defined(CONFIG_HIGHMEM)
> static __init int init_emergency_pool(void)
> {
> #if defined(CONFIG_HIGHMEM) && !defined(CONFIG_MEMORY_HOTPLUG)
> diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
> index cf1fb3fb5d26..901b8833847f 100644
> --- a/drivers/ide/Kconfig
> +++ b/drivers/ide/Kconfig
> @@ -200,7 +200,7 @@ comment "IDE chipset support/bugfixes"
>
> config IDE_GENERIC
> tristate "generic/default IDE chipset support"
> - depends on ALPHA || X86 || IA64 || M32R || MIPS || ARCH_RPC
> + depends on ALPHA || X86 || IA64 || MIPS || ARCH_RPC
> default ARM && ARCH_RPC
> help
> This is the generic IDE driver. This driver attaches to the
> diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c
> index 54d7c4685d23..80c0d69b83ac 100644
> --- a/drivers/ide/ide-generic.c
> +++ b/drivers/ide/ide-generic.c
> @@ -13,13 +13,10 @@
> #include <linux/ide.h>
> #include <linux/pci_ids.h>
>
> -/* FIXME: convert arm and m32r to use ide_platform host driver */
> +/* FIXME: convert arm to use ide_platform host driver */
> #ifdef CONFIG_ARM
> #include <asm/irq.h>
> #endif
> -#ifdef CONFIG_M32R
> -#include <asm/m32r.h>
> -#endif
>
> #define DRV_NAME "ide_generic"
>
> @@ -35,13 +32,6 @@ static const struct ide_port_info ide_generic_port_info = {
> #ifdef CONFIG_ARM
> static const u16 legacy_bases[] = { 0x1f0 };
> static const int legacy_irqs[] = { IRQ_HARDDISK };
> -#elif defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) || \
> - defined(CONFIG_PLAT_OPSPUT)
> -static const u16 legacy_bases[] = { 0x1f0 };
> -static const int legacy_irqs[] = { PLD_IRQ_CFIREQ };
> -#elif defined(CONFIG_PLAT_MAPPI3)
> -static const u16 legacy_bases[] = { 0x1f0, 0x170 };
> -static const int legacy_irqs[] = { PLD_IRQ_CFIREQ, PLD_IRQ_IDEIREQ };
> #elif defined(CONFIG_ALPHA)
> static const u16 legacy_bases[] = { 0x1f0, 0x170, 0x1e8, 0x168 };
> static const int legacy_irqs[] = { 14, 15, 11, 10 };
> diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
> index be1b4921f22a..eefac7978f93 100644
> --- a/drivers/input/joystick/analog.c
> +++ b/drivers/input/joystick/analog.c
> @@ -163,7 +163,7 @@ static unsigned int get_time_pit(void)
> #define GET_TIME(x) do { x = (unsigned int)rdtsc(); } while (0)
> #define DELTA(x,y) ((y)-(x))
> #define TIME_NAME "TSC"
> -#elif defined(__alpha__) || defined(CONFIG_ARM) || defined(CONFIG_ARM64) || defined(CONFIG_RISCV) || defined(CONFIG_TILE)
> +#elif defined(__alpha__) || defined(CONFIG_ARM) || defined(CONFIG_ARM64) || defined(CONFIG_RISCV)
> #define GET_TIME(x) do { x = get_cycles(); } while (0)
> #define DELTA(x,y) ((y)-(x))
> #define TIME_NAME "get_cycles"
> diff --git a/drivers/isdn/hisax/Kconfig b/drivers/isdn/hisax/Kconfig
> index eb83d94ab4fe..38cfc8baae19 100644
> --- a/drivers/isdn/hisax/Kconfig
> +++ b/drivers/isdn/hisax/Kconfig
> @@ -109,7 +109,7 @@ config HISAX_16_3
>
> config HISAX_TELESPCI
> bool "Teles PCI"
> - depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV || (XTENSA && !CPU_LITTLE_ENDIAN)))
> + depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || (XTENSA && !CPU_LITTLE_ENDIAN)))
> help
> This enables HiSax support for the Teles PCI.
> See <file:Documentation/isdn/README.HiSax> on how to configure it.
> @@ -237,7 +237,7 @@ config HISAX_MIC
>
> config HISAX_NETJET
> bool "NETjet card"
> - depends on PCI && (BROKEN || !(PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV || (XTENSA && !CPU_LITTLE_ENDIAN) || MICROBLAZE))
> + depends on PCI && (BROKEN || !(PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || (XTENSA && !CPU_LITTLE_ENDIAN) || MICROBLAZE))
> depends on VIRT_TO_BUS
> help
> This enables HiSax support for the NetJet from Traverse
> @@ -249,7 +249,7 @@ config HISAX_NETJET
>
> config HISAX_NETJET_U
> bool "NETspider U card"
> - depends on PCI && (BROKEN || !(PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV || (XTENSA && !CPU_LITTLE_ENDIAN) || MICROBLAZE))
> + depends on PCI && (BROKEN || !(PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || (XTENSA && !CPU_LITTLE_ENDIAN) || MICROBLAZE))
> depends on VIRT_TO_BUS
> help
> This enables HiSax support for the Netspider U interface ISDN card
> @@ -318,7 +318,7 @@ config HISAX_GAZEL
>
> config HISAX_HFC_PCI
> bool "HFC PCI-Bus cards"
> - depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV || (XTENSA && !CPU_LITTLE_ENDIAN)))
> + depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || (XTENSA && !CPU_LITTLE_ENDIAN)))
> help
> This enables HiSax support for the HFC-S PCI 2BDS0 based cards.
>
> @@ -343,7 +343,7 @@ config HISAX_HFC_SX
>
> config HISAX_ENTERNOW_PCI
> bool "Formula-n enter:now PCI card"
> - depends on HISAX_NETJET && PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV || (XTENSA && !CPU_LITTLE_ENDIAN)))
> + depends on HISAX_NETJET && PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || (XTENSA && !CPU_LITTLE_ENDIAN)))
> help
> This enables HiSax support for the Formula-n enter:now PCI
> ISDN card.
> diff --git a/drivers/net/ethernet/davicom/Kconfig b/drivers/net/ethernet/davicom/Kconfig
> index 7ec2d74f94d3..680a6d983f37 100644
> --- a/drivers/net/ethernet/davicom/Kconfig
> +++ b/drivers/net/ethernet/davicom/Kconfig
> @@ -4,7 +4,7 @@
>
> config DM9000
> tristate "DM9000 support"
> - depends on ARM || BLACKFIN || MIPS || COLDFIRE || NIOS2
> + depends on ARM || MIPS || COLDFIRE || NIOS2
> select CRC32
> select MII
> ---help---
> diff --git a/drivers/net/ethernet/smsc/Kconfig b/drivers/net/ethernet/smsc/Kconfig
> index 948603e9b905..3da0c573d2ab 100644
> --- a/drivers/net/ethernet/smsc/Kconfig
> +++ b/drivers/net/ethernet/smsc/Kconfig
> @@ -5,8 +5,8 @@
> config NET_VENDOR_SMSC
> bool "SMC (SMSC)/Western Digital devices"
> default y
> - depends on ARM || ARM64 || ATARI_ETHERNAT || BLACKFIN || COLDFIRE || \
> - ISA || M32R || MAC || MIPS || NIOS2 || PCI || \
> + depends on ARM || ARM64 || ATARI_ETHERNAT || COLDFIRE || \
> + ISA || MAC || MIPS || NIOS2 || PCI || \
> PCMCIA || SUPERH || XTENSA || H8300
> ---help---
> If you have a network (Ethernet) card belonging to this class, say Y.
> @@ -37,7 +37,7 @@ config SMC91X
> select CRC32
> select MII
> depends on !OF || GPIOLIB
> - depends on ARM || ARM64 || ATARI_ETHERNAT || BLACKFIN || COLDFIRE || \
> + depends on ARM || ARM64 || ATARI_ETHERNAT || COLDFIRE || \
> M32R || MIPS || NIOS2 || SUPERH || XTENSA || H8300
> ---help---
> This is a driver for SMC's 91x series of Ethernet chipsets,
> diff --git a/drivers/net/wireless/cisco/Kconfig b/drivers/net/wireless/cisco/Kconfig
> index b22567dff893..8ed0b154bb33 100644
> --- a/drivers/net/wireless/cisco/Kconfig
> +++ b/drivers/net/wireless/cisco/Kconfig
> @@ -33,7 +33,7 @@ config AIRO
>
> config AIRO_CS
> tristate "Cisco/Aironet 34X/35X/4500/4800 PCMCIA cards"
> - depends on CFG80211 && PCMCIA && (BROKEN || !M32R)
> + depends on CFG80211 && PCMCIA
> select WIRELESS_EXT
> select WEXT_SPY
> select WEXT_PRIV
> diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
> index 763ee50ea57d..f16aad3bf5d6 100644
> --- a/drivers/pwm/Kconfig
> +++ b/drivers/pwm/Kconfig
> @@ -43,7 +43,7 @@ config PWM_AB8500
>
> config PWM_ATMEL
> tristate "Atmel PWM support"
> - depends on ARCH_AT91 || AVR32
> + depends on ARCH_AT91
> help
> Generic PWM framework driver for Atmel SoC.
>
> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
> index be5a3dc99c11..46af10ac45fc 100644
> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -868,7 +868,7 @@ comment "Platform RTC drivers"
>
> config RTC_DRV_CMOS
> tristate "PC-style 'CMOS'"
> - depends on X86 || ARM || M32R || PPC || MIPS || SPARC64
> + depends on X86 || ARM || PPC || MIPS || SPARC64
> default y if X86
> select RTC_MC146818_LIB
> help
> diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
> index 603783976b81..103c13fcefa0 100644
> --- a/drivers/spi/Kconfig
> +++ b/drivers/spi/Kconfig
> @@ -72,10 +72,10 @@ config SPI_ARMADA_3700
> config SPI_ATMEL
> tristate "Atmel SPI Controller"
> depends on HAS_DMA
> - depends on (ARCH_AT91 || AVR32 || COMPILE_TEST)
> + depends on ARCH_AT91 || COMPILE_TEST
> help
> This selects a driver for the Atmel SPI Controller, present on
> - many AT32 (AVR32) and AT91 (ARM) chips.
> + many AT91 ARM chips.
>
> config SPI_AU1550
> tristate "Au1550/Au1200/Au1300 SPI Controller"
> diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
> index 5506a9c03c1f..e757afc1cfd0 100644
> --- a/drivers/usb/musb/Kconfig
> +++ b/drivers/usb/musb/Kconfig
> @@ -87,7 +87,7 @@ config USB_MUSB_DA8XX
> config USB_MUSB_TUSB6010
> tristate "TUSB6010"
> depends on HAS_IOMEM
> - depends on (ARCH_OMAP2PLUS || COMPILE_TEST) && !BLACKFIN
> + depends on ARCH_OMAP2PLUS || COMPILE_TEST
> depends on NOP_USB_XCEIV = USB_MUSB_HDRC # both built-in or both modules
>
> config USB_MUSB_OMAP2PLUS
> diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
> index 005ed87c8216..a9e398c144f8 100644
> --- a/drivers/video/console/Kconfig
> +++ b/drivers/video/console/Kconfig
> @@ -6,8 +6,7 @@ menu "Console display driver support"
>
> config VGA_CONSOLE
> bool "VGA text console" if EXPERT || !X86
> - depends on !4xx && !PPC_8xx && !SPARC && !M68K && !PARISC && !FRV && \
> - !SUPERH && !BLACKFIN && !AVR32 && !CRIS && \
> + depends on !4xx && !PPC_8xx && !SPARC && !M68K && !PARISC && !SUPERH && \
> (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) && \
> !ARM64 && !ARC && !MICROBLAZE && !OPENRISC
> default y
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 0e19679348d1..79020ce95de2 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -828,10 +828,6 @@ config BFIN_WDT
> To compile this driver as a module, choose M here: the
> module will be called bfin_wdt.
>
> -# CRIS Architecture
> -
> -# FRV Architecture
> -
> # X86 (i386 + ia64 + x86_64) Architecture
>
> config ACQUIRE_WDT
> @@ -1431,8 +1427,6 @@ config NIC7018_WDT
> To compile this driver as a module, choose M here: the module will be
> called nic7018_wdt.
>
> -# M32R Architecture
> -
> # M68K Architecture
>
> config M54xx_WATCHDOG
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 0474d38aa854..1f9a0235f22c 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -94,10 +94,6 @@ obj-$(CONFIG_SPRD_WATCHDOG) += sprd_wdt.o
> # BLACKFIN Architecture
> obj-$(CONFIG_BFIN_WDT) += bfin_wdt.o
>
> -# CRIS Architecture
> -
> -# FRV Architecture
> -
> # X86 (i386 + ia64 + x86_64) Architecture
> obj-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o
> obj-$(CONFIG_ADVANTECH_WDT) += advantechwdt.o
> @@ -146,8 +142,6 @@ obj-$(CONFIG_INTEL_MEI_WDT) += mei_wdt.o
> obj-$(CONFIG_NI903X_WDT) += ni903x_wdt.o
> obj-$(CONFIG_NIC7018_WDT) += nic7018_wdt.o
>
> -# M32R Architecture
> -
> # M68K Architecture
> obj-$(CONFIG_M54xx_WATCHDOG) += m54xx_wdt.o
>
> diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt
> index 58c2bbd385ad..57a27c42b5ac 100644
> --- a/fs/Kconfig.binfmt
> +++ b/fs/Kconfig.binfmt
> @@ -1,6 +1,6 @@
> config BINFMT_ELF
> bool "Kernel support for ELF binaries"
> - depends on MMU && (BROKEN || !FRV)
> + depends on MMU
> select ELFCORE
> default y
> ---help---
> @@ -35,7 +35,7 @@ config ARCH_BINFMT_ELF_STATE
> config BINFMT_ELF_FDPIC
> bool "Kernel support for FDPIC ELF binaries"
> default y if !BINFMT_ELF
> - depends on (ARM || FRV || BLACKFIN || (SUPERH32 && !MMU) || C6X)
> + depends on (ARM || (SUPERH32 && !MMU) || C6X)
> select ELFCORE
> help
> ELF FDPIC binaries are based on ELF, but allow the individual load
> @@ -90,7 +90,6 @@ config BINFMT_SCRIPT
> config BINFMT_FLAT
> bool "Kernel support for flat binaries"
> depends on !MMU || ARM || M68K
> - depends on !FRV || BROKEN
> help
> Support uClinux FLAT format binaries.
>
> diff --git a/fs/minix/Kconfig b/fs/minix/Kconfig
> index f2a0cfcef11d..bcd53a79156f 100644
> --- a/fs/minix/Kconfig
> +++ b/fs/minix/Kconfig
> @@ -18,7 +18,7 @@ config MINIX_FS
>
> config MINIX_FS_NATIVE_ENDIAN
> def_bool MINIX_FS
> - depends on M32R || MICROBLAZE || MIPS || S390 || SUPERH || SPARC || XTENSA || (M68K && !MMU)
> + depends on MICROBLAZE || MIPS || S390 || SUPERH || SPARC || XTENSA || (M68K && !MMU)
>
> config MINIX_FS_BIG_ENDIAN_16BIT_INDEXED
> def_bool MINIX_FS
> diff --git a/include/linux/ide.h b/include/linux/ide.h
> index 20d42c0d9fb6..1d6f16110eae 100644
> --- a/include/linux/ide.h
> +++ b/include/linux/ide.h
> @@ -25,15 +25,10 @@
> #include <asm/byteorder.h>
> #include <asm/io.h>
>
> -#if defined(CONFIG_CRIS) || defined(CONFIG_FRV)
> -# define SUPPORT_VLB_SYNC 0
> -#else
> -# define SUPPORT_VLB_SYNC 1
> -#endif
> -
> /*
> * Probably not wise to fiddle with these
> */
> +#define SUPPORT_VLB_SYNC 1
> #define IDE_DEFAULT_MAX_FAILURES 1
> #define ERROR_MAX 8 /* Max read/write errors per sector */
> #define ERROR_RESET 3 /* Reset controller every 4th retry */
> diff --git a/init/Kconfig b/init/Kconfig
> index a14bcc9724a2..2852692d7c9c 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -998,7 +998,6 @@ config RELAY
>
> config BLK_DEV_INITRD
> bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
> - depends on BROKEN || !FRV
> help
> The initial RAM filesystem is a ramfs which is loaded by the
> boot loader (loadlin or lilo) and that is mounted as root
> @@ -1108,7 +1107,7 @@ config MULTIUSER
>
> config SGETMASK_SYSCALL
> bool "sgetmask/ssetmask syscalls support" if EXPERT
> - def_bool PARISC || BLACKFIN || M68K || PPC || MIPS || X86 || SPARC || CRIS || MICROBLAZE || SUPERH
> + def_bool PARISC || M68K || PPC || MIPS || X86 || SPARC || MICROBLAZE || SUPERH
> ---help---
> sys_sgetmask and sys_ssetmask are obsolete system calls
> no longer supported in libc but still enabled by default in some
> @@ -1370,7 +1369,7 @@ config KALLSYMS_ABSOLUTE_PERCPU
> config KALLSYMS_BASE_RELATIVE
> bool
> depends on KALLSYMS
> - default !IA64 && !(TILE && 64BIT)
> + default !IA64
> help
> Instead of emitting them as absolute values in the native word size,
> emit the symbol references in the kallsyms table as 32-bit entries,
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index 41ac9d294245..6927c6d8d185 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -165,7 +165,7 @@ config DEBUG_INFO_REDUCED
>
> config DEBUG_INFO_SPLIT
> bool "Produce split debuginfo in .dwo files"
> - depends on DEBUG_INFO && !FRV
> + depends on DEBUG_INFO
> help
> Generate debug info into separate .dwo files. This significantly
> reduces the build directory size for builds with DEBUG_INFO,
> @@ -354,10 +354,7 @@ config ARCH_WANT_FRAME_POINTERS
>
> config FRAME_POINTER
> bool "Compile the kernel with frame pointers"
> - depends on DEBUG_KERNEL && \
> - (CRIS || M68K || FRV || UML || \
> - SUPERH || BLACKFIN) || \
> - ARCH_WANT_FRAME_POINTERS
> + depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
> default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS
> help
> If you say Y here the resulting kernel image will be slightly
> @@ -1138,7 +1135,7 @@ config LOCKDEP
> bool
> depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
> select STACKTRACE
> - select FRAME_POINTER if !MIPS && !PPC && !ARM_UNWIND && !S390 && !MICROBLAZE && !ARC && !SCORE && !X86
> + select FRAME_POINTER if !MIPS && !PPC && !ARM_UNWIND && !S390 && !MICROBLAZE && !ARC && !X86
> select KALLSYMS
> select KALLSYMS_ALL
>
> @@ -1571,7 +1568,7 @@ config FAULT_INJECTION_STACKTRACE_FILTER
> depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT
> depends on !X86_64
> select STACKTRACE
> - select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !SCORE && !X86
> + select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !X86
> help
> Provide stacktrace filter for fault-injection capabilities
>
> @@ -1969,7 +1966,7 @@ config STRICT_DEVMEM
> bool "Filter access to /dev/mem"
> depends on MMU && DEVMEM
> depends on ARCH_HAS_DEVMEM_IS_ALLOWED
> - default y if TILE || PPC || X86 || ARM64
> + default y if PPC || X86 || ARM64
> ---help---
> If this option is disabled, you allow userspace (root) access to all
> of memory, including kernel and userspace memory. Accidental
> diff --git a/lib/test_user_copy.c b/lib/test_user_copy.c
> index a6556f3364d1..e161f0498f42 100644
> --- a/lib/test_user_copy.c
> +++ b/lib/test_user_copy.c
> @@ -31,8 +31,6 @@
> * their capability at compile-time, we just have to opt-out certain archs.
> */
> #if BITS_PER_LONG == 64 || (!(defined(CONFIG_ARM) && !defined(MMU)) && \
> - !defined(CONFIG_BLACKFIN) && \
> - !defined(CONFIG_M32R) && \
> !defined(CONFIG_M68K) && \
> !defined(CONFIG_MICROBLAZE) && \
> !defined(CONFIG_NIOS2) && \
> diff --git a/mm/Kconfig b/mm/Kconfig
> index abefa573bcd8..d5004d82a1d6 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -278,13 +278,6 @@ config BOUNCE
> by default when ZONE_DMA or HIGHMEM is selected, but you
> may say n to override this.
>
> -# On the 'tile' arch, USB OHCI needs the bounce pool since tilegx will often
> -# have more than 4GB of memory, but we don't currently use the IOTLB to present
> -# a 32-bit address to OHCI. So we need to use a bounce pool instead.
> -config NEED_BOUNCE_POOL
> - bool
> - default y if TILE && USB_OHCI_HCD
> -
> config NR_QUICK
> int
> depends on QUICKLIST
> diff --git a/mm/percpu.c b/mm/percpu.c
> index 50e7fdf84055..79e3549cab0f 100644
> --- a/mm/percpu.c
> +++ b/mm/percpu.c
> @@ -2719,11 +2719,7 @@ void __init setup_per_cpu_areas(void)
>
> if (pcpu_setup_first_chunk(ai, fc) < 0)
> panic("Failed to initialize percpu areas.");
> -#ifdef CONFIG_CRIS
> -#warning "the CRIS architecture has physical and virtual addresses confused"
> -#else
> pcpu_free_alloc_info(ai);
> -#endif
> }
>
> #endif /* CONFIG_SMP */
> --
> 2.9.0
>
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply
* Re: [PATCH net-next v2 2/2] dt: bindings: add new dt entries for brcmfmac
From: Arend van Spriel @ 2018-03-19 23:16 UTC (permalink / raw)
To: Florian Fainelli, Alexey Roslyakov
Cc: Andrew Lunn, kvalo, robh+dt, mark.rutland, franky.lin,
hante.meuleman, chi-hsien.lin, wright.feng, netdev,
linux-wireless, devicetree, linux-kernel, brcm80211-dev-list.pdl,
brcm80211-dev-list, Ulf Hansson
In-Reply-To: <817418fd-6446-57ea-b03d-383b4df9a979@gmail.com>
+ Uffe
On 3/19/2018 6:55 PM, Florian Fainelli wrote:
> On 03/19/2018 07:10 AM, Alexey Roslyakov wrote:
>> Hi Arend,
>> I appreciate your response. In my opinion, it has nothing to do with
>> SDIO host, because it defines "quirks" in the driver itself.
>
> It is not clear to me from your patch series whether the problem is that:
>
> - the SDIO device has a specific alignment requirements, which would be
> either a SDIO device driver limitation/issue or maybe the underlying
> hardware device/firmware requiring that
>
> - the SDIO host controller used is not capable of coping nicely with
> these said limitations
>
> It seems to me like what you are doing here is a) applicable to possibly
> more SDIO devices and host combinations, and b) should likely be done at
> the layer between the host and device, such that it is available to more
> combinations.
Indeed. That was my thought exactly and I can not imagine Uffe would
push back on that reasoning.
>> If I get it right, you mean something like this:
>>
>> mmc3: mmc@1c12000 {
>> ...
>> broken-sg-support;
>> sd-head-align = 4;
>> sd-sgentry-align = 512;
>>
>> brcmf: wifi@1 {
>> ...
>> };
>> };
>>
>> Where dt: bindings documentation for these entries should reside?
>> In generic MMC bindings? Well, this is the very special case and
>> mmc-linux maintainer will unlikely to accept these changes.
>> Also, extra kernel code modification might be required. It could make
>> quite trivial change much more complex.
>
> If the MMC maintainers are not copied on this patch series, it will
> likely be hard for them to identify this patch series and chime in...
The main question is whether this is indeed a "very special case" as
Alexey claims it to be or that it is likely to be applicable to other
device and host combinations as you are suggesting.
If these properties are imposed by the host or host controller it would
make sense to have these in the mmc bindings.
>>
>>> Also I am not sure if the broken-sg-support is still needed. We added that for omap_hsmmc, but that has since changed to scatter-gather emulation so it might not be needed anymore.
>>
>> I've experienced the problem with rk3288 (dw-mmc host) and sdio
>> settings like above solved it.
>> Frankly, I haven't investigated any deeper which one of the settings
>> helped in my case yet...
>> I will try to get rid of broken-sg-support first and let you know if
>> it does make any difference.
Are you using some chromebook. I have some lying around here so I could
also look into it. What broadcom chipset do you have?
Regards,
Arend
>> All the best,
>> Alex.
>>
>> On 19 March 2018 at 16:31, Arend van Spriel
>> <arend.vanspriel@broadcom.com> wrote:
>>> On 3/19/2018 2:40 AM, Alexey Roslyakov wrote:
>>>>
>>>> In case if the host has higher align requirements for SG items, allow
>>>> setting device-specific aligns for scatterlist items.
>>>>
>>>> Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com>
>>>> ---
>>>> Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt | 5
>>>> +++++
>>>> 1 file changed, 5 insertions(+)
>>>>
>>>> diff --git
>>>> a/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>>>> b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>>>> index 86602f264dce..187b8c1b52a7 100644
>>>> --- a/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>>>> +++ b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>>>> @@ -17,6 +17,11 @@ Optional properties:
>>>> When not specified the device will use in-band SDIO interrupts.
>>>> - interrupt-names : name of the out-of-band interrupt, which must be
>>>> set
>>>> to "host-wake".
>>>> + - brcm,broken-sg-support : boolean flag to indicate that the SDIO host
>>>> + controller has higher align requirement than 32 bytes for each
>>>> + scatterlist item.
>>>> + - brcm,sd-head-align : alignment requirement for start of data buffer.
>>>> + - brcm,sd-sgentry-align : length alignment requirement for each sg
>>>> entry.
>>>
>>>
>>> Hi Alexey,
>>>
>>> Thanks for the patch. However, the problem with these is that they are
>>> characterizing the host controller and not the wireless device. So from
>>> device tree perspective , which is to describe the hardware, these
>>> properties should be SDIO host controller properties. Also I am not sure if
>>> the broken-sg-support is still needed. We added that for omap_hsmmc, but
>>> that has since changed to scatter-gather emulation so it might not be needed
>>> anymore.
>>>
>>> Regards,
>>> Arend
>>
>>
>>
>
>
^ permalink raw reply
* [PATCH bpf-next] bpf, doc: add description wrt native/bpf clang target and pointer size
From: Daniel Borkmann @ 2018-03-19 23:21 UTC (permalink / raw)
To: alexei.starovoitov; +Cc: netdev, Daniel Borkmann
As this recently came up on netdev [0], lets add it to the BPF devel doc.
[0] https://www.spinics.net/lists/netdev/msg489612.html
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
---
Documentation/bpf/bpf_devel_QA.txt | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/Documentation/bpf/bpf_devel_QA.txt b/Documentation/bpf/bpf_devel_QA.txt
index 84cbb30..1a0b704 100644
--- a/Documentation/bpf/bpf_devel_QA.txt
+++ b/Documentation/bpf/bpf_devel_QA.txt
@@ -539,6 +539,18 @@ A: Although LLVM IR generation and optimization try to stay architecture
The clang option "-fno-jump-tables" can be used to disable
switch table generation.
+ - For clang -target bpf, it is guaranteed that pointer or long /
+ unsigned long types will always have a width of 64 bit, no matter
+ whether underlying clang binary or default target (or kernel) is
+ 32 bit. However, when native clang target is used, then it will
+ compile these types based on the underlying architecture's conventions,
+ meaning in case of 32 bit architecture, pointer or long / unsigned
+ long types e.g. in BPF context structure will have width of 32 bit
+ while the BPF LLVM back end still operates in 64 bit. The native
+ target is mostly needed in tracing for the case of walking pt_regs
+ or other kernel structures where CPU's register width matters.
+ Otherwise, clang -target bpf is generally recommended.
+
You should use default target when:
- Your program includes a header file, e.g., ptrace.h, which eventually
--
2.9.5
^ permalink raw reply related
* Re: [PATCH v5 0/2] Remove false-positive VLAs when using max()
From: Linus Torvalds @ 2018-03-19 23:29 UTC (permalink / raw)
To: David Laight
Cc: Rasmus Villemoes, Kees Cook, Al Viro, Florian Weimer,
Andrew Morton, Josh Poimboeuf, Randy Dunlap, Miguel Ojeda,
Ingo Molnar, Ian Abbott, linux-input, linux-btrfs,
Network Development, Linux Kernel Mailing List, Kernel Hardening
In-Reply-To: <0e94e9582bec4373b5e21c612be179ac@AcuMS.aculab.com>
On Mon, Mar 19, 2018 at 2:43 AM, David Laight <David.Laight@aculab.com> wrote:
>
> Is it necessary to have the full checks for old versions of gcc?
>
> Even -Wvla could be predicated on very recent gcc - since we aren't
> worried about whether gcc decides to generate a vla, but whether
> the source requests one.
You are correct. We could just ignore the issue with old gcc versions,
and disable -Wvla rather than worry about it.
Linus
^ permalink raw reply
* Re: interdependencies with cxgb4 and iw_cxgb4
From: David Miller @ 2018-03-19 23:34 UTC (permalink / raw)
To: swise
Cc: rajur, dledford, linux-rdma, jgg, netdev, bharat, ganeshgr,
rahul.lakkireddy
In-Reply-To: <2cbb87bf-9020-2788-be75-1dd7f48f6c42@opengridcomputing.com>
From: Steve Wise <swise@opengridcomputing.com>
Date: Mon, 19 Mar 2018 14:50:57 -0500
> Let me ask a dumb question:� Why cannot one of the maintaners pull the
> commit from the other mainainer's git repo directly?� IE why have this
> third trusted/signed git repo that has to be on k.o, from which both
> maintainers pull?� If one of you can pull it in via a patch series,
> like you do for all other patches, and then notify the other
> maintainer to pull it from the first maintainers' repo if the series
> meets the requirements that it needs to be in both maintainers'
> repositories?� This avoids adding more staging git repos on k.o.� But
> probably I'm missing something...
Tree A may not want all of tree B's changes, and vice versa.
^ permalink raw reply
* Re: [PATCH 01/36] aio: don't print the page size at boot time
From: Darrick J. Wong @ 2018-03-20 0:11 UTC (permalink / raw)
To: Christoph Hellwig
Cc: viro, Avi Kivity, linux-aio, linux-fsdevel, netdev, linux-api,
linux-kernel
In-Reply-To: <20180305212743.16664-2-hch@lst.de>
On Mon, Mar 05, 2018 at 01:27:08PM -0800, Christoph Hellwig wrote:
> The page size is in no way related to the aio code, and printing it in
> the (debug) dmesg at every boot serves no purpose.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Acked-by: Jeff Moyer <jmoyer@redhat.com>
Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/aio.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/fs/aio.c b/fs/aio.c
> index a062d75109cb..03d59593912d 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -264,9 +264,6 @@ static int __init aio_setup(void)
>
> kiocb_cachep = KMEM_CACHE(aio_kiocb, SLAB_HWCACHE_ALIGN|SLAB_PANIC);
> kioctx_cachep = KMEM_CACHE(kioctx,SLAB_HWCACHE_ALIGN|SLAB_PANIC);
> -
> - pr_debug("sizeof(struct page) = %zu\n", sizeof(struct page));
> -
> return 0;
> }
> __initcall(aio_setup);
> --
> 2.14.2
>
--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org. For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
^ permalink raw reply
* Re: [PATCH 02/36] aio: remove an outdated comment in aio_complete
From: Darrick J. Wong @ 2018-03-20 0:12 UTC (permalink / raw)
To: Christoph Hellwig
Cc: viro, Avi Kivity, linux-aio, linux-fsdevel, netdev, linux-api,
linux-kernel
In-Reply-To: <20180305212743.16664-3-hch@lst.de>
On Mon, Mar 05, 2018 at 01:27:09PM -0800, Christoph Hellwig wrote:
> These days we don't treat sync iocbs special in the aio completion code as
> they never use it. Remove the old comment, and move the BUG_ON for a sync
> iocb to the top of the function.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Acked-by: Jeff Moyer <jmoyer@redhat.com>
Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/aio.c | 11 ++---------
> 1 file changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/fs/aio.c b/fs/aio.c
> index 03d59593912d..41fc8ce6bc7f 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -1088,6 +1088,8 @@ static void aio_complete(struct kiocb *kiocb, long res, long res2)
> unsigned tail, pos, head;
> unsigned long flags;
>
> + BUG_ON(is_sync_kiocb(kiocb));
> +
> if (kiocb->ki_flags & IOCB_WRITE) {
> struct file *file = kiocb->ki_filp;
>
> @@ -1100,15 +1102,6 @@ static void aio_complete(struct kiocb *kiocb, long res, long res2)
> file_end_write(file);
> }
>
> - /*
> - * Special case handling for sync iocbs:
> - * - events go directly into the iocb for fast handling
> - * - the sync task with the iocb in its stack holds the single iocb
> - * ref, no other paths have a way to get another ref
> - * - the sync task helpfully left a reference to itself in the iocb
> - */
> - BUG_ON(is_sync_kiocb(kiocb));
> -
> if (iocb->ki_list.next) {
> unsigned long flags;
>
> --
> 2.14.2
>
--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org. For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
^ permalink raw reply
* Re: [PATCH 03/36] aio: refactor read/write iocb setup
From: Darrick J. Wong @ 2018-03-20 0:19 UTC (permalink / raw)
To: Christoph Hellwig
Cc: viro, Avi Kivity, linux-aio, linux-fsdevel, netdev, linux-api,
linux-kernel
In-Reply-To: <20180305212743.16664-4-hch@lst.de>
On Mon, Mar 05, 2018 at 01:27:10PM -0800, Christoph Hellwig wrote:
> Don't reference the kiocb structure from the common aio code, and move
> any use of it into helper specific to the read/write path. This is in
> preparation for aio_poll support that wants to use the space for different
> fields.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Acked-by: Jeff Moyer <jmoyer@redhat.com>
Looks straightforward enough to me,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/aio.c | 171 ++++++++++++++++++++++++++++++++++++---------------------------
> 1 file changed, 97 insertions(+), 74 deletions(-)
>
> diff --git a/fs/aio.c b/fs/aio.c
> index 41fc8ce6bc7f..6295fc00f104 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -170,7 +170,9 @@ struct kioctx {
> #define KIOCB_CANCELLED ((void *) (~0ULL))
>
> struct aio_kiocb {
> - struct kiocb common;
> + union {
> + struct kiocb rw;
> + };
>
> struct kioctx *ki_ctx;
> kiocb_cancel_fn *ki_cancel;
> @@ -549,7 +551,7 @@ static int aio_setup_ring(struct kioctx *ctx, unsigned int nr_events)
>
> void kiocb_set_cancel_fn(struct kiocb *iocb, kiocb_cancel_fn *cancel)
> {
> - struct aio_kiocb *req = container_of(iocb, struct aio_kiocb, common);
> + struct aio_kiocb *req = container_of(iocb, struct aio_kiocb, rw);
> struct kioctx *ctx = req->ki_ctx;
> unsigned long flags;
>
> @@ -582,7 +584,7 @@ static int kiocb_cancel(struct aio_kiocb *kiocb)
> cancel = cmpxchg(&kiocb->ki_cancel, old, KIOCB_CANCELLED);
> } while (cancel != old);
>
> - return cancel(&kiocb->common);
> + return cancel(&kiocb->rw);
> }
>
> static void free_ioctx(struct work_struct *work)
> @@ -1040,15 +1042,6 @@ static inline struct aio_kiocb *aio_get_req(struct kioctx *ctx)
> return NULL;
> }
>
> -static void kiocb_free(struct aio_kiocb *req)
> -{
> - if (req->common.ki_filp)
> - fput(req->common.ki_filp);
> - if (req->ki_eventfd != NULL)
> - eventfd_ctx_put(req->ki_eventfd);
> - kmem_cache_free(kiocb_cachep, req);
> -}
> -
> static struct kioctx *lookup_ioctx(unsigned long ctx_id)
> {
> struct aio_ring __user *ring = (void __user *)ctx_id;
> @@ -1079,29 +1072,14 @@ static struct kioctx *lookup_ioctx(unsigned long ctx_id)
> /* aio_complete
> * Called when the io request on the given iocb is complete.
> */
> -static void aio_complete(struct kiocb *kiocb, long res, long res2)
> +static void aio_complete(struct aio_kiocb *iocb, long res, long res2)
> {
> - struct aio_kiocb *iocb = container_of(kiocb, struct aio_kiocb, common);
> struct kioctx *ctx = iocb->ki_ctx;
> struct aio_ring *ring;
> struct io_event *ev_page, *event;
> unsigned tail, pos, head;
> unsigned long flags;
>
> - BUG_ON(is_sync_kiocb(kiocb));
> -
> - if (kiocb->ki_flags & IOCB_WRITE) {
> - struct file *file = kiocb->ki_filp;
> -
> - /*
> - * Tell lockdep we inherited freeze protection from submission
> - * thread.
> - */
> - if (S_ISREG(file_inode(file)->i_mode))
> - __sb_writers_acquired(file_inode(file)->i_sb, SB_FREEZE_WRITE);
> - file_end_write(file);
> - }
> -
> if (iocb->ki_list.next) {
> unsigned long flags;
>
> @@ -1163,11 +1141,12 @@ static void aio_complete(struct kiocb *kiocb, long res, long res2)
> * eventfd. The eventfd_signal() function is safe to be called
> * from IRQ context.
> */
> - if (iocb->ki_eventfd != NULL)
> + if (iocb->ki_eventfd) {
> eventfd_signal(iocb->ki_eventfd, 1);
> + eventfd_ctx_put(iocb->ki_eventfd);
> + }
>
> - /* everything turned out well, dispose of the aiocb. */
> - kiocb_free(iocb);
> + kmem_cache_free(kiocb_cachep, iocb);
>
> /*
> * We have to order our ring_info tail store above and test
> @@ -1430,6 +1409,47 @@ SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx)
> return -EINVAL;
> }
>
> +static void aio_complete_rw(struct kiocb *kiocb, long res, long res2)
> +{
> + struct aio_kiocb *iocb = container_of(kiocb, struct aio_kiocb, rw);
> +
> + WARN_ON_ONCE(is_sync_kiocb(kiocb));
> +
> + if (kiocb->ki_flags & IOCB_WRITE) {
> + struct inode *inode = file_inode(kiocb->ki_filp);
> +
> + /*
> + * Tell lockdep we inherited freeze protection from submission
> + * thread.
> + */
> + if (S_ISREG(inode->i_mode))
> + __sb_writers_acquired(inode->i_sb, SB_FREEZE_WRITE);
> + file_end_write(kiocb->ki_filp);
> + }
> +
> + fput(kiocb->ki_filp);
> + aio_complete(iocb, res, res2);
> +}
> +
> +static int aio_prep_rw(struct kiocb *req, struct iocb *iocb)
> +{
> + int ret;
> +
> + req->ki_filp = fget(iocb->aio_fildes);
> + if (unlikely(!req->ki_filp))
> + return -EBADF;
> + req->ki_complete = aio_complete_rw;
> + req->ki_pos = iocb->aio_offset;
> + req->ki_flags = iocb_flags(req->ki_filp);
> + if (iocb->aio_flags & IOCB_FLAG_RESFD)
> + req->ki_flags |= IOCB_EVENTFD;
> + req->ki_hint = file_write_hint(req->ki_filp);
> + ret = kiocb_set_rw_flags(req, iocb->aio_rw_flags);
> + if (unlikely(ret))
> + fput(req->ki_filp);
> + return ret;
> +}
> +
> static int aio_setup_rw(int rw, struct iocb *iocb, struct iovec **iovec,
> bool vectored, bool compat, struct iov_iter *iter)
> {
> @@ -1449,7 +1469,7 @@ static int aio_setup_rw(int rw, struct iocb *iocb, struct iovec **iovec,
> return import_iovec(rw, buf, len, UIO_FASTIOV, iovec, iter);
> }
>
> -static inline ssize_t aio_ret(struct kiocb *req, ssize_t ret)
> +static inline ssize_t aio_rw_ret(struct kiocb *req, ssize_t ret)
> {
> switch (ret) {
> case -EIOCBQUEUED:
> @@ -1465,7 +1485,7 @@ static inline ssize_t aio_ret(struct kiocb *req, ssize_t ret)
> ret = -EINTR;
> /*FALLTHRU*/
> default:
> - aio_complete(req, ret, 0);
> + aio_complete_rw(req, ret, 0);
> return 0;
> }
> }
> @@ -1473,56 +1493,78 @@ static inline ssize_t aio_ret(struct kiocb *req, ssize_t ret)
> static ssize_t aio_read(struct kiocb *req, struct iocb *iocb, bool vectored,
> bool compat)
> {
> - struct file *file = req->ki_filp;
> struct iovec inline_vecs[UIO_FASTIOV], *iovec = inline_vecs;
> struct iov_iter iter;
> + struct file *file;
> ssize_t ret;
>
> + ret = aio_prep_rw(req, iocb);
> + if (ret)
> + return ret;
> + file = req->ki_filp;
> +
> + ret = -EBADF;
> if (unlikely(!(file->f_mode & FMODE_READ)))
> - return -EBADF;
> + goto out_fput;
> + ret = -EINVAL;
> if (unlikely(!file->f_op->read_iter))
> - return -EINVAL;
> + goto out_fput;
>
> ret = aio_setup_rw(READ, iocb, &iovec, vectored, compat, &iter);
> if (ret)
> - return ret;
> + goto out_fput;
> ret = rw_verify_area(READ, file, &req->ki_pos, iov_iter_count(&iter));
> if (!ret)
> - ret = aio_ret(req, call_read_iter(file, req, &iter));
> + ret = aio_rw_ret(req, call_read_iter(file, req, &iter));
> kfree(iovec);
> +out_fput:
> + if (unlikely(ret && ret != -EIOCBQUEUED))
> + fput(file);
> return ret;
> }
>
> static ssize_t aio_write(struct kiocb *req, struct iocb *iocb, bool vectored,
> bool compat)
> {
> - struct file *file = req->ki_filp;
> struct iovec inline_vecs[UIO_FASTIOV], *iovec = inline_vecs;
> struct iov_iter iter;
> + struct file *file;
> ssize_t ret;
>
> + ret = aio_prep_rw(req, iocb);
> + if (ret)
> + return ret;
> + file = req->ki_filp;
> +
> + ret = -EBADF;
> if (unlikely(!(file->f_mode & FMODE_WRITE)))
> - return -EBADF;
> + goto out_fput;
> + ret = -EINVAL;
> if (unlikely(!file->f_op->write_iter))
> - return -EINVAL;
> + goto out_fput;
>
> ret = aio_setup_rw(WRITE, iocb, &iovec, vectored, compat, &iter);
> if (ret)
> - return ret;
> + goto out_fput;
> ret = rw_verify_area(WRITE, file, &req->ki_pos, iov_iter_count(&iter));
> if (!ret) {
> + struct inode *inode = file_inode(file);
> +
> req->ki_flags |= IOCB_WRITE;
> file_start_write(file);
> - ret = aio_ret(req, call_write_iter(file, req, &iter));
> + ret = aio_rw_ret(req, call_write_iter(file, req, &iter));
> /*
> - * We release freeze protection in aio_complete(). Fool lockdep
> - * by telling it the lock got released so that it doesn't
> - * complain about held lock when we return to userspace.
> + * We release freeze protection in aio_complete_rw(). Fool
> + * lockdep by telling it the lock got released so that it
> + * doesn't complain about held lock when we return to userspace.
> */
> - if (S_ISREG(file_inode(file)->i_mode))
> - __sb_writers_release(file_inode(file)->i_sb, SB_FREEZE_WRITE);
> + if (S_ISREG(inode->i_mode))
> + __sb_writers_release(inode->i_sb, SB_FREEZE_WRITE);
> }
> kfree(iovec);
> +out_fput:
> + if (unlikely(ret && ret != -EIOCBQUEUED))
> + fput(file);
> return ret;
> }
>
> @@ -1530,7 +1572,6 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
> struct iocb *iocb, bool compat)
> {
> struct aio_kiocb *req;
> - struct file *file;
> ssize_t ret;
>
> /* enforce forwards compatibility on users */
> @@ -1553,16 +1594,6 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
> if (unlikely(!req))
> return -EAGAIN;
>
> - req->common.ki_filp = file = fget(iocb->aio_fildes);
> - if (unlikely(!req->common.ki_filp)) {
> - ret = -EBADF;
> - goto out_put_req;
> - }
> - req->common.ki_pos = iocb->aio_offset;
> - req->common.ki_complete = aio_complete;
> - req->common.ki_flags = iocb_flags(req->common.ki_filp);
> - req->common.ki_hint = file_write_hint(file);
> -
> if (iocb->aio_flags & IOCB_FLAG_RESFD) {
> /*
> * If the IOCB_FLAG_RESFD flag of aio_flags is set, get an
> @@ -1576,14 +1607,6 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
> req->ki_eventfd = NULL;
> goto out_put_req;
> }
> -
> - req->common.ki_flags |= IOCB_EVENTFD;
> - }
> -
> - ret = kiocb_set_rw_flags(&req->common, iocb->aio_rw_flags);
> - if (unlikely(ret)) {
> - pr_debug("EINVAL: aio_rw_flags\n");
> - goto out_put_req;
> }
>
> ret = put_user(KIOCB_KEY, &user_iocb->aio_key);
> @@ -1595,26 +1618,24 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
> req->ki_user_iocb = user_iocb;
> req->ki_user_data = iocb->aio_data;
>
> - get_file(file);
> switch (iocb->aio_lio_opcode) {
> case IOCB_CMD_PREAD:
> - ret = aio_read(&req->common, iocb, false, compat);
> + ret = aio_read(&req->rw, iocb, false, compat);
> break;
> case IOCB_CMD_PWRITE:
> - ret = aio_write(&req->common, iocb, false, compat);
> + ret = aio_write(&req->rw, iocb, false, compat);
> break;
> case IOCB_CMD_PREADV:
> - ret = aio_read(&req->common, iocb, true, compat);
> + ret = aio_read(&req->rw, iocb, true, compat);
> break;
> case IOCB_CMD_PWRITEV:
> - ret = aio_write(&req->common, iocb, true, compat);
> + ret = aio_write(&req->rw, iocb, true, compat);
> break;
> default:
> pr_debug("invalid aio operation %d\n", iocb->aio_lio_opcode);
> ret = -EINVAL;
> break;
> }
> - fput(file);
>
> if (ret && ret != -EIOCBQUEUED)
> goto out_put_req;
> @@ -1622,7 +1643,9 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
> out_put_req:
> put_reqs_available(ctx, 1);
> percpu_ref_put(&ctx->reqs);
> - kiocb_free(req);
> + if (req->ki_eventfd)
> + eventfd_ctx_put(req->ki_eventfd);
> + kmem_cache_free(kiocb_cachep, req);
> return ret;
> }
>
> --
> 2.14.2
>
--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org. For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
^ permalink raw reply
* Re: [PATCH 04/36] aio: sanitize ki_list handling
From: Darrick J. Wong @ 2018-03-20 0:21 UTC (permalink / raw)
To: Christoph Hellwig
Cc: viro, Avi Kivity, linux-aio, linux-fsdevel, netdev, linux-api,
linux-kernel
In-Reply-To: <20180305212743.16664-5-hch@lst.de>
On Mon, Mar 05, 2018 at 01:27:11PM -0800, Christoph Hellwig wrote:
> Instead of handcoded non-null checks always initialize ki_list to an
> empty list and use list_empty / list_empty_careful on it. While we're
> at it also error out on a double call to kiocb_set_cancel_fn instead
> of ignoring it.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Acked-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/aio.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/fs/aio.c b/fs/aio.c
> index 6295fc00f104..c32c315f05b5 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -555,13 +555,12 @@ void kiocb_set_cancel_fn(struct kiocb *iocb, kiocb_cancel_fn *cancel)
> struct kioctx *ctx = req->ki_ctx;
> unsigned long flags;
>
> - spin_lock_irqsave(&ctx->ctx_lock, flags);
> -
> - if (!req->ki_list.next)
> - list_add(&req->ki_list, &ctx->active_reqs);
> + if (WARN_ON_ONCE(!list_empty(&req->ki_list)))
> + return;
>
> + spin_lock_irqsave(&ctx->ctx_lock, flags);
> + list_add_tail(&req->ki_list, &ctx->active_reqs);
> req->ki_cancel = cancel;
> -
> spin_unlock_irqrestore(&ctx->ctx_lock, flags);
> }
> EXPORT_SYMBOL(kiocb_set_cancel_fn);
> @@ -1034,7 +1033,7 @@ static inline struct aio_kiocb *aio_get_req(struct kioctx *ctx)
> goto out_put;
>
> percpu_ref_get(&ctx->reqs);
> -
> + INIT_LIST_HEAD(&req->ki_list);
> req->ki_ctx = ctx;
> return req;
> out_put:
> @@ -1080,7 +1079,7 @@ static void aio_complete(struct aio_kiocb *iocb, long res, long res2)
> unsigned tail, pos, head;
> unsigned long flags;
>
> - if (iocb->ki_list.next) {
> + if (!list_empty_careful(iocb->ki_list.next)) {
> unsigned long flags;
>
> spin_lock_irqsave(&ctx->ctx_lock, flags);
> --
> 2.14.2
>
--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org. For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
^ permalink raw reply
* Re: [PATCH 05/36] aio: simplify cancellation
From: Darrick J. Wong @ 2018-03-20 0:25 UTC (permalink / raw)
To: Christoph Hellwig
Cc: viro, Avi Kivity, linux-aio, linux-fsdevel, netdev, linux-api,
linux-kernel
In-Reply-To: <20180305212743.16664-6-hch@lst.de>
On Mon, Mar 05, 2018 at 01:27:12PM -0800, Christoph Hellwig wrote:
> With the current aio code there is no need for the magic KIOCB_CANCELLED
> value, as a cancelation just kicks the driver to queue the completion
> ASAP, with all actual completion handling done in another thread. Given
> that both the completion path and cancelation take the context lock there
> is no need for magic cmpxchg loops either.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Acked-by: Jeff Moyer <jmoyer@redhat.com>
> ---
> fs/aio.c | 37 +++++++++----------------------------
> 1 file changed, 9 insertions(+), 28 deletions(-)
>
> diff --git a/fs/aio.c b/fs/aio.c
> index c32c315f05b5..2d40cf5dd4ec 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -156,19 +156,6 @@ struct kioctx {
> unsigned id;
> };
>
> -/*
> - * We use ki_cancel == KIOCB_CANCELLED to indicate that a kiocb has been either
> - * cancelled or completed (this makes a certain amount of sense because
> - * successful cancellation - io_cancel() - does deliver the completion to
> - * userspace).
> - *
> - * And since most things don't implement kiocb cancellation and we'd really like
> - * kiocb completion to be lockless when possible, we use ki_cancel to
> - * synchronize cancellation and completion - we only set it to KIOCB_CANCELLED
> - * with xchg() or cmpxchg(), see batch_complete_aio() and kiocb_cancel().
> - */
> -#define KIOCB_CANCELLED ((void *) (~0ULL))
> -
> struct aio_kiocb {
> union {
> struct kiocb rw;
> @@ -565,24 +552,18 @@ void kiocb_set_cancel_fn(struct kiocb *iocb, kiocb_cancel_fn *cancel)
> }
> EXPORT_SYMBOL(kiocb_set_cancel_fn);
>
> +/*
> + * Only cancel if there ws a ki_cancel function to start with, and we
> + * are the one how managed to clear it (to protect against simulatinious
"...are the one who managed to clear it (to protect against simultaneous
cancel calls)." ?
Really only complaining because who/how are both English words...
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> + * cancel calls).
> + */
> static int kiocb_cancel(struct aio_kiocb *kiocb)
> {
> - kiocb_cancel_fn *old, *cancel;
> -
> - /*
> - * Don't want to set kiocb->ki_cancel = KIOCB_CANCELLED unless it
> - * actually has a cancel function, hence the cmpxchg()
> - */
> -
> - cancel = READ_ONCE(kiocb->ki_cancel);
> - do {
> - if (!cancel || cancel == KIOCB_CANCELLED)
> - return -EINVAL;
> -
> - old = cancel;
> - cancel = cmpxchg(&kiocb->ki_cancel, old, KIOCB_CANCELLED);
> - } while (cancel != old);
> + kiocb_cancel_fn *cancel = kiocb->ki_cancel;
>
> + if (!cancel)
> + return -EINVAL;
> + kiocb->ki_cancel = NULL;
> return cancel(&kiocb->rw);
> }
>
> --
> 2.14.2
>
--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org. For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
^ permalink raw reply
* Re: [PATCH 06/36] aio: delete iocbs from the active_reqs list in kiocb_cancel
From: Darrick J. Wong @ 2018-03-20 0:34 UTC (permalink / raw)
To: Christoph Hellwig
Cc: viro, Avi Kivity, linux-aio, linux-fsdevel, netdev, linux-api,
linux-kernel
In-Reply-To: <20180305212743.16664-7-hch@lst.de>
On Mon, Mar 05, 2018 at 01:27:13PM -0800, Christoph Hellwig wrote:
> One we cancel an iocb there is no reason to keep it on the active_reqs
> list, given that the list is only used to look for cancelation candidates.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Acked-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/aio.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/aio.c b/fs/aio.c
> index 2d40cf5dd4ec..0b6394b4e528 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -561,6 +561,8 @@ static int kiocb_cancel(struct aio_kiocb *kiocb)
> {
> kiocb_cancel_fn *cancel = kiocb->ki_cancel;
>
> + list_del_init(&kiocb->ki_list);
> +
> if (!cancel)
> return -EINVAL;
> kiocb->ki_cancel = NULL;
> @@ -607,8 +609,6 @@ static void free_ioctx_users(struct percpu_ref *ref)
> while (!list_empty(&ctx->active_reqs)) {
> req = list_first_entry(&ctx->active_reqs,
> struct aio_kiocb, ki_list);
> -
> - list_del_init(&req->ki_list);
> kiocb_cancel(req);
> }
>
> --
> 2.14.2
>
--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org. For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
^ permalink raw reply
* [PATCH bpf-next] bpf: skip unnecessary capability check
From: Chenbo Feng @ 2018-03-20 0:57 UTC (permalink / raw)
To: netdev, ast; +Cc: Jeffrey Vander Stoep, lorenzo, Daniel Borkmann, Chenbo Feng
From: Chenbo Feng <fengc@google.com>
The current check statement in BPF syscall will do a capability check
for CAP_SYS_ADMIN before checking sysctl_unprivileged_bpf_disabled. This
code path will trigger unnecessary security hooks on capability checking
and cause false alarms on unprivileged process trying to get CAP_SYS_ADMIN
access. This can be resolved by simply switch the order of the statement
and CAP_SYS_ADMIN is not required anyway if unprivileged bpf syscall is
allowed.
Signed-off-by: Chenbo Feng <fengc@google.com>
---
kernel/bpf/syscall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index e24aa3241387..43f95d190eea 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -1845,7 +1845,7 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, siz
union bpf_attr attr = {};
int err;
- if (!capable(CAP_SYS_ADMIN) && sysctl_unprivileged_bpf_disabled)
+ if (sysctl_unprivileged_bpf_disabled && !capable(CAP_SYS_ADMIN))
return -EPERM;
err = check_uarg_tail_zero(uattr, sizeof(attr), size);
--
2.16.2.804.g6dcf76e118-goog
^ permalink raw reply related
* Re: [PATCH] net: gemini: fix memory leak
From: Linus Walleij @ 2018-03-20 0:58 UTC (permalink / raw)
To: Igor Pylypiv; +Cc: netdev, Hans Ulli Kroll, Linux ARM
In-Reply-To: <1521441651-19753-1-git-send-email-igor.pylypiv@gmail.com>
On Mon, Mar 19, 2018 at 7:40 AM, Igor Pylypiv <igor.pylypiv@gmail.com> wrote:
> cppcheck report:
> [drivers/net/ethernet/cortina/gemini.c:543]: (error) Memory leak: skb_tab
>
> Signed-off-by: Igor Pylypiv <igor.pylypiv@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply
* Re: [PATCH v2 0/2] net: phy: relax error checking when creating sysfs link netdev->phydev
From: David Miller @ 2018-03-20 1:15 UTC (permalink / raw)
To: grygorii.strashko
Cc: netdev, andrew, f.fainelli, gregkh, nsekhar, linux-kernel,
linux-omap
In-Reply-To: <20180316220835.30006-1-grygorii.strashko@ti.com>
From: Grygorii Strashko <grygorii.strashko@ti.com>
Date: Fri, 16 Mar 2018 17:08:33 -0500
> Some ethernet drivers (like TI CPSW) may connect and manage >1 Net PHYs per
> one netdevice, as result such drivers will produce warning during system
> boot and fail to connect second phy to netdevice when PHYLIB framework
> will try to create sysfs link netdev->phydev for second PHY
> in phy_attach_direct(), because sysfs link with the same name has been
> created already for the first PHY.
> As result, second CPSW external port will became unusable.
> This regression was introduced by commits:
> 5568363f0cb3 ("net: phy: Create sysfs reciprocal links for attached_dev/phydev"
> a3995460491d ("net: phy: Relax error checking on sysfs_create_link()"
>
> Patch 1: exports sysfs_create_link_nowarn() function as preparation for Patch 2.
> Patch 2: relaxes error checking when PHYLIB framework is creating sysfs
> link netdev->phydev in phy_attach_direct(), suppresses warning by using
> sysfs_create_link_nowarn() and adds error message instead, so links creation
> failure is not fatal any more and system can continue working,
> which fixes TI CPSW issue and makes boot logs accessible
> in case of NFS boot, for example.
Series applied and queued up for -stable, thanks.
^ permalink raw reply
* [PATCH bpf] bpf: fix crash due to inode i_op mismatch with clang/llvm
From: Daniel Borkmann @ 2018-03-20 1:17 UTC (permalink / raw)
To: alexei.starovoitov; +Cc: psodagud, torvalds, fengc, netdev, Daniel Borkmann
Prasad reported that he has seen crashes with netd on Android with
arm64 in the form of (note, the taint is unrelated):
[ 4134.721483] Unable to handle kernel paging request at virtual address 800000001
[ 4134.820925] Mem abort info:
[ 4134.901283] Exception class = DABT (current EL), IL = 32 bits
[ 4135.016736] SET = 0, FnV = 0
[ 4135.119820] EA = 0, S1PTW = 0
[ 4135.201431] Data abort info:
[ 4135.301388] ISV = 0, ISS = 0x00000021
[ 4135.359599] CM = 0, WnR = 0
[ 4135.470873] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffe39b946000
[ 4135.499757] [0000000800000001] *pgd=0000000000000000, *pud=0000000000000000
[ 4135.660725] Internal error: Oops: 96000021 [#1] PREEMPT SMP
[ 4135.674610] Modules linked in:
[ 4135.682883] CPU: 5 PID: 1260 Comm: netd Tainted: G S W 4.14.19+ #1
[ 4135.716188] task: ffffffe39f4aa380 task.stack: ffffff801d4e0000
[ 4135.731599] PC is at bpf_prog_add+0x20/0x68
[ 4135.741746] LR is at bpf_prog_inc+0x20/0x2c
[ 4135.751788] pc : [<ffffff94ab7ad584>] lr : [<ffffff94ab7ad638>] pstate: 60400145
[ 4135.769062] sp : ffffff801d4e3ce0
[...]
[ 4136.258315] Process netd (pid: 1260, stack limit = 0xffffff801d4e0000)
[ 4136.273746] Call trace:
[...]
[ 4136.442494] 3ca0: ffffff94ab7ad584 0000000060400145 ffffffe3a01bf8f8 0000000000000006
[ 4136.460936] 3cc0: 0000008000000000 ffffff94ab844204 ffffff801d4e3cf0 ffffff94ab7ad584
[ 4136.479241] [<ffffff94ab7ad584>] bpf_prog_add+0x20/0x68
[ 4136.491767] [<ffffff94ab7ad638>] bpf_prog_inc+0x20/0x2c
[ 4136.504536] [<ffffff94ab7b5d08>] bpf_obj_get_user+0x204/0x22c
[ 4136.518746] [<ffffff94ab7ade68>] SyS_bpf+0x5a8/0x1a88
Android's netd was basically pinning the uid cookie BPF map in BPF
fs (/sys/fs/bpf/traffic_cookie_uid_map) and later on retrieving it
again resulting in above panic. Issue is that the map was wrongly
identified as a prog.
Above kernel was compiled with clang 4.0.3, and it turns out that
clang decided to merge the bpf_prog_iops and bpf_map_iops into a
single memory location, such that the two i_ops could then not be
distinguished anymore.
Reason for this miscompilation is that clang has the more aggressive
-fmerge-all-constants enabled by default. In fact, clang source code
has an 'insightful' comment about it in its source code under
lib/AST/ExprConstant.cpp:
// Pointers with different bases cannot represent the same object.
// (Note that clang defaults to -fmerge-all-constants, which can
// lead to inconsistent results for comparisons involving the address
// of a constant; this generally doesn't matter in practice.)
gcc on the other hand does not enable -fmerge-all-constants by default
and *explicitly* states in it's option description that using this
flag results in non-conforming behavior, quote from man gcc:
Languages like C or C++ require each variable, including multiple
instances of the same variable in recursive calls, to have distinct
locations, so using this option results in non-conforming behavior.
Given there are users with clang/LLVM out there today that triggered
this, fix this mess by explicitly adding -fno-merge-all-constants to
inode.o as CFLAGS via Kbuild system. Also add a BUILD_BUG_ON() to
bail out when the two are the same address. Potentially we might want
to go even further and do this for the whole kernel as next step,
although given 4.16-rc6, it may be more suited to start out with this
in 4.17.
Reported-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Prasad Sodagudi <psodagud@codeaurora.org>
Acked-by: Alexei Starovoitov <ast@kernel.org>
---
kernel/bpf/Makefile | 7 +++++++
kernel/bpf/inode.c | 1 +
2 files changed, 8 insertions(+)
diff --git a/kernel/bpf/Makefile b/kernel/bpf/Makefile
index a713fd2..8950241 100644
--- a/kernel/bpf/Makefile
+++ b/kernel/bpf/Makefile
@@ -1,6 +1,13 @@
# SPDX-License-Identifier: GPL-2.0
obj-y := core.o
+# Mainly clang workaround that sets this by default. This
+# cannot be used here at all, otherwise it horribly breaks
+# inode ops for maps/progs. gcc does not set this flag by
+# default.
+CFLAGS_REMOVE_inode.o := -fmerge-all-constants
+CFLAGS_inode.o := $(call cc-option,-fno-merge-all-constants)
+
obj-$(CONFIG_BPF_SYSCALL) += syscall.o verifier.o inode.o helpers.o tnum.o
obj-$(CONFIG_BPF_SYSCALL) += hashtab.o arraymap.o percpu_freelist.o bpf_lru_list.o lpm_trie.o map_in_map.o
obj-$(CONFIG_BPF_SYSCALL) += disasm.o
diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c
index 81e2f69..ad95360 100644
--- a/kernel/bpf/inode.c
+++ b/kernel/bpf/inode.c
@@ -527,6 +527,7 @@ static int __init bpf_init(void)
if (ret)
sysfs_remove_mount_point(fs_kobj, "bpf");
+ BUILD_BUG_ON(&bpf_prog_iops == &bpf_map_iops);
return ret;
}
fs_initcall(bpf_init);
--
2.9.5
^ permalink raw reply related
* [PATCH v2 0/3] net: phy: Add general dummy stubs for MMD register access
From: Kevin Hao @ 2018-03-20 1:44 UTC (permalink / raw)
To: netdev; +Cc: Andrew Lunn, Florian Fainelli, Claudiu Manoil
v2:
As suggested by Andrew:
- Add general dummy stubs
- Also use that for the micrel phy
This patch series fix the Ethernet broken on the mpc8315erdb board introduced
by commit b6b5e8a69118 ("gianfar: Disable EEE autoneg by default").
Kevin Hao (3):
net: phy: Add general dummy stubs for MMD register access
net: phy: realtek: Use the dummy stubs for MMD register access for
rtl8211b
net: phy: micrel: Use the general dummy stubs for MMD register access
drivers/net/phy/micrel.c | 23 ++---------------------
drivers/net/phy/phy_device.c | 17 +++++++++++++++++
drivers/net/phy/realtek.c | 2 ++
include/linux/phy.h | 4 ++++
4 files changed, 25 insertions(+), 21 deletions(-)
--
2.9.3
^ permalink raw reply
* [PATCH v2 1/3] net: phy: Add general dummy stubs for MMD register access
From: Kevin Hao @ 2018-03-20 1:44 UTC (permalink / raw)
To: netdev; +Cc: Andrew Lunn, Florian Fainelli, Claudiu Manoil, Kevin Hao
In-Reply-To: <20180320014454.12697-1-haokexin@gmail.com>
For some phy devices, even though they don't support the MMD extended
register access, it does have some side effect if we are trying to
read/write the MMD registers via indirect method. So introduce general
dummy stubs for MMD register access which these devices can use to avoid
such side effect.
Fixes: b6b5e8a69118 ("gianfar: Disable EEE autoneg by default")
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
drivers/net/phy/phy_device.c | 17 +++++++++++++++++
include/linux/phy.h | 4 ++++
2 files changed, 21 insertions(+)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index b285323327c4..b070f8fd66fe 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1666,6 +1666,23 @@ int genphy_config_init(struct phy_device *phydev)
}
EXPORT_SYMBOL(genphy_config_init);
+/* This is used for the phy device which doesn't support the MMD extended
+ * register access, but it does have side effect when we are trying to access
+ * the MMD register via indirect method.
+ */
+int genphy_read_mmd_unsupported(struct phy_device *phdev, int devad, u16 regnum)
+{
+ return -EOPNOTSUPP;
+}
+EXPORT_SYMBOL(genphy_read_mmd_unsupported);
+
+int genphy_write_mmd_unsupported(struct phy_device *phdev, int devnum,
+ u16 regnum, u16 val)
+{
+ return -EOPNOTSUPP;
+}
+EXPORT_SYMBOL(genphy_write_mmd_unsupported);
+
int genphy_suspend(struct phy_device *phydev)
{
return phy_set_bits(phydev, MII_BMCR, BMCR_PDOWN);
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 68127b002c3d..f0b5870a6d40 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -984,6 +984,10 @@ static inline int genphy_no_soft_reset(struct phy_device *phydev)
{
return 0;
}
+int genphy_read_mmd_unsupported(struct phy_device *phdev, int devad,
+ u16 regnum);
+int genphy_write_mmd_unsupported(struct phy_device *phdev, int devnum,
+ u16 regnum, u16 val);
/* Clause 45 PHY */
int genphy_c45_restart_aneg(struct phy_device *phydev);
--
2.9.3
^ permalink raw reply related
* [PATCH v2 2/3] net: phy: realtek: Use the dummy stubs for MMD register access for rtl8211b
From: Kevin Hao @ 2018-03-20 1:44 UTC (permalink / raw)
To: netdev; +Cc: Andrew Lunn, Florian Fainelli, Claudiu Manoil, Kevin Hao
In-Reply-To: <20180320014454.12697-1-haokexin@gmail.com>
The Ethernet on mpc8315erdb is broken since commit b6b5e8a69118
("gianfar: Disable EEE autoneg by default"). The reason is that
even though the rtl8211b doesn't support the MMD extended registers
access, it does return some random values if we trying to access
the MMD register via indirect method. This makes it seem that the
EEE is supported by this phy device. And the subsequent writing to
the MMD registers does cause the phy malfunction. So use the dummy
stubs for the MMD register access to fix this issue.
Fixes: b6b5e8a69118 ("gianfar: Disable EEE autoneg by default")
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
drivers/net/phy/realtek.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index ee3ca4a2f12b..9f48ecf9c627 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -172,6 +172,8 @@ static struct phy_driver realtek_drvs[] = {
.flags = PHY_HAS_INTERRUPT,
.ack_interrupt = &rtl821x_ack_interrupt,
.config_intr = &rtl8211b_config_intr,
+ .read_mmd = &genphy_read_mmd_unsupported,
+ .write_mmd = &genphy_write_mmd_unsupported,
}, {
.phy_id = 0x001cc914,
.name = "RTL8211DN Gigabit Ethernet",
--
2.9.3
^ permalink raw reply related
* [PATCH v2 3/3] net: phy: micrel: Use the general dummy stubs for MMD register access
From: Kevin Hao @ 2018-03-20 1:44 UTC (permalink / raw)
To: netdev; +Cc: Andrew Lunn, Florian Fainelli, Claudiu Manoil, Kevin Hao
In-Reply-To: <20180320014454.12697-1-haokexin@gmail.com>
The new general dummy stubs for MMD register access were introduced.
Use that for the codes reuse.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
drivers/net/phy/micrel.c | 23 ++---------------------
1 file changed, 2 insertions(+), 21 deletions(-)
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 49be85afbea9..f41b224a9cdb 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -635,25 +635,6 @@ static int ksz8873mll_config_aneg(struct phy_device *phydev)
return 0;
}
-/* This routine returns -1 as an indication to the caller that the
- * Micrel ksz9021 10/100/1000 PHY does not support standard IEEE
- * MMD extended PHY registers.
- */
-static int
-ksz9021_rd_mmd_phyreg(struct phy_device *phydev, int devad, u16 regnum)
-{
- return -1;
-}
-
-/* This routine does nothing since the Micrel ksz9021 does not support
- * standard IEEE MMD extended PHY registers.
- */
-static int
-ksz9021_wr_mmd_phyreg(struct phy_device *phydev, int devad, u16 regnum, u16 val)
-{
- return -1;
-}
-
static int kszphy_get_sset_count(struct phy_device *phydev)
{
return ARRAY_SIZE(kszphy_hw_stats);
@@ -946,8 +927,8 @@ static struct phy_driver ksphy_driver[] = {
.get_stats = kszphy_get_stats,
.suspend = genphy_suspend,
.resume = genphy_resume,
- .read_mmd = ksz9021_rd_mmd_phyreg,
- .write_mmd = ksz9021_wr_mmd_phyreg,
+ .read_mmd = genphy_read_mmd_unsupported,
+ .write_mmd = genphy_write_mmd_unsupported,
}, {
.phy_id = PHY_ID_KSZ9031,
.phy_id_mask = MICREL_PHY_ID_MASK,
--
2.9.3
^ permalink raw reply related
* Re: [PATCH bpf] bpf: fix crash due to inode i_op mismatch with clang/llvm
From: Linus Torvalds @ 2018-03-20 1:50 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: Alexei Starovoitov, psodagud, fengc, Network Development
In-Reply-To: <20180320011706.31793-1-daniel@iogearbox.net>
On Mon, Mar 19, 2018 at 6:17 PM, Daniel Borkmann <daniel@iogearbox.net> wrote:
>
> Reason for this miscompilation is that clang has the more aggressive
> -fmerge-all-constants enabled by default. In fact, clang source code
> has an 'insightful' comment about it in its source code under
> lib/AST/ExprConstant.cpp:
>
> // Pointers with different bases cannot represent the same object.
> // (Note that clang defaults to -fmerge-all-constants, which can
> // lead to inconsistent results for comparisons involving the address
> // of a constant; this generally doesn't matter in practice.)
>
> gcc on the other hand does not enable -fmerge-all-constants by default
> and *explicitly* states in it's option description that using this
> flag results in non-conforming behavior, quote from man gcc:
>
> Languages like C or C++ require each variable, including multiple
> instances of the same variable in recursive calls, to have distinct
> locations, so using this option results in non-conforming behavior.
>
> Given there are users with clang/LLVM out there today that triggered
> this, fix this mess by explicitly adding -fno-merge-all-constants to
> inode.o as CFLAGS via Kbuild system.
Oh, please do *NOT* add it to just that one file.
Add it to everything. If it's an invalid optimization, it shouldn't be on.
And even if it happens to trigger in only that one file, then
disabling it globally is just the safe thing to do.
What is the code generation difference if you just enable it globally?
I would certainly _hope_ that it's not noticeable, but if it's
noticeable that would certainly imply that it's very dangerous
somewhere else too!
Linus
^ permalink raw reply
* Re: [PATCH bpf] bpf: fix crash due to inode i_op mismatch with clang/llvm
From: Linus Torvalds @ 2018-03-20 2:06 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: Alexei Starovoitov, psodagud, fengc, Network Development
In-Reply-To: <CA+55aFyjU4nLn4jykr1aYH7X7u-FruZjOLZ+OJnH_1RbfEimAQ@mail.gmail.com>
On Mon, Mar 19, 2018 at 6:50 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> Add it to everything. If it's an invalid optimization, it shouldn't be on.
IOW, why isn't this just something like
diff --git a/Makefile b/Makefile
index d65e2e229017..01abedc2e79f 100644
--- a/Makefile
+++ b/Makefile
@@ -826,6 +826,9 @@ KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign)
# disable invalid "can't wrap" optimizations for signed / pointers
KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
+# disable invalid optimization on clang
+KBUILD_CFLAGS += $(call cc-option,-fno-merge-all-constants)
+
# Make sure -fstack-check isn't enabled (like gentoo apparently did)
KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,)
(whitespace-damaged, but you get the gist of it).
We disable some optimizations that are technically _valid_, because
they are too dangerous and a bad idea.
Disabling an optimization that isn't valid EVEN IN THEORY is an
absolute no-brainer, particularly if it has already shown itself to
cause problems.
We have other situations where we generate multiple static structures
and expect them to be unique. I'm not sure any of them would trigger
the clang rules, but the clang rules are obviously complete garbage
anyway, so who knows?
That optimization seems to teuly be pure and utter garbage. Clang can
even *see* the address comparison happening in that file.
Some clang person needs to be publicly shamed for enabling this kind
of garbage by default, particularly since they apparently _knew_ it
was invalid.
Linus
^ permalink raw reply
* Re: [PATCH 08/36] aio: implement io_pgetevents
From: Darrick J. Wong @ 2018-03-20 2:12 UTC (permalink / raw)
To: Christoph Hellwig
Cc: viro, Avi Kivity, linux-aio, linux-fsdevel, netdev, linux-api,
linux-kernel
In-Reply-To: <20180305212743.16664-9-hch@lst.de>
On Mon, Mar 05, 2018 at 01:27:15PM -0800, Christoph Hellwig wrote:
> This is the io_getevents equivalent of ppoll/pselect and allows to
> properly mix signals and aio completions (especially with IOCB_CMD_POLL)
> and atomically executes the following sequence:
>
> sigset_t origmask;
>
> pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);
> ret = io_getevents(ctx, min_nr, nr, events, timeout);
> pthread_sigmask(SIG_SETMASK, &origmask, NULL);
>
> Note that unlike many other signal related calls we do not pass a sigmask
> size, as that would get us to 7 arguments, which aren't easily supported
> by the syscall infrastructure. It seems a lot less painful to just add a
> new syscall variant in the unlikely case we're going to increase the
> sigset size.
I'm assuming there's a proposed manpage update for this somewhere? :)
--D
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> arch/x86/entry/syscalls/syscall_32.tbl | 1 +
> arch/x86/entry/syscalls/syscall_64.tbl | 1 +
> fs/aio.c | 114 ++++++++++++++++++++++++++++++---
> include/linux/compat.h | 7 ++
> include/linux/syscalls.h | 6 ++
> include/uapi/asm-generic/unistd.h | 4 +-
> include/uapi/linux/aio_abi.h | 6 ++
> kernel/sys_ni.c | 2 +
> 8 files changed, 130 insertions(+), 11 deletions(-)
>
> diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl
> index 448ac2161112..5997c3e9ac3e 100644
> --- a/arch/x86/entry/syscalls/syscall_32.tbl
> +++ b/arch/x86/entry/syscalls/syscall_32.tbl
> @@ -391,3 +391,4 @@
> 382 i386 pkey_free sys_pkey_free
> 383 i386 statx sys_statx
> 384 i386 arch_prctl sys_arch_prctl compat_sys_arch_prctl
> +385 i386 io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents
> diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl
> index 5aef183e2f85..e995cd2b4e65 100644
> --- a/arch/x86/entry/syscalls/syscall_64.tbl
> +++ b/arch/x86/entry/syscalls/syscall_64.tbl
> @@ -339,6 +339,7 @@
> 330 common pkey_alloc sys_pkey_alloc
> 331 common pkey_free sys_pkey_free
> 332 common statx sys_statx
> +333 common io_pgetevents sys_io_pgetevents
>
> #
> # x32-specific system call numbers start at 512 to avoid cache impact
> diff --git a/fs/aio.c b/fs/aio.c
> index 9d7d6e4cde87..da87cbf7c67a 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -1291,10 +1291,6 @@ static long read_events(struct kioctx *ctx, long min_nr, long nr,
> wait_event_interruptible_hrtimeout(ctx->wait,
> aio_read_events(ctx, min_nr, nr, event, &ret),
> until);
> -
> - if (!ret && signal_pending(current))
> - ret = -EINTR;
> -
> return ret;
> }
>
> @@ -1874,13 +1870,60 @@ SYSCALL_DEFINE5(io_getevents, aio_context_t, ctx_id,
> struct timespec __user *, timeout)
> {
> struct timespec64 ts;
> + int ret;
> +
> + if (timeout && unlikely(get_timespec64(&ts, timeout)))
> + return -EFAULT;
> +
> + ret = do_io_getevents(ctx_id, min_nr, nr, events, timeout ? &ts : NULL);
> + if (!ret && signal_pending(current))
> + ret = -EINTR;
> + return ret;
> +}
> +
> +SYSCALL_DEFINE6(io_pgetevents,
> + aio_context_t, ctx_id,
> + long, min_nr,
> + long, nr,
> + struct io_event __user *, events,
> + struct timespec __user *, timeout,
> + const struct __aio_sigset __user *, usig)
> +{
> + struct __aio_sigset ksig = { NULL, };
> + sigset_t ksigmask, sigsaved;
> + struct timespec64 ts;
> + int ret;
> +
> + if (timeout && unlikely(get_timespec64(&ts, timeout)))
> + return -EFAULT;
>
> - if (timeout) {
> - if (unlikely(get_timespec64(&ts, timeout)))
> + if (usig && copy_from_user(&ksig, usig, sizeof(ksig)))
> + return -EFAULT;
> +
> + if (ksig.sigmask) {
> + if (ksig.sigsetsize != sizeof(sigset_t))
> + return -EINVAL;
> + if (copy_from_user(&ksigmask, ksig.sigmask, sizeof(ksigmask)))
> return -EFAULT;
> + sigdelsetmask(&ksigmask, sigmask(SIGKILL) | sigmask(SIGSTOP));
> + sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved);
> + }
> +
> + ret = do_io_getevents(ctx_id, min_nr, nr, events, timeout ? &ts : NULL);
> + if (signal_pending(current)) {
> + if (ksig.sigmask) {
> + current->saved_sigmask = sigsaved;
> + set_restore_sigmask();
> + }
> +
> + if (!ret)
> + ret = -ERESTARTNOHAND;
> + } else {
> + if (ksig.sigmask)
> + sigprocmask(SIG_SETMASK, &sigsaved, NULL);
> }
>
> - return do_io_getevents(ctx_id, min_nr, nr, events, timeout ? &ts : NULL);
> + return ret;
> }
>
> #ifdef CONFIG_COMPAT
> @@ -1891,13 +1934,64 @@ COMPAT_SYSCALL_DEFINE5(io_getevents, compat_aio_context_t, ctx_id,
> struct compat_timespec __user *, timeout)
> {
> struct timespec64 t;
> + int ret;
> +
> + if (timeout && compat_get_timespec64(&t, timeout))
> + return -EFAULT;
> +
> + ret = do_io_getevents(ctx_id, min_nr, nr, events, timeout ? &t : NULL);
> + if (!ret && signal_pending(current))
> + ret = -EINTR;
> + return ret;
> +}
> +
> +
> +struct __compat_aio_sigset {
> + compat_sigset_t __user *sigmask;
> + compat_size_t sigsetsize;
> +};
> +
> +COMPAT_SYSCALL_DEFINE6(io_pgetevents,
> + compat_aio_context_t, ctx_id,
> + compat_long_t, min_nr,
> + compat_long_t, nr,
> + struct io_event __user *, events,
> + struct compat_timespec __user *, timeout,
> + const struct __compat_aio_sigset __user *, usig)
> +{
> + struct __compat_aio_sigset ksig = { NULL, };
> + sigset_t ksigmask, sigsaved;
> + struct timespec64 t;
> + int ret;
> +
> + if (timeout && compat_get_timespec64(&t, timeout))
> + return -EFAULT;
>
> - if (timeout) {
> - if (compat_get_timespec64(&t, timeout))
> + if (usig && copy_from_user(&ksig, usig, sizeof(ksig)))
> + return -EFAULT;
> +
> + if (ksig.sigmask) {
> + if (ksig.sigsetsize != sizeof(compat_sigset_t))
> + return -EINVAL;
> + if (get_compat_sigset(&ksigmask, ksig.sigmask))
> return -EFAULT;
> + sigdelsetmask(&ksigmask, sigmask(SIGKILL) | sigmask(SIGSTOP));
> + sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved);
> + }
>
> + ret = do_io_getevents(ctx_id, min_nr, nr, events, timeout ? &t : NULL);
> + if (signal_pending(current)) {
> + if (ksig.sigmask) {
> + current->saved_sigmask = sigsaved;
> + set_restore_sigmask();
> + }
> + if (!ret)
> + ret = -ERESTARTNOHAND;
> + } else {
> + if (ksig.sigmask)
> + sigprocmask(SIG_SETMASK, &sigsaved, NULL);
> }
>
> - return do_io_getevents(ctx_id, min_nr, nr, events, timeout ? &t : NULL);
> + return ret;
> }
> #endif
> diff --git a/include/linux/compat.h b/include/linux/compat.h
> index 8a9643857c4a..bfb8a94fbabd 100644
> --- a/include/linux/compat.h
> +++ b/include/linux/compat.h
> @@ -303,6 +303,7 @@ extern int put_compat_rusage(const struct rusage *,
> struct compat_rusage __user *);
>
> struct compat_siginfo;
> +struct __compat_aio_sigset;
>
> extern asmlinkage long compat_sys_waitid(int, compat_pid_t,
> struct compat_siginfo __user *, int,
> @@ -634,6 +635,12 @@ asmlinkage long compat_sys_io_getevents(compat_aio_context_t ctx_id,
> compat_long_t nr,
> struct io_event __user *events,
> struct compat_timespec __user *timeout);
> +asmlinkage long compat_sys_io_pgetevents(compat_aio_context_t ctx_id,
> + compat_long_t min_nr,
> + compat_long_t nr,
> + struct io_event __user *events,
> + struct compat_timespec __user *timeout,
> + const struct __compat_aio_sigset __user *usig);
> asmlinkage long compat_sys_io_submit(compat_aio_context_t ctx_id, int nr,
> u32 __user *iocb);
> asmlinkage long compat_sys_mount(const char __user *dev_name,
> diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
> index a78186d826d7..8515ec53c81b 100644
> --- a/include/linux/syscalls.h
> +++ b/include/linux/syscalls.h
> @@ -539,6 +539,12 @@ asmlinkage long sys_io_getevents(aio_context_t ctx_id,
> long nr,
> struct io_event __user *events,
> struct timespec __user *timeout);
> +asmlinkage long sys_io_pgetevents(aio_context_t ctx_id,
> + long min_nr,
> + long nr,
> + struct io_event __user *events,
> + struct timespec __user *timeout,
> + const struct __aio_sigset *sig);
> asmlinkage long sys_io_submit(aio_context_t, long,
> struct iocb __user * __user *);
> asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb,
> diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
> index 8b87de067bc7..ce2ebbeece10 100644
> --- a/include/uapi/asm-generic/unistd.h
> +++ b/include/uapi/asm-generic/unistd.h
> @@ -732,9 +732,11 @@ __SYSCALL(__NR_pkey_alloc, sys_pkey_alloc)
> __SYSCALL(__NR_pkey_free, sys_pkey_free)
> #define __NR_statx 291
> __SYSCALL(__NR_statx, sys_statx)
> +#define __NR_io_pgetevents 292
> +__SC_COMP(__NR_io_pgetevents, sys_io_pgetevents, compat_sys_io_pgetevents)
>
> #undef __NR_syscalls
> -#define __NR_syscalls 292
> +#define __NR_syscalls 293
>
> /*
> * All syscalls below here should go away really,
> diff --git a/include/uapi/linux/aio_abi.h b/include/uapi/linux/aio_abi.h
> index a04adbc70ddf..2c0a3415beee 100644
> --- a/include/uapi/linux/aio_abi.h
> +++ b/include/uapi/linux/aio_abi.h
> @@ -29,6 +29,7 @@
>
> #include <linux/types.h>
> #include <linux/fs.h>
> +#include <linux/signal.h>
> #include <asm/byteorder.h>
>
> typedef __kernel_ulong_t aio_context_t;
> @@ -108,5 +109,10 @@ struct iocb {
> #undef IFBIG
> #undef IFLITTLE
>
> +struct __aio_sigset {
> + sigset_t __user *sigmask;
> + size_t sigsetsize;
> +};
> +
> #endif /* __LINUX__AIO_ABI_H */
>
> diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
> index b5189762d275..8f7705559b38 100644
> --- a/kernel/sys_ni.c
> +++ b/kernel/sys_ni.c
> @@ -151,9 +151,11 @@ cond_syscall(sys_io_destroy);
> cond_syscall(sys_io_submit);
> cond_syscall(sys_io_cancel);
> cond_syscall(sys_io_getevents);
> +cond_syscall(sys_io_pgetevents);
> cond_syscall(compat_sys_io_setup);
> cond_syscall(compat_sys_io_submit);
> cond_syscall(compat_sys_io_getevents);
> +cond_syscall(compat_sys_io_pgetevents);
> cond_syscall(sys_sysfs);
> cond_syscall(sys_syslog);
> cond_syscall(sys_process_vm_readv);
> --
> 2.14.2
>
--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org. For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
^ permalink raw reply
* Re: [PATCH 09/36] fs: unexport poll_schedule_timeout
From: Darrick J. Wong @ 2018-03-20 2:13 UTC (permalink / raw)
To: Christoph Hellwig
Cc: viro, Avi Kivity, linux-aio, linux-fsdevel, netdev, linux-api,
linux-kernel
In-Reply-To: <20180305212743.16664-10-hch@lst.de>
On Mon, Mar 05, 2018 at 01:27:16PM -0800, Christoph Hellwig wrote:
> No users outside of select.c.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/select.c | 3 +--
> include/linux/poll.h | 2 --
> 2 files changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/fs/select.c b/fs/select.c
> index b6c36254028a..686de7b3a1db 100644
> --- a/fs/select.c
> +++ b/fs/select.c
> @@ -233,7 +233,7 @@ static void __pollwait(struct file *filp, wait_queue_head_t *wait_address,
> add_wait_queue(wait_address, &entry->wait);
> }
>
> -int poll_schedule_timeout(struct poll_wqueues *pwq, int state,
> +static int poll_schedule_timeout(struct poll_wqueues *pwq, int state,
> ktime_t *expires, unsigned long slack)
> {
> int rc = -EINTR;
> @@ -258,7 +258,6 @@ int poll_schedule_timeout(struct poll_wqueues *pwq, int state,
>
> return rc;
> }
> -EXPORT_SYMBOL(poll_schedule_timeout);
>
> /**
> * poll_select_set_timeout - helper function to setup the timeout value
> diff --git a/include/linux/poll.h b/include/linux/poll.h
> index f45ebd017eaa..a3576da63377 100644
> --- a/include/linux/poll.h
> +++ b/include/linux/poll.h
> @@ -96,8 +96,6 @@ struct poll_wqueues {
>
> extern void poll_initwait(struct poll_wqueues *pwq);
> extern void poll_freewait(struct poll_wqueues *pwq);
> -extern int poll_schedule_timeout(struct poll_wqueues *pwq, int state,
> - ktime_t *expires, unsigned long slack);
> extern u64 select_estimate_accuracy(struct timespec64 *tv);
>
> #define MAX_INT64_SECONDS (((s64)(~((u64)0)>>1)/HZ)-1)
> --
> 2.14.2
>
--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org. For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
^ permalink raw reply
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