* [4.9-stable 0/9] patches for 'randconfig'
@ 2018-02-19 10:13 Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 1/9] kasan: rework Kconfig settings Arnd Bergmann
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: Arnd Bergmann @ 2018-02-19 10:13 UTC (permalink / raw)
To: stable; +Cc: Greg KH, linux-kernel, Arnd Bergmann
As discussed with Greg, I've had my randconfig builder build 4.9-stable kernels
over the weekend, here is what it found missing. There are 45 patches that can
be backported cleanly from mainline, plus another 9 that are either not part of
mainline because the problem no longer exists there (e.g. file was removed), or
the backport required context changes.
Most of these should also apply to 4.4, but I have not tried that yet.
Arnd
ac29fc66855b drm/i915: fix intel_backlight_device_register declaration
23f919d4ad0e shmem: avoid maybe-uninitialized warning
aa01338c0184 clk: sunxi-ng: fix build error without CONFIG_RESET_CONTROLLER
fbdf0e28d061 vmxnet3: prevent building with 64K pages
11d8b05855f3 perf/x86: Shut up false-positive -Wmaybe-uninitialized warning
42db500a551f PCI: vmd: Fix suspend handlers defined-but-not-used warning
fbc2a294f29e gpio: intel-mid: Fix build warning when !CONFIG_PM
b4aca383f9af platform/x86: intel_mid_thermal: Fix suspend handlers unused warning
c8bd2ac3b4c6 usb: musb: fix compilation warning on unused function
de5bbdd01cf9 PCI: Change pci_host_common_probe() visibility
c0bfc549e962 perf: xgene: Include module.h
484c7bbf2649 video: fbdev: via: remove possibly unused variables
067fdeb2f391 dmaengine: zx: fix build warning
f46e7cd36b5f scsi: advansys: fix build warning for PCI=n
d4b2ac63b0ea x86/ras/inject: Make it depend on X86_LOCAL_APIC=y
b115bebc07f2 gpio: xgene: mark PM functions as __maybe_unused
f13d52cb3fad arm64: define BUG() instruction without CONFIG_BUG
75e2f0a6b161 x86/fpu/math-emu: Fix possible uninitialized variable use
e572d0887137 tools build: Add tools tree support for 'make -s'
d460131dd505 x86/build: Silence the build with "make -s"
68fd77cf8a4b thermal: fix INTEL_SOC_DTS_IOSF_CORE dependencies
c2ce3f5d89d5 x86: add MULTIUSER dependency for KVM
d689c64d189e x86/platform: Add PCI dependency for PUNIT_ATOM_DEBUG
3ba5b5ea7dc3 x86/vm86: Fix unused variable warning if THP is disabled
44a5b977128c scsi: advansys: fix uninitialized data access
2e449048a25e arm64: Kconfig: select COMPAT_BINFMT_ELF only when BINFMT_ELF is set
46a049dae771 ALSA: hda/ca0132 - fix possible NULL pointer use
ab4949640d66 reiserfs: avoid a -Wmaybe-uninitialized warning
7fc1503c906f cw1200: fix bogus maybe-uninitialized warning
3cd18d198173 security/keys: BIG_KEY requires CONFIG_CRYPTO
7e1751001818 drm: exynos: mark pm functions as __maybe_unused
9e343e87d2c4 mtd: cfi: convert inline functions to macros
3cd890dbe2a4 media: dvb-frontends: fix i2c access helpers for KASAN
d4c2269b3d5d rbd: silence bogus -Wmaybe-uninitialized warning
b74c0a9969f2 drm/nouveau: hide gcc-4.9 -Wmaybe-uninitialized
ea4348c8462a Input: tca8418_keypad - hide gcc-4.9 -Wmaybe-uninitialized warning
16c3ada89cff media: r820t: fix r820t_write_reg for KASAN
e42eef4ba388 KVM: add X86_LOCAL_APIC dependency
f1f5929cd971 shmem: fix compilation warnings on unused functions
3538aa6ecfb2 [media] tc358743: fix register i2c_rd/wr functions
fa6317eedd63 [media] go7007: add MEDIA_CAMERA_SUPPORT dependency
190b23b4eb99 [media] em28xx: only use mt9v011 if camera support is enabled
27430d19a916 [media] tw5864: use dev_warn instead of WARN to shut up warning
27d807180ae0 ISDN: eicon: reduce stack size of sig_ind function
dbed87a9d3a8 clk: meson: gxbb: fix build error without RESET_CONTROLLER
Arnd Bergmann (8):
kasan: rework Kconfig settings
drm/i915: hide unused intel_panel_set_backlight function
arm64: sunxi: always enable reset controller
binfmt_elf: compat: avoid unused function warning
spi: bcm-qspi: shut up warning about cfi header inclusion
idle: i7300: add PCI dependency
arm64: fix warning about swapper_pg_dir overflow
usb: phy: msm add regulator dependency
Borislav Petkov (1):
x86/microcode/AMD: Change load_microcode_amd()'s param to bool to fix
preemptibility bug
arch/arm64/Kconfig.platforms | 2 +
arch/arm64/mm/mmu.c | 2 +-
arch/x86/include/asm/microcode_amd.h | 1 -
arch/x86/kernel/cpu/microcode/amd.c | 17 ++++---
drivers/gpu/drm/i915/intel_panel.c | 86 ++++++++++++++++++------------------
drivers/idle/Kconfig | 1 +
drivers/spi/Kconfig | 1 +
drivers/usb/phy/Kconfig | 1 +
fs/compat_binfmt_elf.c | 2 +
lib/Kconfig.debug | 1 -
10 files changed, 62 insertions(+), 52 deletions(-)
--
2.9.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [4.9-stable 1/9] kasan: rework Kconfig settings
2018-02-19 10:13 [4.9-stable 0/9] patches for 'randconfig' Arnd Bergmann
@ 2018-02-19 10:13 ` Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 2/9] drm/i915: hide unused intel_panel_set_backlight function Arnd Bergmann
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2018-02-19 10:13 UTC (permalink / raw)
To: stable
Cc: Greg KH, linux-kernel, Arnd Bergmann, Mauro Carvalho Chehab,
Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov,
Andrey Konovalov, Andrew Morton, Linus Torvalds, Sasha Levin,
Sudip Mukherjee
We get a lot of very large stack frames using gcc-7.0.1 with the default
-fsanitize-address-use-after-scope --param asan-stack=1 options, which can
easily cause an overflow of the kernel stack, e.g.
drivers/gpu/drm/i915/gvt/handlers.c:2434:1: warning: the frame size of 46176 bytes is larger than 3072 bytes
drivers/net/wireless/ralink/rt2x00/rt2800lib.c:5650:1: warning: the frame size of 23632 bytes is larger than 3072 bytes
lib/atomic64_test.c:250:1: warning: the frame size of 11200 bytes is larger than 3072 bytes
drivers/gpu/drm/i915/gvt/handlers.c:2621:1: warning: the frame size of 9208 bytes is larger than 3072 bytes
drivers/media/dvb-frontends/stv090x.c:3431:1: warning: the frame size of 6816 bytes is larger than 3072 bytes
fs/fscache/stats.c:287:1: warning: the frame size of 6536 bytes is larger than 3072 bytes
To reduce this risk, -fsanitize-address-use-after-scope is now split out
into a separate CONFIG_KASAN_EXTRA Kconfig option, leading to stack
frames that are smaller than 2 kilobytes most of the time on x86_64. An
earlier version of this patch also prevented combining KASAN_EXTRA with
KASAN_INLINE, but that is no longer necessary with gcc-7.0.1.
All patches to get the frame size below 2048 bytes with CONFIG_KASAN=y
and CONFIG_KASAN_EXTRA=n have been merged by maintainers now, so we can
bring back that default now. KASAN_EXTRA=y still causes lots of
warnings but now defaults to !COMPILE_TEST to disable it in
allmodconfig, and it remains disabled in all other defconfigs since it
is a new option. I arbitrarily raise the warning limit for KASAN_EXTRA
to 3072 to reduce the noise, but an allmodconfig kernel still has around
50 warnings on gcc-7.
I experimented a bit more with smaller stack frames and have another
follow-up series that reduces the warning limit for 64-bit architectures
to 1280 bytes (without CONFIG_KASAN).
With earlier versions of this patch series, I also had patches to address
the warnings we get with KASAN and/or KASAN_EXTRA, using a
"noinline_if_stackbloat" annotation.
That annotation now got replaced with a gcc-8 bugfix (see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715) and a workaround for
older compilers, which means that KASAN_EXTRA is now just as bad as
before and will lead to an instant stack overflow in a few extreme
cases.
This reverts parts of commit 3f181b4d8652 ("lib/Kconfig.debug: disable
-Wframe-larger-than warnings with KASAN=y"). Two patches in linux-next
should be merged first to avoid introducing warnings in an allmodconfig
build:
3cd890dbe2a4 ("media: dvb-frontends: fix i2c access helpers for KASAN")
16c3ada89cff ("media: r820t: fix r820t_write_reg for KASAN")
Do we really need to backport this?
I think we do: without this patch, enabling KASAN will lead to
unavoidable kernel stack overflow in certain device drivers when built
with gcc-7 or higher on linux-4.10+ or any version that contains a
backport of commit c5caf21ab0cf8. Most people are probably still on
older compilers, but it will get worse over time as they upgrade their
distros.
The warnings we get on kernels older than this should all be for code
that uses dangerously large stack frames, though most of them do not
cause an actual stack overflow by themselves.The asan-stack option was
added in linux-4.0, and commit 3f181b4d8652 ("lib/Kconfig.debug:
disable -Wframe-larger-than warnings with KASAN=y") effectively turned
off the warning for allmodconfig kernels, so I would like to see this
fix backported to any kernels later than 4.0.
I have done dozens of fixes for individual functions with stack frames
larger than 2048 bytes with asan-stack, and I plan to make sure that
all those fixes make it into the stable kernels as well (most are
already there).
Part of the complication here is that asan-stack (from 4.0) was
originally assumed to always require much larger stacks, but that
turned out to be a combination of multiple gcc bugs that we have now
worked around and fixed, but sanitize-address-use-after-scope (from
v4.10) has a much higher inherent stack usage and also suffers from at
least three other problems that we have analyzed but not yet fixed
upstream, each of them makes the stack usage more severe than it should
be.
Link: http://lkml.kernel.org/r/20171221134744.2295529-1-arnd@arndb.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrey Konovalov <andreyknvl@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[arnd: rebase to v4.9; only re-enable warning]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
lib/Kconfig.debug | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index f60e67217f18..58a22ca10f33 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -197,7 +197,6 @@ config ENABLE_MUST_CHECK
config FRAME_WARN
int "Warn for stack frames larger than (needs gcc 4.4)"
range 0 8192
- default 0 if KASAN
default 2048 if GCC_PLUGIN_LATENT_ENTROPY
default 1024 if !64BIT
default 2048 if 64BIT
--
2.9.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [4.9-stable 2/9] drm/i915: hide unused intel_panel_set_backlight function
2018-02-19 10:13 [4.9-stable 0/9] patches for 'randconfig' Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 1/9] kasan: rework Kconfig settings Arnd Bergmann
@ 2018-02-19 10:13 ` Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 3/9] arm64: sunxi: always enable reset controller Arnd Bergmann
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2018-02-19 10:13 UTC (permalink / raw)
To: stable
Cc: Greg KH, linux-kernel, Arnd Bergmann, Daniel Vetter,
Daniel Vetter, Jani Nikula, David Airlie, intel-gfx, dri-devel
commit fd94d53e55bd487368dfee9f1af24da78b2bb582 upstream.
Building i915 without backlight support results in a harmless warning
for intel_panel_set_backlight:
drivers/gpu/drm/i915/intel_panel.c:653:13: error: 'intel_panel_set_backlight' defined but not used [-Werror=unused-function]
This moves it into the CONFIG_BACKLIGHT_CLASS_DEVICE section that
its caller is in.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20171127151239.1813673-2-arnd@arndb.de
[arnd: manually rebased to 4.9]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpu/drm/i915/intel_panel.c | 86 +++++++++++++++++++-------------------
1 file changed, 43 insertions(+), 43 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index be4b4d546fd9..1cb1b01e4471 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -544,25 +544,6 @@ static u32 pwm_get_backlight(struct intel_connector *connector)
return DIV_ROUND_UP(duty_ns * 100, CRC_PMIC_PWM_PERIOD_NS);
}
-static u32 intel_panel_get_backlight(struct intel_connector *connector)
-{
- struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
- struct intel_panel *panel = &connector->panel;
- u32 val = 0;
-
- mutex_lock(&dev_priv->backlight_lock);
-
- if (panel->backlight.enabled) {
- val = panel->backlight.get(connector);
- val = intel_panel_compute_brightness(connector, val);
- }
-
- mutex_unlock(&dev_priv->backlight_lock);
-
- DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val);
- return val;
-}
-
static void lpt_set_backlight(struct intel_connector *connector, u32 level)
{
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
@@ -646,30 +627,6 @@ intel_panel_actually_set_backlight(struct intel_connector *connector, u32 level)
panel->backlight.set(connector, level);
}
-/* set backlight brightness to level in range [0..max], scaling wrt hw min */
-static void intel_panel_set_backlight(struct intel_connector *connector,
- u32 user_level, u32 user_max)
-{
- struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
- struct intel_panel *panel = &connector->panel;
- u32 hw_level;
-
- if (!panel->backlight.present)
- return;
-
- mutex_lock(&dev_priv->backlight_lock);
-
- WARN_ON(panel->backlight.max == 0);
-
- hw_level = scale_user_to_hw(connector, user_level, user_max);
- panel->backlight.level = hw_level;
-
- if (panel->backlight.enabled)
- intel_panel_actually_set_backlight(connector, hw_level);
-
- mutex_unlock(&dev_priv->backlight_lock);
-}
-
/* set backlight brightness to level in range [0..max], assuming hw min is
* respected.
*/
@@ -1122,6 +1079,49 @@ void intel_panel_enable_backlight(struct intel_connector *connector)
}
#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
+static u32 intel_panel_get_backlight(struct intel_connector *connector)
+{
+ struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
+ struct intel_panel *panel = &connector->panel;
+ u32 val = 0;
+
+ mutex_lock(&dev_priv->backlight_lock);
+
+ if (panel->backlight.enabled) {
+ val = panel->backlight.get(connector);
+ val = intel_panel_compute_brightness(connector, val);
+ }
+
+ mutex_unlock(&dev_priv->backlight_lock);
+
+ DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val);
+ return val;
+}
+
+/* set backlight brightness to level in range [0..max], scaling wrt hw min */
+static void intel_panel_set_backlight(struct intel_connector *connector,
+ u32 user_level, u32 user_max)
+{
+ struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
+ struct intel_panel *panel = &connector->panel;
+ u32 hw_level;
+
+ if (!panel->backlight.present)
+ return;
+
+ mutex_lock(&dev_priv->backlight_lock);
+
+ WARN_ON(panel->backlight.max == 0);
+
+ hw_level = scale_user_to_hw(connector, user_level, user_max);
+ panel->backlight.level = hw_level;
+
+ if (panel->backlight.enabled)
+ intel_panel_actually_set_backlight(connector, hw_level);
+
+ mutex_unlock(&dev_priv->backlight_lock);
+}
+
static int intel_backlight_device_update_status(struct backlight_device *bd)
{
struct intel_connector *connector = bl_get_data(bd);
--
2.9.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [4.9-stable 3/9] arm64: sunxi: always enable reset controller
2018-02-19 10:13 [4.9-stable 0/9] patches for 'randconfig' Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 1/9] kasan: rework Kconfig settings Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 2/9] drm/i915: hide unused intel_panel_set_backlight function Arnd Bergmann
@ 2018-02-19 10:13 ` Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 4/9] binfmt_elf: compat: avoid unused function warning Arnd Bergmann
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2018-02-19 10:13 UTC (permalink / raw)
To: stable
Cc: Greg KH, linux-kernel, Arnd Bergmann, Catalin Marinas,
Will Deacon, Maxime Ripard, linux-arm-kernel
commit 900a9020af7a023f9b64c919fddf8a7486108962 upstream.
The sunxi clk driver causes a link error when the reset controller
subsystem is disabled:
drivers/clk/built-in.o: In function `sun4i_ve_clk_setup':
:(.init.text+0xd040): undefined reference to `reset_controller_register'
drivers/clk/built-in.o: In function `sun4i_a10_display_init':
:(.init.text+0xe5e0): undefined reference to `reset_controller_register'
drivers/clk/built-in.o: In function `sunxi_usb_clk_setup':
:(.init.text+0x10074): undefined reference to `reset_controller_register'
We already force it to be enabled on arm32 and some other arm64 platforms,
but not on arm64/sunxi. This adds the respective Kconfig statements to
also select it here.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
[arnd: manually rebased to 4.9]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm64/Kconfig.platforms | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index 101794f5ce10..08a4497f70a6 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -2,9 +2,11 @@ menu "Platform selection"
config ARCH_SUNXI
bool "Allwinner sunxi 64-bit SoC Family"
+ select ARCH_HAS_RESET_CONTROLLER
select GENERIC_IRQ_CHIP
select PINCTRL
select PINCTRL_SUN50I_A64
+ select RESET_CONTROLLER
help
This enables support for Allwinner sunxi based SoCs like the A64.
--
2.9.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [4.9-stable 4/9] binfmt_elf: compat: avoid unused function warning
2018-02-19 10:13 [4.9-stable 0/9] patches for 'randconfig' Arnd Bergmann
` (2 preceding siblings ...)
2018-02-19 10:13 ` [4.9-stable 3/9] arm64: sunxi: always enable reset controller Arnd Bergmann
@ 2018-02-19 10:13 ` Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 5/9] spi: bcm-qspi: shut up warning about cfi header inclusion Arnd Bergmann
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2018-02-19 10:13 UTC (permalink / raw)
To: stable; +Cc: Greg KH, linux-kernel, Arnd Bergmann, Alexander Viro,
linux-fsdevel
When CONFIG_ELF_CORE is disabled, we get a harmless warning in the compat
version of binfmt_elf:
fs/compat_binfmt_elf.c:58:13: error: 'cputime_to_compat_timeval' defined but not used [-Werror=unused-function]
This was addressed in mainline Linux as part of a larger rework with commit
cd19c364b313 ("fs/binfmt: Convert obsolete cputime type to nsecs").
For 4.9 and earlier, this just shuts up the warning by adding an #ifdef
around the function definition.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
fs/compat_binfmt_elf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/compat_binfmt_elf.c b/fs/compat_binfmt_elf.c
index 4d24d17bcfc1..943be5ecfcd9 100644
--- a/fs/compat_binfmt_elf.c
+++ b/fs/compat_binfmt_elf.c
@@ -51,6 +51,7 @@
#define elf_prstatus compat_elf_prstatus
#define elf_prpsinfo compat_elf_prpsinfo
+#ifdef CONFIG_ELF_CORE
/*
* Compat version of cputime_to_compat_timeval, perhaps this
* should be an inline in <linux/compat.h>.
@@ -63,6 +64,7 @@ static void cputime_to_compat_timeval(const cputime_t cputime,
value->tv_sec = tv.tv_sec;
value->tv_usec = tv.tv_usec;
}
+#endif
#undef cputime_to_timeval
#define cputime_to_timeval cputime_to_compat_timeval
--
2.9.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [4.9-stable 5/9] spi: bcm-qspi: shut up warning about cfi header inclusion
2018-02-19 10:13 [4.9-stable 0/9] patches for 'randconfig' Arnd Bergmann
` (3 preceding siblings ...)
2018-02-19 10:13 ` [4.9-stable 4/9] binfmt_elf: compat: avoid unused function warning Arnd Bergmann
@ 2018-02-19 10:13 ` Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 6/9] idle: i7300: add PCI dependency Arnd Bergmann
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2018-02-19 10:13 UTC (permalink / raw)
To: stable
Cc: Greg KH, linux-kernel, Arnd Bergmann, Mark Brown, Sasha Levin,
Geert Uytterhoeven, linux-spi
When CONFIG_MTD_CFI is disabled, we get a warning for this spi driver:
include/linux/mtd/cfi.h:76:2: #warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support can work. [-Werror=cpp]
The problem here is a layering violation that was fixed in mainline kernels with
a larger rework in commit 054e532f8f90 ("spi: bcm-qspi: Remove hardcoded settings
and spi-nor.h dependency"). We can't really backport that to stable kernels, so
this just adds a Kconfig dependency to make it either build cleanly or force it
to be disabled.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/spi/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index b7995474148c..0e7415f6d093 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -156,6 +156,7 @@ config SPI_BCM63XX_HSSPI
config SPI_BCM_QSPI
tristate "Broadcom BSPI and MSPI controller support"
depends on ARCH_BRCMSTB || ARCH_BCM || ARCH_BCM_IPROC || COMPILE_TEST
+ depends on MTD_NORFLASH
default ARCH_BCM_IPROC
help
Enables support for the Broadcom SPI flash and MSPI controller.
--
2.9.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [4.9-stable 6/9] idle: i7300: add PCI dependency
2018-02-19 10:13 [4.9-stable 0/9] patches for 'randconfig' Arnd Bergmann
` (4 preceding siblings ...)
2018-02-19 10:13 ` [4.9-stable 5/9] spi: bcm-qspi: shut up warning about cfi header inclusion Arnd Bergmann
@ 2018-02-19 10:13 ` Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 7/9] arm64: fix warning about swapper_pg_dir overflow Arnd Bergmann
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2018-02-19 10:13 UTC (permalink / raw)
To: stable; +Cc: Greg KH, linux-kernel, Arnd Bergmann
GCC correctly points out an uninitialized variable use when CONFIG_PCI is disabled.
drivers/idle/i7300_idle.c: In function 'i7300_idle_notifier':
include/asm-generic/bug.h:119:5: error: 'got_ctl' may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (unlikely(__ret_warn_once && !__warned)) { \
^
drivers/idle/i7300_idle.c:415:5: note: 'got_ctl' was declared here
u8 got_ctl;
^~~~~~~
The driver no longer exists in later kernels, so this patch only appplies to
linux-4.9.y and earlier.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/idle/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/idle/Kconfig b/drivers/idle/Kconfig
index 4732dfc15447..331adc509f3a 100644
--- a/drivers/idle/Kconfig
+++ b/drivers/idle/Kconfig
@@ -17,6 +17,7 @@ config I7300_IDLE_IOAT_CHANNEL
config I7300_IDLE
tristate "Intel chipset idle memory power saving driver"
+ depends on PCI
select I7300_IDLE_IOAT_CHANNEL
help
Enable memory power savings when idle with certain Intel server
--
2.9.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [4.9-stable 7/9] arm64: fix warning about swapper_pg_dir overflow
2018-02-19 10:13 [4.9-stable 0/9] patches for 'randconfig' Arnd Bergmann
` (5 preceding siblings ...)
2018-02-19 10:13 ` [4.9-stable 6/9] idle: i7300: add PCI dependency Arnd Bergmann
@ 2018-02-19 10:13 ` Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 8/9] usb: phy: msm add regulator dependency Arnd Bergmann
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2018-02-19 10:13 UTC (permalink / raw)
To: stable
Cc: Greg KH, linux-kernel, Arnd Bergmann, Will Deacon,
Catalin Marinas, Ard Biesheuvel, Mark Rutland, linux-arm-kernel
commit 12f043ff2b28fa64c9123b454cbe30a8a9e1967e upstream.
With 4 levels of 16KB pages, we get this warning about the fact that we are
copying a whole page into an array that is declared as having only two pointers
for the top level of the page table:
arch/arm64/mm/mmu.c: In function 'paging_init':
arch/arm64/mm/mmu.c:528:2: error: 'memcpy' writing 16384 bytes into a region of size 16 overflows the destination [-Werror=stringop-overflow=]
This is harmless since we actually reserve a whole page in the definition of the
array that comes from, and just the extern declaration is short. The pgdir
is initialized to zero either way, so copying the actual entries here seems
like the best solution.
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Will Deacon <will.deacon@arm.com>
[slightly adapted to apply on 4.9]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm64/mm/mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 05615a3fdc6f..d5cc6d73c2c4 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -479,7 +479,7 @@ void __init paging_init(void)
* To do this we need to go via a temporary pgd.
*/
cpu_replace_ttbr1(__va(pgd_phys));
- memcpy(swapper_pg_dir, pgd, PAGE_SIZE);
+ memcpy(swapper_pg_dir, pgd, PGD_SIZE);
cpu_replace_ttbr1(swapper_pg_dir);
pgd_clear_fixmap();
--
2.9.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [4.9-stable 8/9] usb: phy: msm add regulator dependency
2018-02-19 10:13 [4.9-stable 0/9] patches for 'randconfig' Arnd Bergmann
` (6 preceding siblings ...)
2018-02-19 10:13 ` [4.9-stable 7/9] arm64: fix warning about swapper_pg_dir overflow Arnd Bergmann
@ 2018-02-19 10:13 ` Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 9/9] x86/microcode/AMD: Change load_microcode_amd()'s param to bool to fix preemptibility bug Arnd Bergmann
2018-02-23 15:42 ` [4.9-stable 0/9] patches for 'randconfig' Greg KH
9 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2018-02-19 10:13 UTC (permalink / raw)
To: stable; +Cc: Greg KH, linux-kernel, Arnd Bergmann, Felipe Balbi, linux-usb
On linux-4.4 and linux-4.9 we get a warning about an array that is
never initialized when CONFIG_REGULATOR is disabled:
drivers/usb/phy/phy-msm-usb.c: In function 'msm_otg_probe':
drivers/usb/phy/phy-msm-usb.c:1911:14: error: 'regs[0].consumer' may be used uninitialized in this function [-Werror=maybe-uninitialized]
motg->vddcx = regs[0].consumer;
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
drivers/usb/phy/phy-msm-usb.c:1912:14: error: 'regs[1].consumer' may be used uninitialized in this function [-Werror=maybe-uninitialized]
motg->v3p3 = regs[1].consumer;
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
drivers/usb/phy/phy-msm-usb.c:1913:14: error: 'regs[2].consumer' may be used uninitialized in this function [-Werror=maybe-uninitialized]
motg->v1p8 = regs[2].consumer;
This adds a Kconfig dependency for it. In newer kernels, the driver no
longer exists, so this is only needed for stable kernels.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/usb/phy/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index b9c409a18faa..125cea1c3c8d 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -147,6 +147,7 @@ config USB_MSM_OTG
depends on (USB || USB_GADGET) && (ARCH_QCOM || COMPILE_TEST)
depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y'
depends on RESET_CONTROLLER
+ depends on REGULATOR
depends on EXTCON
select USB_PHY
help
--
2.9.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [4.9-stable 9/9] x86/microcode/AMD: Change load_microcode_amd()'s param to bool to fix preemptibility bug
2018-02-19 10:13 [4.9-stable 0/9] patches for 'randconfig' Arnd Bergmann
` (7 preceding siblings ...)
2018-02-19 10:13 ` [4.9-stable 8/9] usb: phy: msm add regulator dependency Arnd Bergmann
@ 2018-02-19 10:13 ` Arnd Bergmann
2018-02-23 15:42 ` [4.9-stable 0/9] patches for 'randconfig' Greg KH
9 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2018-02-19 10:13 UTC (permalink / raw)
To: stable
Cc: Greg KH, linux-kernel, Borislav Petkov, Linus Torvalds,
Peter Zijlstra, Thomas Gleixner, Ingo Molnar, Arnd Bergmann,
Ingo Molnar, H. Peter Anvin, x86, Borislav Petkov, Tom Lendacky
From: Borislav Petkov <bp@suse.de>
commit dac6ca243c4c49a9ca7507d3d66140ebfac8b04b upstream.
With CONFIG_DEBUG_PREEMPT enabled, I get:
BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1
caller is debug_smp_processor_id
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.12.0-rc2+ #2
Call Trace:
dump_stack
check_preemption_disabled
debug_smp_processor_id
save_microcode_in_initrd_amd
? microcode_init
save_microcode_in_initrd
...
because, well, it says it above, we're using smp_processor_id() in
preemptible code.
But passing the CPU number is not really needed. It is only used to
determine whether we're on the BSP, and, if so, to save the microcode
patch for early loading.
[ We don't absolutely need to do it on the BSP but we do that
customarily there. ]
Instead, convert that function parameter to a boolean which denotes
whether the patch should be saved or not, thereby avoiding the use of
smp_processor_id() in preemptible code.
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20170528200414.31305-1-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[arnd: rebased to 4.9, after running into warning:
arch/x86/kernel/cpu/microcode/amd.c:881:30: self-comparison always evaluates to true]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/x86/include/asm/microcode_amd.h | 1 -
arch/x86/kernel/cpu/microcode/amd.c | 17 +++++++++++------
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/arch/x86/include/asm/microcode_amd.h b/arch/x86/include/asm/microcode_amd.h
index 15eb75484cc0..98ccbd1dbb01 100644
--- a/arch/x86/include/asm/microcode_amd.h
+++ b/arch/x86/include/asm/microcode_amd.h
@@ -59,7 +59,6 @@ static inline u16 find_equiv_id(struct equiv_cpu_entry *equiv_cpu_table,
extern int __apply_microcode_amd(struct microcode_amd *mc_amd);
extern int apply_microcode_amd(int cpu);
-extern enum ucode_state load_microcode_amd(int cpu, u8 family, const u8 *data, size_t size);
#define PATCH_MAX_SIZE PAGE_SIZE
diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
index b74bb29db6b9..732bb03fcf91 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -135,6 +135,9 @@ static size_t compute_container_size(u8 *data, u32 total_size)
return size;
}
+static enum ucode_state
+load_microcode_amd(bool save, u8 family, const u8 *data, size_t size);
+
/*
* Early load occurs before we can vmalloc(). So we look for the microcode
* patch container file in initrd, traverse equivalent cpu table, look for a
@@ -451,7 +454,7 @@ int __init save_microcode_in_initrd_amd(void)
eax = cpuid_eax(0x00000001);
eax = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff);
- ret = load_microcode_amd(smp_processor_id(), eax, container, container_size);
+ ret = load_microcode_amd(true, eax, container, container_size);
if (ret != UCODE_OK)
retval = -EINVAL;
@@ -864,7 +867,8 @@ static enum ucode_state __load_microcode_amd(u8 family, const u8 *data,
return UCODE_OK;
}
-enum ucode_state load_microcode_amd(int cpu, u8 family, const u8 *data, size_t size)
+static enum ucode_state
+load_microcode_amd(bool save, u8 family, const u8 *data, size_t size)
{
enum ucode_state ret;
@@ -878,8 +882,8 @@ enum ucode_state load_microcode_amd(int cpu, u8 family, const u8 *data, size_t s
#ifdef CONFIG_X86_32
/* save BSP's matching patch for early load */
- if (cpu_data(cpu).cpu_index == boot_cpu_data.cpu_index) {
- struct ucode_patch *p = find_patch(cpu);
+ if (save) {
+ struct ucode_patch *p = find_patch(0);
if (p) {
memset(amd_ucode_patch, 0, PATCH_MAX_SIZE);
memcpy(amd_ucode_patch, p->data, min_t(u32, ksize(p->data),
@@ -911,11 +915,12 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device,
{
char fw_name[36] = "amd-ucode/microcode_amd.bin";
struct cpuinfo_x86 *c = &cpu_data(cpu);
+ bool bsp = c->cpu_index == boot_cpu_data.cpu_index;
enum ucode_state ret = UCODE_NFOUND;
const struct firmware *fw;
/* reload ucode container only on the boot cpu */
- if (!refresh_fw || c->cpu_index != boot_cpu_data.cpu_index)
+ if (!refresh_fw || !bsp)
return UCODE_OK;
if (c->x86 >= 0x15)
@@ -932,7 +937,7 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device,
goto fw_release;
}
- ret = load_microcode_amd(cpu, c->x86, fw->data, fw->size);
+ ret = load_microcode_amd(bsp, c->x86, fw->data, fw->size);
fw_release:
release_firmware(fw);
--
2.9.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [4.9-stable 0/9] patches for 'randconfig'
2018-02-19 10:13 [4.9-stable 0/9] patches for 'randconfig' Arnd Bergmann
` (8 preceding siblings ...)
2018-02-19 10:13 ` [4.9-stable 9/9] x86/microcode/AMD: Change load_microcode_amd()'s param to bool to fix preemptibility bug Arnd Bergmann
@ 2018-02-23 15:42 ` Greg KH
9 siblings, 0 replies; 11+ messages in thread
From: Greg KH @ 2018-02-23 15:42 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: stable, linux-kernel
On Mon, Feb 19, 2018 at 11:13:19AM +0100, Arnd Bergmann wrote:
> As discussed with Greg, I've had my randconfig builder build 4.9-stable kernels
> over the weekend, here is what it found missing. There are 45 patches that can
> be backported cleanly from mainline, plus another 9 that are either not part of
> mainline because the problem no longer exists there (e.g. file was removed), or
> the backport required context changes.
>
> Most of these should also apply to 4.4, but I have not tried that yet.
>
> Arnd
>
> ac29fc66855b drm/i915: fix intel_backlight_device_register declaration
> 23f919d4ad0e shmem: avoid maybe-uninitialized warning
> aa01338c0184 clk: sunxi-ng: fix build error without CONFIG_RESET_CONTROLLER
> fbdf0e28d061 vmxnet3: prevent building with 64K pages
> 11d8b05855f3 perf/x86: Shut up false-positive -Wmaybe-uninitialized warning
> 42db500a551f PCI: vmd: Fix suspend handlers defined-but-not-used warning
> fbc2a294f29e gpio: intel-mid: Fix build warning when !CONFIG_PM
> b4aca383f9af platform/x86: intel_mid_thermal: Fix suspend handlers unused warning
> c8bd2ac3b4c6 usb: musb: fix compilation warning on unused function
> de5bbdd01cf9 PCI: Change pci_host_common_probe() visibility
> c0bfc549e962 perf: xgene: Include module.h
> 484c7bbf2649 video: fbdev: via: remove possibly unused variables
> 067fdeb2f391 dmaengine: zx: fix build warning
> f46e7cd36b5f scsi: advansys: fix build warning for PCI=n
> d4b2ac63b0ea x86/ras/inject: Make it depend on X86_LOCAL_APIC=y
> b115bebc07f2 gpio: xgene: mark PM functions as __maybe_unused
> f13d52cb3fad arm64: define BUG() instruction without CONFIG_BUG
> 75e2f0a6b161 x86/fpu/math-emu: Fix possible uninitialized variable use
> e572d0887137 tools build: Add tools tree support for 'make -s'
> d460131dd505 x86/build: Silence the build with "make -s"
> 68fd77cf8a4b thermal: fix INTEL_SOC_DTS_IOSF_CORE dependencies
> c2ce3f5d89d5 x86: add MULTIUSER dependency for KVM
> d689c64d189e x86/platform: Add PCI dependency for PUNIT_ATOM_DEBUG
> 3ba5b5ea7dc3 x86/vm86: Fix unused variable warning if THP is disabled
> 44a5b977128c scsi: advansys: fix uninitialized data access
> 2e449048a25e arm64: Kconfig: select COMPAT_BINFMT_ELF only when BINFMT_ELF is set
> 46a049dae771 ALSA: hda/ca0132 - fix possible NULL pointer use
> ab4949640d66 reiserfs: avoid a -Wmaybe-uninitialized warning
> 7fc1503c906f cw1200: fix bogus maybe-uninitialized warning
> 3cd18d198173 security/keys: BIG_KEY requires CONFIG_CRYPTO
> 7e1751001818 drm: exynos: mark pm functions as __maybe_unused
> 9e343e87d2c4 mtd: cfi: convert inline functions to macros
> 3cd890dbe2a4 media: dvb-frontends: fix i2c access helpers for KASAN
> d4c2269b3d5d rbd: silence bogus -Wmaybe-uninitialized warning
> b74c0a9969f2 drm/nouveau: hide gcc-4.9 -Wmaybe-uninitialized
> ea4348c8462a Input: tca8418_keypad - hide gcc-4.9 -Wmaybe-uninitialized warning
> 16c3ada89cff media: r820t: fix r820t_write_reg for KASAN
> e42eef4ba388 KVM: add X86_LOCAL_APIC dependency
> f1f5929cd971 shmem: fix compilation warnings on unused functions
> 3538aa6ecfb2 [media] tc358743: fix register i2c_rd/wr functions
> fa6317eedd63 [media] go7007: add MEDIA_CAMERA_SUPPORT dependency
> 190b23b4eb99 [media] em28xx: only use mt9v011 if camera support is enabled
> 27430d19a916 [media] tw5864: use dev_warn instead of WARN to shut up warning
> 27d807180ae0 ISDN: eicon: reduce stack size of sig_ind function
> dbed87a9d3a8 clk: meson: gxbb: fix build error without RESET_CONTROLLER
All of those patches are now queued up, along with the 9 you attached
"by hand" here. Many thanks for them.
greg k-h
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2018-02-23 15:43 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-19 10:13 [4.9-stable 0/9] patches for 'randconfig' Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 1/9] kasan: rework Kconfig settings Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 2/9] drm/i915: hide unused intel_panel_set_backlight function Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 3/9] arm64: sunxi: always enable reset controller Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 4/9] binfmt_elf: compat: avoid unused function warning Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 5/9] spi: bcm-qspi: shut up warning about cfi header inclusion Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 6/9] idle: i7300: add PCI dependency Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 7/9] arm64: fix warning about swapper_pg_dir overflow Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 8/9] usb: phy: msm add regulator dependency Arnd Bergmann
2018-02-19 10:13 ` [4.9-stable 9/9] x86/microcode/AMD: Change load_microcode_amd()'s param to bool to fix preemptibility bug Arnd Bergmann
2018-02-23 15:42 ` [4.9-stable 0/9] patches for 'randconfig' Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox