]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Feb 2019 14:54:01 +0000 (15:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Feb 2019 14:54:01 +0000 (15:54 +0100)
added patches:
clocksource-use-genmask_ull-in-definition-of-clocksource_mask.patch
drm-i915-consistently-use-enum-pipe-for-pch-transcoders.patch
drm-i915-fix-enum-pipe-vs.-enum-transcoder-for-the-pch-transcoder.patch
hpet-make-cmd-parameter-of-hpet_ioctl_common-unsigned.patch
irqchip-gic-v3-convert-arm64-gic-accessors-to-read-write-_sysreg_s.patch
kbuild-add-no-integrated-as-clang-option-unconditionally.patch
kbuild-clang-disable-unused-variable-warnings-only-when-constant.patch
kbuild-clang-fix-build-failures-with-sparse-check.patch
kbuild-clang-remove-crufty-hostcflags.patch
kbuild-move-cc-option-and-cc-disable-warning-after-incl.-arch-makefile.patch
kbuild-set-no-integrated-as-before-incl.-arch-makefile.patch
mm-zsmalloc.c-change-stat-type-parameter-to-int.patch
mm-zsmalloc.c-fix-wunneeded-internal-declaration-warning.patch
netpoll-fix-device-name-check-in-netpoll_setup.patch
tracing-use-cpumask_available-to-check-if-cpumask-variable-may-be-used.patch
x86-boot-disable-the-address-of-packed-member-compiler-warning.patch

17 files changed:
queue-4.9/clocksource-use-genmask_ull-in-definition-of-clocksource_mask.patch [new file with mode: 0644]
queue-4.9/drm-i915-consistently-use-enum-pipe-for-pch-transcoders.patch [new file with mode: 0644]
queue-4.9/drm-i915-fix-enum-pipe-vs.-enum-transcoder-for-the-pch-transcoder.patch [new file with mode: 0644]
queue-4.9/hpet-make-cmd-parameter-of-hpet_ioctl_common-unsigned.patch [new file with mode: 0644]
queue-4.9/irqchip-gic-v3-convert-arm64-gic-accessors-to-read-write-_sysreg_s.patch [new file with mode: 0644]
queue-4.9/kbuild-add-no-integrated-as-clang-option-unconditionally.patch [new file with mode: 0644]
queue-4.9/kbuild-clang-disable-unused-variable-warnings-only-when-constant.patch [new file with mode: 0644]
queue-4.9/kbuild-clang-fix-build-failures-with-sparse-check.patch [new file with mode: 0644]
queue-4.9/kbuild-clang-remove-crufty-hostcflags.patch [new file with mode: 0644]
queue-4.9/kbuild-move-cc-option-and-cc-disable-warning-after-incl.-arch-makefile.patch [new file with mode: 0644]
queue-4.9/kbuild-set-no-integrated-as-before-incl.-arch-makefile.patch [new file with mode: 0644]
queue-4.9/mm-zsmalloc.c-change-stat-type-parameter-to-int.patch [new file with mode: 0644]
queue-4.9/mm-zsmalloc.c-fix-wunneeded-internal-declaration-warning.patch [new file with mode: 0644]
queue-4.9/netpoll-fix-device-name-check-in-netpoll_setup.patch [new file with mode: 0644]
queue-4.9/series
queue-4.9/tracing-use-cpumask_available-to-check-if-cpumask-variable-may-be-used.patch [new file with mode: 0644]
queue-4.9/x86-boot-disable-the-address-of-packed-member-compiler-warning.patch [new file with mode: 0644]

diff --git a/queue-4.9/clocksource-use-genmask_ull-in-definition-of-clocksource_mask.patch b/queue-4.9/clocksource-use-genmask_ull-in-definition-of-clocksource_mask.patch
new file mode 100644 (file)
index 0000000..0f6b52a
--- /dev/null
@@ -0,0 +1,40 @@
+From foo@baz Mon Feb 25 15:48:37 CET 2019
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Tue, 18 Apr 2017 16:30:37 -0700
+Subject: clocksource: Use GENMASK_ULL in definition of CLOCKSOURCE_MASK
+
+From: Matthias Kaehlcke <mka@chromium.org>
+
+commit 0773cea37470f8e080c510fe720fc356cf35df3a upstream
+
+Besides reusing existing code this removes the special case handling
+for 64-bit masks, which causes clang to raise a shift count overflow
+warning due to https://bugs.llvm.org//show_bug.cgi?id=10030.
+
+Suggested-by: Dmitry Torokhov <dtor@chromium.org>
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Cc: Grant Grundler <grundler@chromium.org>
+Cc: Greg Hackmann <ghackmann@google.com>
+Cc: Michael Davidson <md@google.com>
+Cc: John Stultz <john.stultz@linaro.org>
+Link: http://lkml.kernel.org/r/20170418233037.70990-1-mka@chromium.org
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+[nc: cycle_t wasn't eliminated until commit a5a1d1c2914b ("clocksource:
+     Use a plain u64 instead of cycle_t") in v4.10]
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/linux/clocksource.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/include/linux/clocksource.h
++++ b/include/linux/clocksource.h
+@@ -117,7 +117,7 @@ struct clocksource {
+ #define CLOCK_SOURCE_RESELECT                 0x100
+ /* simplify initialization of mask field */
+-#define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1)
++#define CLOCKSOURCE_MASK(bits) GENMASK_ULL((bits) - 1, 0)
+ static inline u32 clocksource_freq2mult(u32 freq, u32 shift_constant, u64 from)
+ {
diff --git a/queue-4.9/drm-i915-consistently-use-enum-pipe-for-pch-transcoders.patch b/queue-4.9/drm-i915-consistently-use-enum-pipe-for-pch-transcoders.patch
new file mode 100644 (file)
index 0000000..86fefbb
--- /dev/null
@@ -0,0 +1,167 @@
+From foo@baz Mon Feb 25 15:48:37 CET 2019
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Mon, 17 Jul 2017 11:14:03 -0700
+Subject: drm/i915: Consistently use enum pipe for PCH transcoders
+
+From: Matthias Kaehlcke <mka@chromium.org>
+
+commit a21960339c8c107eae99d68c85e6355189b22192 upstream.
+
+The current code uses in some instances enum transcoder for PCH
+transcoders and enum pipe in others. This is error prone and clang
+raises warnings like this:
+
+drivers/gpu/drm/i915/intel_dp.c:3546:51: warning: implicit conversion
+  from enumeration type 'enum pipe' to different enumeration type
+  'enum transcoder' [-Wenum-conversion]
+    intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, false);
+
+Consistently use the type enum pipe for PCH transcoders.
+
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Link: https://patchwork.freedesktop.org/patch/msgid/20170717181403.57324-1-mka@chromium.org
+[nc: Backport to 4.9; adjust context and drop unneeded hunks]
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/i915/i915_irq.c            |   10 +++++-----
+ drivers/gpu/drm/i915/intel_display.c       |   14 +++++++-------
+ drivers/gpu/drm/i915/intel_drv.h           |    4 ++--
+ drivers/gpu/drm/i915/intel_fifo_underrun.c |    4 ++--
+ 4 files changed, 16 insertions(+), 16 deletions(-)
+
+--- a/drivers/gpu/drm/i915/i915_irq.c
++++ b/drivers/gpu/drm/i915/i915_irq.c
+@@ -1985,10 +1985,10 @@ static void ibx_irq_handler(struct drm_i
+               DRM_DEBUG_DRIVER("PCH transcoder CRC error interrupt\n");
+       if (pch_iir & SDE_TRANSA_FIFO_UNDER)
+-              intel_pch_fifo_underrun_irq_handler(dev_priv, TRANSCODER_A);
++              intel_pch_fifo_underrun_irq_handler(dev_priv, PIPE_A);
+       if (pch_iir & SDE_TRANSB_FIFO_UNDER)
+-              intel_pch_fifo_underrun_irq_handler(dev_priv, TRANSCODER_B);
++              intel_pch_fifo_underrun_irq_handler(dev_priv, PIPE_B);
+ }
+ static void ivb_err_int_handler(struct drm_i915_private *dev_priv)
+@@ -2022,13 +2022,13 @@ static void cpt_serr_int_handler(struct
+               DRM_ERROR("PCH poison interrupt\n");
+       if (serr_int & SERR_INT_TRANS_A_FIFO_UNDERRUN)
+-              intel_pch_fifo_underrun_irq_handler(dev_priv, TRANSCODER_A);
++              intel_pch_fifo_underrun_irq_handler(dev_priv, PIPE_A);
+       if (serr_int & SERR_INT_TRANS_B_FIFO_UNDERRUN)
+-              intel_pch_fifo_underrun_irq_handler(dev_priv, TRANSCODER_B);
++              intel_pch_fifo_underrun_irq_handler(dev_priv, PIPE_B);
+       if (serr_int & SERR_INT_TRANS_C_FIFO_UNDERRUN)
+-              intel_pch_fifo_underrun_irq_handler(dev_priv, TRANSCODER_C);
++              intel_pch_fifo_underrun_irq_handler(dev_priv, PIPE_C);
+       I915_WRITE(SERR_INT, serr_int);
+ }
+--- a/drivers/gpu/drm/i915/intel_display.c
++++ b/drivers/gpu/drm/i915/intel_display.c
+@@ -1849,7 +1849,7 @@ static void lpt_enable_pch_transcoder(st
+       /* FDI must be feeding us bits for PCH ports */
+       assert_fdi_tx_enabled(dev_priv, (enum pipe) cpu_transcoder);
+-      assert_fdi_rx_enabled(dev_priv, TRANSCODER_A);
++      assert_fdi_rx_enabled(dev_priv, PIPE_A);
+       /* Workaround: set timing override bit. */
+       val = I915_READ(TRANS_CHICKEN2(PIPE_A));
+@@ -1950,7 +1950,7 @@ static void intel_enable_pipe(struct int
+       assert_sprites_disabled(dev_priv, pipe);
+       if (HAS_PCH_LPT(dev_priv))
+-              pch_transcoder = TRANSCODER_A;
++              pch_transcoder = PIPE_A;
+       else
+               pch_transcoder = pipe;
+@@ -4636,7 +4636,7 @@ static void lpt_pch_enable(struct drm_cr
+       struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+       enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder;
+-      assert_pch_transcoder_disabled(dev_priv, TRANSCODER_A);
++      assert_pch_transcoder_disabled(dev_priv, PIPE_A);
+       lpt_program_iclkip(crtc);
+@@ -5410,7 +5410,7 @@ static void haswell_crtc_enable(struct i
+               return;
+       if (intel_crtc->config->has_pch_encoder)
+-              intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A,
++              intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A,
+                                                     false);
+       intel_encoders_pre_pll_enable(crtc, pipe_config, old_state);
+@@ -5498,7 +5498,7 @@ static void haswell_crtc_enable(struct i
+               intel_wait_for_vblank(dev, pipe);
+               intel_wait_for_vblank(dev, pipe);
+               intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true);
+-              intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A,
++              intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A,
+                                                     true);
+       }
+@@ -5597,7 +5597,7 @@ static void haswell_crtc_disable(struct
+       enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder;
+       if (intel_crtc->config->has_pch_encoder)
+-              intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A,
++              intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A,
+                                                     false);
+       intel_encoders_disable(crtc, old_crtc_state, old_state);
+@@ -5626,7 +5626,7 @@ static void haswell_crtc_disable(struct
+       intel_encoders_post_disable(crtc, old_crtc_state, old_state);
+       if (old_crtc_state->has_pch_encoder)
+-              intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A,
++              intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A,
+                                                     true);
+ }
+--- a/drivers/gpu/drm/i915/intel_drv.h
++++ b/drivers/gpu/drm/i915/intel_drv.h
+@@ -1095,12 +1095,12 @@ static inline unsigned int intel_num_pla
+ bool intel_set_cpu_fifo_underrun_reporting(struct drm_i915_private *dev_priv,
+                                          enum pipe pipe, bool enable);
+ bool intel_set_pch_fifo_underrun_reporting(struct drm_i915_private *dev_priv,
+-                                         enum transcoder pch_transcoder,
++                                         enum pipe pch_transcoder,
+                                          bool enable);
+ void intel_cpu_fifo_underrun_irq_handler(struct drm_i915_private *dev_priv,
+                                        enum pipe pipe);
+ void intel_pch_fifo_underrun_irq_handler(struct drm_i915_private *dev_priv,
+-                                       enum transcoder pch_transcoder);
++                                       enum pipe pch_transcoder);
+ void intel_check_cpu_fifo_underruns(struct drm_i915_private *dev_priv);
+ void intel_check_pch_fifo_underruns(struct drm_i915_private *dev_priv);
+--- a/drivers/gpu/drm/i915/intel_fifo_underrun.c
++++ b/drivers/gpu/drm/i915/intel_fifo_underrun.c
+@@ -311,7 +311,7 @@ bool intel_set_cpu_fifo_underrun_reporti
+  * Returns the previous state of underrun reporting.
+  */
+ bool intel_set_pch_fifo_underrun_reporting(struct drm_i915_private *dev_priv,
+-                                         enum transcoder pch_transcoder,
++                                         enum pipe pch_transcoder,
+                                          bool enable)
+ {
+       struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pch_transcoder];
+@@ -384,7 +384,7 @@ void intel_cpu_fifo_underrun_irq_handler
+  * interrupt to avoid an irq storm.
+  */
+ void intel_pch_fifo_underrun_irq_handler(struct drm_i915_private *dev_priv,
+-                                       enum transcoder pch_transcoder)
++                                       enum pipe pch_transcoder)
+ {
+       if (intel_set_pch_fifo_underrun_reporting(dev_priv, pch_transcoder,
+                                                 false))
diff --git a/queue-4.9/drm-i915-fix-enum-pipe-vs.-enum-transcoder-for-the-pch-transcoder.patch b/queue-4.9/drm-i915-fix-enum-pipe-vs.-enum-transcoder-for-the-pch-transcoder.patch
new file mode 100644 (file)
index 0000000..f9804d0
--- /dev/null
@@ -0,0 +1,100 @@
+From foo@baz Mon Feb 25 15:48:37 CET 2019
+From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
+Date: Fri, 1 Sep 2017 17:31:23 +0300
+Subject: drm/i915: Fix enum pipe vs. enum transcoder for the PCH transcoder
+
+From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
+
+commit 41c32e5da3ff3922490341a988b2a3ae46d0b6a8 upstream.
+
+Use enum pipe for PCH transcoders also in the FIFO underrun code.
+
+Fixes the following new sparse warnings:
+intel_fifo_underrun.c:340:49: warning: mixing different enum types
+intel_fifo_underrun.c:340:49:     int enum pipe  versus
+intel_fifo_underrun.c:340:49:     int enum transcoder
+intel_fifo_underrun.c:344:49: warning: mixing different enum types
+intel_fifo_underrun.c:344:49:     int enum pipe  versus
+intel_fifo_underrun.c:344:49:     int enum transcoder
+intel_fifo_underrun.c:397:57: warning: mixing different enum types
+intel_fifo_underrun.c:397:57:     int enum pipe  versus
+intel_fifo_underrun.c:397:57:     int enum transcoder
+intel_fifo_underrun.c:398:17: warning: mixing different enum types
+intel_fifo_underrun.c:398:17:     int enum pipe  versus
+intel_fifo_underrun.c:398:17:     int enum transcoder
+
+Cc: Matthias Kaehlcke <mka@chromium.org>
+Fixes: a21960339c8c ("drm/i915: Consistently use enum pipe for PCH transcoders")
+Signed-off-by: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20170901143123.7590-3-ville.syrjala@linux.intel.com
+Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+[nc: Backport to 4.9, drop unneeded hunks]
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/i915/intel_fifo_underrun.c |   20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+--- a/drivers/gpu/drm/i915/intel_fifo_underrun.c
++++ b/drivers/gpu/drm/i915/intel_fifo_underrun.c
+@@ -185,11 +185,11 @@ static void broadwell_set_fifo_underrun_
+ }
+ static void ibx_set_fifo_underrun_reporting(struct drm_device *dev,
+-                                          enum transcoder pch_transcoder,
++                                          enum pipe pch_transcoder,
+                                           bool enable)
+ {
+       struct drm_i915_private *dev_priv = to_i915(dev);
+-      uint32_t bit = (pch_transcoder == TRANSCODER_A) ?
++      uint32_t bit = (pch_transcoder == PIPE_A) ?
+                      SDE_TRANSA_FIFO_UNDER : SDE_TRANSB_FIFO_UNDER;
+       if (enable)
+@@ -201,7 +201,7 @@ static void ibx_set_fifo_underrun_report
+ static void cpt_check_pch_fifo_underruns(struct intel_crtc *crtc)
+ {
+       struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
+-      enum transcoder pch_transcoder = (enum transcoder) crtc->pipe;
++      enum pipe pch_transcoder = crtc->pipe;
+       uint32_t serr_int = I915_READ(SERR_INT);
+       assert_spin_locked(&dev_priv->irq_lock);
+@@ -212,12 +212,12 @@ static void cpt_check_pch_fifo_underruns
+       I915_WRITE(SERR_INT, SERR_INT_TRANS_FIFO_UNDERRUN(pch_transcoder));
+       POSTING_READ(SERR_INT);
+-      DRM_ERROR("pch fifo underrun on pch transcoder %s\n",
+-                transcoder_name(pch_transcoder));
++      DRM_ERROR("pch fifo underrun on pch transcoder %c\n",
++                pipe_name(pch_transcoder));
+ }
+ static void cpt_set_fifo_underrun_reporting(struct drm_device *dev,
+-                                          enum transcoder pch_transcoder,
++                                          enum pipe pch_transcoder,
+                                           bool enable, bool old)
+ {
+       struct drm_i915_private *dev_priv = to_i915(dev);
+@@ -235,8 +235,8 @@ static void cpt_set_fifo_underrun_report
+               if (old && I915_READ(SERR_INT) &
+                   SERR_INT_TRANS_FIFO_UNDERRUN(pch_transcoder)) {
+-                      DRM_ERROR("uncleared pch fifo underrun on pch transcoder %s\n",
+-                                transcoder_name(pch_transcoder));
++                      DRM_ERROR("uncleared pch fifo underrun on pch transcoder %c\n",
++                                pipe_name(pch_transcoder));
+               }
+       }
+ }
+@@ -388,8 +388,8 @@ void intel_pch_fifo_underrun_irq_handler
+ {
+       if (intel_set_pch_fifo_underrun_reporting(dev_priv, pch_transcoder,
+                                                 false))
+-              DRM_ERROR("PCH transcoder %s FIFO underrun\n",
+-                        transcoder_name(pch_transcoder));
++              DRM_ERROR("PCH transcoder %c FIFO underrun\n",
++                        pipe_name(pch_transcoder));
+ }
+ /**
diff --git a/queue-4.9/hpet-make-cmd-parameter-of-hpet_ioctl_common-unsigned.patch b/queue-4.9/hpet-make-cmd-parameter-of-hpet_ioctl_common-unsigned.patch
new file mode 100644 (file)
index 0000000..ca037c1
--- /dev/null
@@ -0,0 +1,44 @@
+From foo@baz Mon Feb 25 15:48:37 CET 2019
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Mon, 13 Mar 2017 11:57:25 -0700
+Subject: hpet: Make cmd parameter of hpet_ioctl_common() unsigned
+
+From: Matthias Kaehlcke <mka@chromium.org>
+
+commit 5cd5e6ad0ede862432e1e766bfe02a9ad447533e upstream.
+
+The value passed by the two callers of the function is unsigned anyway.
+
+Making the parameter unsigned fixes the following warning when building
+with clang:
+
+drivers/char/hpet.c:588:7: error: overflow converting case value to switch condition type (2149083139 to 18446744071563667459) [-Werror,-Wswitch]
+        case HPET_INFO:
+             ^
+include/uapi/linux/hpet.h:18:19: note: expanded from macro 'HPET_INFO'
+                        ^
+include/uapi/asm-generic/ioctl.h:77:28: note: expanded from macro '_IOR'
+                                ^
+include/uapi/asm-generic/ioctl.h:66:2: note: expanded from macro '_IOC'
+        (((dir)  << _IOC_DIRSHIFT) | \
+
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Acked-by: Clemens Ladisch <clemens@ladisch.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/char/hpet.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/char/hpet.c
++++ b/drivers/char/hpet.c
+@@ -574,7 +574,7 @@ static inline unsigned long hpet_time_di
+ }
+ static int
+-hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg,
++hpet_ioctl_common(struct hpet_dev *devp, unsigned int cmd, unsigned long arg,
+                 struct hpet_info *info)
+ {
+       struct hpet_timer __iomem *timer;
diff --git a/queue-4.9/irqchip-gic-v3-convert-arm64-gic-accessors-to-read-write-_sysreg_s.patch b/queue-4.9/irqchip-gic-v3-convert-arm64-gic-accessors-to-read-write-_sysreg_s.patch
new file mode 100644 (file)
index 0000000..5c25165
--- /dev/null
@@ -0,0 +1,142 @@
+From foo@baz Mon Feb 25 15:53:33 CET 2019
+From: Will Deacon <will.deacon@arm.com>
+Date: Fri, 28 Oct 2016 12:23:57 +0100
+Subject: irqchip/gic-v3: Convert arm64 GIC accessors to {read,write}_sysreg_s
+
+From: Will Deacon <will.deacon@arm.com>
+
+commit d44ffa5ae70a15a15190aa9ffa6f6acdeae1d25c upstream.
+
+The GIC system registers are accessed using open-coded wrappers around
+the mrs_s/msr_s asm macros.
+
+This patch moves the code over to the {read,wrote}_sysreg_s accessors
+instead, reducing the amount of explicit asm blocks in the arch headers.
+
+Reviewed-by: Mark Rutland <mark.rutland@arm.com>
+Signed-off-by: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+[nc: Also fix gic_write_bpr1, which was incidentally fixed in
+     0e9884fe63c6 ("arm64: sysreg: subsume GICv3 sysreg definitions")]
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm64/include/asm/arch_gicv3.h |   47 +++++++++++++-----------------------
+ 1 file changed, 18 insertions(+), 29 deletions(-)
+
+--- a/arch/arm64/include/asm/arch_gicv3.h
++++ b/arch/arm64/include/asm/arch_gicv3.h
+@@ -80,18 +80,8 @@
+ #include <linux/stringify.h>
+ #include <asm/barrier.h>
+-#define read_gicreg(r)                                                        \
+-      ({                                                              \
+-              u64 reg;                                                \
+-              asm volatile("mrs_s %0, " __stringify(r) : "=r" (reg)); \
+-              reg;                                                    \
+-      })
+-
+-#define write_gicreg(v,r)                                             \
+-      do {                                                            \
+-              u64 __val = (v);                                        \
+-              asm volatile("msr_s " __stringify(r) ", %0" : : "r" (__val));\
+-      } while (0)
++#define read_gicreg                   read_sysreg_s
++#define write_gicreg                  write_sysreg_s
+ /*
+  * Low-level accessors
+@@ -102,13 +92,13 @@
+ static inline void gic_write_eoir(u32 irq)
+ {
+-      asm volatile("msr_s " __stringify(ICC_EOIR1_EL1) ", %0" : : "r" ((u64)irq));
++      write_sysreg_s(irq, ICC_EOIR1_EL1);
+       isb();
+ }
+ static inline void gic_write_dir(u32 irq)
+ {
+-      asm volatile("msr_s " __stringify(ICC_DIR_EL1) ", %0" : : "r" ((u64)irq));
++      write_sysreg_s(irq, ICC_DIR_EL1);
+       isb();
+ }
+@@ -116,7 +106,7 @@ static inline u64 gic_read_iar_common(vo
+ {
+       u64 irqstat;
+-      asm volatile("mrs_s %0, " __stringify(ICC_IAR1_EL1) : "=r" (irqstat));
++      irqstat = read_sysreg_s(ICC_IAR1_EL1);
+       dsb(sy);
+       return irqstat;
+ }
+@@ -134,10 +124,12 @@ static inline u64 gic_read_iar_cavium_th
+       asm volatile(
+               "nop;nop;nop;nop\n\t"
+-              "nop;nop;nop;nop\n\t"
+-              "mrs_s %0, " __stringify(ICC_IAR1_EL1) "\n\t"
+-              "nop;nop;nop;nop"
+-              : "=r" (irqstat));
++              "nop;nop;nop;nop");
++
++      irqstat = read_sysreg_s(ICC_IAR1_EL1);
++
++      asm volatile(
++              "nop;nop;nop;nop");
+       mb();
+       return irqstat;
+@@ -145,43 +137,40 @@ static inline u64 gic_read_iar_cavium_th
+ static inline void gic_write_pmr(u32 val)
+ {
+-      asm volatile("msr_s " __stringify(ICC_PMR_EL1) ", %0" : : "r" ((u64)val));
++      write_sysreg_s(val, ICC_PMR_EL1);
+ }
+ static inline void gic_write_ctlr(u32 val)
+ {
+-      asm volatile("msr_s " __stringify(ICC_CTLR_EL1) ", %0" : : "r" ((u64)val));
++      write_sysreg_s(val, ICC_CTLR_EL1);
+       isb();
+ }
+ static inline void gic_write_grpen1(u32 val)
+ {
+-      asm volatile("msr_s " __stringify(ICC_GRPEN1_EL1) ", %0" : : "r" ((u64)val));
++      write_sysreg_s(val, ICC_GRPEN1_EL1);
+       isb();
+ }
+ static inline void gic_write_sgi1r(u64 val)
+ {
+-      asm volatile("msr_s " __stringify(ICC_SGI1R_EL1) ", %0" : : "r" (val));
++      write_sysreg_s(val, ICC_SGI1R_EL1);
+ }
+ static inline u32 gic_read_sre(void)
+ {
+-      u64 val;
+-
+-      asm volatile("mrs_s %0, " __stringify(ICC_SRE_EL1) : "=r" (val));
+-      return val;
++      return read_sysreg_s(ICC_SRE_EL1);
+ }
+ static inline void gic_write_sre(u32 val)
+ {
+-      asm volatile("msr_s " __stringify(ICC_SRE_EL1) ", %0" : : "r" ((u64)val));
++      write_sysreg_s(val, ICC_SRE_EL1);
+       isb();
+ }
+ static inline void gic_write_bpr1(u32 val)
+ {
+-      asm volatile("msr_s " __stringify(ICC_BPR1_EL1) ", %0" : : "r" (val));
++      write_sysreg_s(val, ICC_BPR1_EL1);
+ }
+ #define gic_read_typer(c)             readq_relaxed(c)
diff --git a/queue-4.9/kbuild-add-no-integrated-as-clang-option-unconditionally.patch b/queue-4.9/kbuild-add-no-integrated-as-clang-option-unconditionally.patch
new file mode 100644 (file)
index 0000000..7c8a12f
--- /dev/null
@@ -0,0 +1,37 @@
+From foo@baz Mon Feb 25 15:52:02 CET 2019
+From: Masahiro Yamada <yamada.masahiro@socionext.com>
+Date: Tue, 6 Nov 2018 12:04:54 +0900
+Subject: kbuild: add -no-integrated-as Clang option unconditionally
+
+From: Masahiro Yamada <yamada.masahiro@socionext.com>
+
+commit dbe27a002ef8573168cb64e181458ea23a74e2b6 upstream.
+
+We are still a way off the Clang's integrated assembler support for
+the kernel. Hence, -no-integrated-as is mandatory to build the kernel
+with Clang. If you had an ancient version of Clang that does not
+recognize this option, you would not be able to compile the kernel
+anyway.
+
+Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
+Tested-by: Nick Desaulniers <ndesaulniers@google.com>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -516,8 +516,8 @@ CLANG_GCC_TC       := --gcc-toolchain=$(GCC_TO
+ endif
+ KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+ KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+-KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
+-KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
++KBUILD_CFLAGS += -no-integrated-as
++KBUILD_AFLAGS += -no-integrated-as
+ endif
diff --git a/queue-4.9/kbuild-clang-disable-unused-variable-warnings-only-when-constant.patch b/queue-4.9/kbuild-clang-disable-unused-variable-warnings-only-when-constant.patch
new file mode 100644 (file)
index 0000000..175c418
--- /dev/null
@@ -0,0 +1,49 @@
+From foo@baz Mon Feb 25 15:52:02 CET 2019
+From: Sodagudi Prasad <psodagud@codeaurora.org>
+Date: Tue, 6 Feb 2018 15:46:51 -0800
+Subject: kbuild: clang: disable unused variable warnings only when constant
+
+From: Sodagudi Prasad <psodagud@codeaurora.org>
+
+commit 0a5f41767444cc3b4fc5573921ab914b4f78baaa upstream.
+
+Currently, GCC disables -Wunused-const-variable, but not
+-Wunused-variable, so warns unused variables if they are
+non-constant.
+
+While, Clang does not warn unused variables at all regardless of
+the const qualifier because -Wno-unused-const-variable is implied
+by the stronger option -Wno-unused-variable.
+
+Disable -Wunused-const-variable instead of -Wunused-variable so that
+GCC and Clang work in the same way.
+
+Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
+Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -716,7 +716,6 @@ KBUILD_CFLAGS += $(stackp-flag)
+ ifeq ($(cc-name),clang)
+ KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
+-KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
+ KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
+ KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
+ KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
+@@ -734,9 +733,9 @@ else
+ # These warnings generated too much noise in a regular build.
+ # Use make W=1 to enable them (see scripts/Makefile.extrawarn)
+ KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
+-KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
+ endif
++KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
+ ifdef CONFIG_FRAME_POINTER
+ KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
+ else
diff --git a/queue-4.9/kbuild-clang-fix-build-failures-with-sparse-check.patch b/queue-4.9/kbuild-clang-fix-build-failures-with-sparse-check.patch
new file mode 100644 (file)
index 0000000..47ef24a
--- /dev/null
@@ -0,0 +1,41 @@
+From foo@baz Mon Feb 25 15:52:02 CET 2019
+From: David Lin <dtwlin@google.com>
+Date: Fri, 20 Oct 2017 14:09:13 -0700
+Subject: kbuild: clang: fix build failures with sparse check
+
+From: David Lin <dtwlin@google.com>
+
+commit bb3f38c3c5b759163e09b9152629cc789731de47 upstream.
+
+We should avoid using the space character when passing arguments to
+clang, because static code analysis check tool such as sparse may
+misinterpret the arguments followed by spaces as build targets hence
+cause the build to fail.
+
+Signed-off-by: David Lin <dtwlin@google.com>
+Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+[nc: Backport to 4.9; adjust context]
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -511,13 +511,13 @@ endif
+ ifeq ($(cc-name),clang)
+ ifneq ($(CROSS_COMPILE),)
+-CLANG_TARGET  := -target $(notdir $(CROSS_COMPILE:%-=%))
++CLANG_TARGET  := --target=$(notdir $(CROSS_COMPILE:%-=%))
+ GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))
+ CLANG_PREFIX  := --prefix=$(GCC_TOOLCHAIN_DIR)
+ GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
+ endif
+ ifneq ($(GCC_TOOLCHAIN),)
+-CLANG_GCC_TC  := -gcc-toolchain $(GCC_TOOLCHAIN)
++CLANG_GCC_TC  := --gcc-toolchain=$(GCC_TOOLCHAIN)
+ endif
+ KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+ KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
diff --git a/queue-4.9/kbuild-clang-remove-crufty-hostcflags.patch b/queue-4.9/kbuild-clang-remove-crufty-hostcflags.patch
new file mode 100644 (file)
index 0000000..fd39f03
--- /dev/null
@@ -0,0 +1,45 @@
+From foo@baz Mon Feb 25 15:52:02 CET 2019
+From: Nick Desaulniers <nick.desaulniers@gmail.com>
+Date: Sat, 7 Oct 2017 13:23:23 -0700
+Subject: kbuild: clang: remove crufty HOSTCFLAGS
+
+From: Nick Desaulniers <nick.desaulniers@gmail.com>
+
+commit df16aaac26e92e97ab7234d3f93c953466adc4b5 upstream.
+
+When compiling with `make CC=clang HOSTCC=clang`, I was seeing warnings
+that clang did not recognize -fno-delete-null-pointer-checks for HOSTCC
+targets.  These were added in commit 61163efae020 ("kbuild: LLVMLinux:
+Add Kbuild support for building kernel with Clang").
+
+Clang does not support -fno-delete-null-pointer-checks, so adding it to
+HOSTCFLAGS if HOSTCC is clang does not make sense.
+
+It's not clear why the other warnings were disabled, and just for
+HOSTCFLAGS, but I can remove them, add -Werror to HOSTCFLAGS and compile
+with clang just fine.
+
+Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
+Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+[nc: Backport to 4.9; adjust context]
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile |    5 -----
+ 1 file changed, 5 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -306,11 +306,6 @@ HOSTCXX      = g++
+ HOSTCFLAGS   := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89
+ HOSTCXXFLAGS = -O2
+-ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
+-HOSTCFLAGS  += -Wno-unused-value -Wno-unused-parameter \
+-              -Wno-missing-field-initializers -fno-delete-null-pointer-checks
+-endif
+-
+ # Decide whether to build built-in, modular, or both.
+ # Normally, just do built-in.
diff --git a/queue-4.9/kbuild-move-cc-option-and-cc-disable-warning-after-incl.-arch-makefile.patch b/queue-4.9/kbuild-move-cc-option-and-cc-disable-warning-after-incl.-arch-makefile.patch
new file mode 100644 (file)
index 0000000..12d62ad
--- /dev/null
@@ -0,0 +1,93 @@
+From foo@baz Mon Feb 25 15:52:02 CET 2019
+From: Masahiro Yamada <yamada.masahiro@socionext.com>
+Date: Mon, 27 Nov 2017 21:15:13 +0900
+Subject: kbuild: move cc-option and cc-disable-warning after incl. arch Makefile
+
+From: Masahiro Yamada <yamada.masahiro@socionext.com>
+
+commit cfe17c9bbe6a673fdafdab179c32b355ed447f66 upstream.
+
+Geert reported commit ae6b289a3789 ("kbuild: Set KBUILD_CFLAGS before
+incl. arch Makefile") broke cross-compilation using a cross-compiler
+that supports less compiler options than the host compiler.
+
+For example,
+
+  cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"
+
+This problem happens on architectures that setup CROSS_COMPILE in their
+arch/*/Makefile.
+
+Move the cc-option and cc-disable-warning back to the original position,
+but keep the Clang target options untouched.
+
+Fixes: ae6b289a3789 ("kbuild: Set KBUILD_CFLAGS before incl. arch Makefile")
+Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
+[nc: Backport to 4.9; adjust context due to a previous backport]
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile |   43 +++++++++++++++++++++++--------------------
+ 1 file changed, 23 insertions(+), 20 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -521,26 +521,6 @@ CLANG_GCC_TC      := -gcc-toolchain $(GCC_TOO
+ endif
+ KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+ KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+-KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
+-KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
+-KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
+-KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
+-KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
+-# Quiet clang warning: comparison of unsigned expression < 0 is always false
+-KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
+-# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
+-# source of a reference will be _MergedGlobals and not on of the whitelisted names.
+-# See modpost pattern 2
+-KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
+-KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
+-KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
+-KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
+-else
+-
+-# These warnings generated too much noise in a regular build.
+-# Use make W=1 to enable them (see scripts/Makefile.build)
+-KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
+-KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
+ endif
+@@ -739,6 +719,29 @@ ifdef CONFIG_CC_STACKPROTECTOR
+ endif
+ KBUILD_CFLAGS += $(stackp-flag)
++ifeq ($(cc-name),clang)
++KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
++KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
++KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
++KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
++KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
++# Quiet clang warning: comparison of unsigned expression < 0 is always false
++KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
++# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
++# source of a reference will be _MergedGlobals and not on of the whitelisted names.
++# See modpost pattern 2
++KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
++KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
++KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
++KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
++else
++
++# These warnings generated too much noise in a regular build.
++# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
++KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
++KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
++endif
++
+ ifdef CONFIG_FRAME_POINTER
+ KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
+ else
diff --git a/queue-4.9/kbuild-set-no-integrated-as-before-incl.-arch-makefile.patch b/queue-4.9/kbuild-set-no-integrated-as-before-incl.-arch-makefile.patch
new file mode 100644 (file)
index 0000000..19e02db
--- /dev/null
@@ -0,0 +1,43 @@
+From foo@baz Mon Feb 25 15:52:02 CET 2019
+From: Stefan Agner <stefan@agner.ch>
+Date: Mon, 19 Mar 2018 22:12:53 +0100
+Subject: kbuild: set no-integrated-as before incl. arch Makefile
+
+From: Stefan Agner <stefan@agner.ch>
+
+commit 0f0e8de334c54c38818a4a5390a39aa09deff5bf upstream.
+
+In order to make sure compiler flag detection for ARM works
+correctly the no-integrated-as flags need to be set before
+including the arch specific Makefile.
+
+Fixes: cfe17c9bbe6a ("kbuild: move cc-option and cc-disable-warning after incl. arch Makefile")
+Signed-off-by: Stefan Agner <stefan@agner.ch>
+Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+[nc: Backport to 4.9; adjust context due to a previous backport]
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -516,6 +516,8 @@ CLANG_GCC_TC       := --gcc-toolchain=$(GCC_TO
+ endif
+ KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+ KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
++KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
++KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
+ endif
+@@ -726,8 +728,6 @@ KBUILD_CFLAGS += $(call cc-disable-warni
+ # See modpost pattern 2
+ KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
+ KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
+-KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
+-KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
+ else
+ # These warnings generated too much noise in a regular build.
diff --git a/queue-4.9/mm-zsmalloc.c-change-stat-type-parameter-to-int.patch b/queue-4.9/mm-zsmalloc.c-change-stat-type-parameter-to-int.patch
new file mode 100644 (file)
index 0000000..6fcf8f7
--- /dev/null
@@ -0,0 +1,56 @@
+From foo@baz Mon Feb 25 15:53:33 CET 2019
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Fri, 8 Sep 2017 16:13:02 -0700
+Subject: mm/zsmalloc.c: change stat type parameter to int
+
+From: Matthias Kaehlcke <mka@chromium.org>
+
+commit 3eb95feac113d8ebad5b7b5189a65efcbd95a749 upstream.
+
+zs_stat_inc/dec/get() uses enum zs_stat_type for the stat type, however
+some callers pass an enum fullness_group value.  Change the type to int to
+reflect the actual use of the functions and get rid of 'enum-conversion'
+warnings
+
+Link: http://lkml.kernel.org/r/20170731175000.56538-1-mka@chromium.org
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
+Acked-by: Minchan Kim <minchan@kernel.org>
+Cc: Doug Anderson <dianders@chromium.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ mm/zsmalloc.c |    9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+--- a/mm/zsmalloc.c
++++ b/mm/zsmalloc.c
+@@ -558,20 +558,23 @@ static int get_size_class_index(int size
+       return min(zs_size_classes - 1, idx);
+ }
++/* type can be of enum type zs_stat_type or fullness_group */
+ static inline void zs_stat_inc(struct size_class *class,
+-                              enum zs_stat_type type, unsigned long cnt)
++                              int type, unsigned long cnt)
+ {
+       class->stats.objs[type] += cnt;
+ }
++/* type can be of enum type zs_stat_type or fullness_group */
+ static inline void zs_stat_dec(struct size_class *class,
+-                              enum zs_stat_type type, unsigned long cnt)
++                              int type, unsigned long cnt)
+ {
+       class->stats.objs[type] -= cnt;
+ }
++/* type can be of enum type zs_stat_type or fullness_group */
+ static inline unsigned long zs_stat_get(struct size_class *class,
+-                              enum zs_stat_type type)
++                              int type)
+ {
+       return class->stats.objs[type];
+ }
diff --git a/queue-4.9/mm-zsmalloc.c-fix-wunneeded-internal-declaration-warning.patch b/queue-4.9/mm-zsmalloc.c-fix-wunneeded-internal-declaration-warning.patch
new file mode 100644 (file)
index 0000000..8d9fda7
--- /dev/null
@@ -0,0 +1,42 @@
+From foo@baz Mon Feb 25 15:53:33 CET 2019
+From: Nick Desaulniers <nick.desaulniers@gmail.com>
+Date: Mon, 10 Jul 2017 15:47:26 -0700
+Subject: mm/zsmalloc.c: fix -Wunneeded-internal-declaration warning
+
+From: Nick Desaulniers <nick.desaulniers@gmail.com>
+
+commit 3457f4147675108aa83f9f33c136f06bb9f8518f upstream.
+
+is_first_page() is only called from the macro VM_BUG_ON_PAGE() which is
+only compiled in as a runtime check when CONFIG_DEBUG_VM is set,
+otherwise is checked at compile time and not actually compiled in.
+
+Fixes the following warning, found with Clang:
+
+  mm/zsmalloc.c:472:12: warning: function 'is_first_page' is not needed and will not be emitted [-Wunneeded-internal-declaration]
+  static int is_first_page(struct page *page)
+           ^
+
+Link: http://lkml.kernel.org/r/20170524053859.29059-1-nick.desaulniers@gmail.com
+Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
+Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
+Acked-by: Minchan Kim <minchan@kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ mm/zsmalloc.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/mm/zsmalloc.c
++++ b/mm/zsmalloc.c
+@@ -473,7 +473,7 @@ static bool is_zspage_isolated(struct zs
+       return zspage->isolated;
+ }
+-static int is_first_page(struct page *page)
++static __maybe_unused int is_first_page(struct page *page)
+ {
+       return PagePrivate(page);
+ }
diff --git a/queue-4.9/netpoll-fix-device-name-check-in-netpoll_setup.patch b/queue-4.9/netpoll-fix-device-name-check-in-netpoll_setup.patch
new file mode 100644 (file)
index 0000000..3bb091a
--- /dev/null
@@ -0,0 +1,38 @@
+From foo@baz Mon Feb 25 15:48:37 CET 2019
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Tue, 25 Jul 2017 11:36:25 -0700
+Subject: netpoll: Fix device name check in netpoll_setup()
+
+From: Matthias Kaehlcke <mka@chromium.org>
+
+commit 0c3a8f8b8fabff4f3ad2dd7b95ae0e90cdd1aebb upstream.
+
+Apparently netpoll_setup() assumes that netpoll.dev_name is a pointer
+when checking if the device name is set:
+
+if (np->dev_name) {
+  ...
+
+However the field is a character array, therefore the condition always
+yields true. Check instead whether the first byte of the array has a
+non-zero value.
+
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/core/netpoll.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/core/netpoll.c
++++ b/net/core/netpoll.c
+@@ -666,7 +666,7 @@ int netpoll_setup(struct netpoll *np)
+       int err;
+       rtnl_lock();
+-      if (np->dev_name) {
++      if (np->dev_name[0]) {
+               struct net *net = current->nsproxy->net_ns;
+               ndev = __dev_get_by_name(net, np->dev_name);
+       }
index 1de5b3e98f8cb6c465806568a907a8343a51a055..c4801b234f3e672fbe4f38291d452482735f1fb2 100644 (file)
@@ -39,3 +39,19 @@ parisc-fix-ptrace-syscall-number-modification.patch
 arcv2-enable-unaligned-access-in-early-asm-code.patch
 arc-u-boot-check-arguments-paranoidly.patch
 arc-define-arch_slab_minalign-8.patch
+hpet-make-cmd-parameter-of-hpet_ioctl_common-unsigned.patch
+clocksource-use-genmask_ull-in-definition-of-clocksource_mask.patch
+netpoll-fix-device-name-check-in-netpoll_setup.patch
+tracing-use-cpumask_available-to-check-if-cpumask-variable-may-be-used.patch
+x86-boot-disable-the-address-of-packed-member-compiler-warning.patch
+drm-i915-consistently-use-enum-pipe-for-pch-transcoders.patch
+drm-i915-fix-enum-pipe-vs.-enum-transcoder-for-the-pch-transcoder.patch
+kbuild-move-cc-option-and-cc-disable-warning-after-incl.-arch-makefile.patch
+kbuild-clang-fix-build-failures-with-sparse-check.patch
+kbuild-clang-remove-crufty-hostcflags.patch
+kbuild-clang-disable-unused-variable-warnings-only-when-constant.patch
+kbuild-set-no-integrated-as-before-incl.-arch-makefile.patch
+kbuild-add-no-integrated-as-clang-option-unconditionally.patch
+irqchip-gic-v3-convert-arm64-gic-accessors-to-read-write-_sysreg_s.patch
+mm-zsmalloc.c-change-stat-type-parameter-to-int.patch
+mm-zsmalloc.c-fix-wunneeded-internal-declaration-warning.patch
diff --git a/queue-4.9/tracing-use-cpumask_available-to-check-if-cpumask-variable-may-be-used.patch b/queue-4.9/tracing-use-cpumask_available-to-check-if-cpumask-variable-may-be-used.patch
new file mode 100644 (file)
index 0000000..2873680
--- /dev/null
@@ -0,0 +1,44 @@
+From foo@baz Mon Feb 25 15:48:37 CET 2019
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Fri, 21 Apr 2017 16:41:10 -0700
+Subject: tracing: Use cpumask_available() to check if cpumask variable may be used
+
+From: Matthias Kaehlcke <mka@chromium.org>
+
+commit 4dbbe2d8e95c351157f292ece067f985c30c7b53 upstream.
+
+This fixes the following clang warning:
+
+kernel/trace/trace.c:3231:12: warning: address of array 'iter->started'
+  will always evaluate to 'true' [-Wpointer-bool-conversion]
+        if (iter->started)
+
+Link: http://lkml.kernel.org/r/20170421234110.117075-1-mka@chromium.org
+
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/trace/trace.c |    5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/kernel/trace/trace.c
++++ b/kernel/trace/trace.c
+@@ -3022,13 +3022,14 @@ static void test_cpu_buff_start(struct t
+       if (!(iter->iter_flags & TRACE_FILE_ANNOTATE))
+               return;
+-      if (iter->started && cpumask_test_cpu(iter->cpu, iter->started))
++      if (cpumask_available(iter->started) &&
++          cpumask_test_cpu(iter->cpu, iter->started))
+               return;
+       if (per_cpu_ptr(iter->trace_buffer->data, iter->cpu)->skipped_entries)
+               return;
+-      if (iter->started)
++      if (cpumask_available(iter->started))
+               cpumask_set_cpu(iter->cpu, iter->started);
+       /* Don't print started cpu buffer for the first entry of the trace */
diff --git a/queue-4.9/x86-boot-disable-the-address-of-packed-member-compiler-warning.patch b/queue-4.9/x86-boot-disable-the-address-of-packed-member-compiler-warning.patch
new file mode 100644 (file)
index 0000000..f6aa820
--- /dev/null
@@ -0,0 +1,52 @@
+From foo@baz Mon Feb 25 15:48:37 CET 2019
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Tue, 25 Jul 2017 14:50:53 -0700
+Subject: x86/boot: Disable the address-of-packed-member compiler warning
+
+From: Matthias Kaehlcke <mka@chromium.org>
+
+commit 20c6c189045539d29f4854d92b7ea9c329e1edfc upstream.
+
+The clang warning 'address-of-packed-member' is disabled for the general
+kernel code, also disable it for the x86 boot code.
+
+This suppresses a bunch of warnings like this when building with clang:
+
+./arch/x86/include/asm/processor.h:535:30: warning: taking address of
+  packed member 'sp0' of class or structure 'x86_hw_tss' may result in an
+  unaligned pointer value [-Waddress-of-packed-member]
+    return this_cpu_read_stable(cpu_tss.x86_tss.sp0);
+                                ^~~~~~~~~~~~~~~~~~~
+./arch/x86/include/asm/percpu.h:391:59: note: expanded from macro
+  'this_cpu_read_stable'
+    #define this_cpu_read_stable(var)       percpu_stable_op("mov", var)
+                                                                    ^~~
+./arch/x86/include/asm/percpu.h:228:16: note: expanded from macro
+  'percpu_stable_op'
+    : "p" (&(var)));
+             ^~~
+
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Cc: Doug Anderson <dianders@chromium.org>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Link: http://lkml.kernel.org/r/20170725215053.135586-1-mka@chromium.org
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/x86/boot/compressed/Makefile |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/x86/boot/compressed/Makefile
++++ b/arch/x86/boot/compressed/Makefile
+@@ -34,6 +34,7 @@ KBUILD_CFLAGS += $(cflags-y)
+ KBUILD_CFLAGS += -mno-mmx -mno-sse
+ KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
+ KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
++KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
+ KBUILD_AFLAGS  := $(KBUILD_CFLAGS) -D__ASSEMBLY__
+ GCOV_PROFILE := n