commit 43be428de74982c6dea7faa82a366ab5b44e6933
Author: Jan Palus <[email protected]>
Date:   Wed May 3 21:57:06 2023 +0200

    backport fixes for gcc 13

 gcc13.patch | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 145 insertions(+), 9 deletions(-)
---
diff --git a/gcc13.patch b/gcc13.patch
index c6d50abd..44d069a2 100644
--- a/gcc13.patch
+++ b/gcc13.patch
@@ -1,18 +1,36 @@
---- linux-6.1/scripts/gcc-plugins/gcc-common.h.orig    2022-12-11 
23:15:18.000000000 +0100
-+++ linux-6.1/scripts/gcc-plugins/gcc-common.h 2023-05-02 22:21:15.747011409 
+0200
-@@ -71,8 +71,11 @@
+From e6a71160cc145e18ab45195abf89884112e02dfb Mon Sep 17 00:00:00 2001
+From: Kees Cook <[email protected]>
+Date: Wed, 18 Jan 2023 12:21:35 -0800
+Subject: gcc-plugins: Reorganize gimple includes for GCC 13
+
+The gimple-iterator.h header must be included before gimple-fold.h
+starting with GCC 13. Reorganize gimple headers to work for all GCC
+versions.
+
+Reported-by: Palmer Dabbelt <[email protected]>
+Acked-by: Palmer Dabbelt <[email protected]>
+Link: https://lore.kernel.org/all/[email protected]/
+Cc: [email protected]
+Signed-off-by: Kees Cook <[email protected]>
+---
+ scripts/gcc-plugins/gcc-common.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/scripts/gcc-plugins/gcc-common.h 
b/scripts/gcc-plugins/gcc-common.h
+index 9a1895747b153..84c730da36dd3 100644
+--- a/scripts/gcc-plugins/gcc-common.h
++++ b/scripts/gcc-plugins/gcc-common.h
+@@ -77,7 +77,9 @@
  #include "varasm.h"
  #include "stor-layout.h"
  #include "internal-fn.h"
 +#include "gimple.h"
-+#include "gimple-iterator.h"
  #include "gimple-expr.h"
++#include "gimple-iterator.h"
  #include "gimple-fold.h"
-+#include "gimple-ssa.h"
  #include "context.h"
  #include "tree-ssa-alias.h"
- #include "tree-ssa.h"
-@@ -85,11 +88,8 @@
+@@ -91,10 +93,8 @@
  #include "tree-eh.h"
  #include "stmt.h"
  #include "gimplify.h"
@@ -20,7 +38,125 @@
  #include "tree-phinodes.h"
  #include "tree-cfg.h"
 -#include "gimple-iterator.h"
--#include "gimple-ssa.h"
+ #include "gimple-ssa.h"
  #include "ssa-iterators.h"
  
- #include "builtins.h"
+-- 
+cgit 
+
+From ff1cc97b1f4c10db224f276d9615b22835b8c424 Mon Sep 17 00:00:00 2001
+From: "Jiri Slaby (SUSE)" <[email protected]>
+Date: Tue, 13 Dec 2022 13:08:26 +0100
+Subject: block/blk-iocost (gcc13): keep large values in a new enum
+
+Since gcc13, each member of an enum has the same type as the enum [1]. And
+that is inherited from its members. Provided:
+  VTIME_PER_SEC_SHIFT     = 37,
+  VTIME_PER_SEC           = 1LLU << VTIME_PER_SEC_SHIFT,
+  ...
+  AUTOP_CYCLE_NSEC        = 10LLU * NSEC_PER_SEC,
+the named type is unsigned long.
+
+This generates warnings with gcc-13:
+  block/blk-iocost.c: In function 'ioc_weight_prfill':
+  block/blk-iocost.c:3037:37: error: format '%u' expects argument of type 
'unsigned int', but argument 4 has type 'long unsigned int'
+
+  block/blk-iocost.c: In function 'ioc_weight_show':
+  block/blk-iocost.c:3047:34: error: format '%u' expects argument of type 
'unsigned int', but argument 3 has type 'long unsigned int'
+
+So split the anonymous enum with large values to a separate enum, so
+that they don't affect other members.
+
+[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36113
+
+Cc: Martin Liska <[email protected]>
+Cc: Tejun Heo <[email protected]>
+Cc: Josef Bacik <[email protected]>
+Cc: Jens Axboe <[email protected]>
+Cc: [email protected]
+Cc: [email protected]
+Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
+Link: https://lore.kernel.org/r/[email protected]
+Signed-off-by: Jens Axboe <[email protected]>
+---
+ block/blk-iocost.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+(limited to 'block/blk-iocost.c')
+
+diff --git a/block/blk-iocost.c b/block/blk-iocost.c
+index d1bdc12deaa70..549ddc9e0c6f4 100644
+--- a/block/blk-iocost.c
++++ b/block/blk-iocost.c
+@@ -232,7 +232,9 @@ enum {
+ 
+       /* 1/64k is granular enough and can easily be handled w/ u32 */
+       WEIGHT_ONE              = 1 << 16,
++};
+ 
++enum {
+       /*
+        * As vtime is used to calculate the cost of each IO, it needs to
+        * be fairly high precision.  For example, it should be able to
+-- 
+cgit 
+
+From 5f2779dfa7b8cc7dfd4a1b6586d86e0d193266f3 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <[email protected]>
+Date: Wed, 18 Jan 2023 09:07:01 +0100
+Subject: blk-iocost: avoid 64-bit division in ioc_timer_fn
+
+The behavior of 'enum' types has changed in gcc-13, so now the
+UNBUSY_THR_PCT constant is interpreted as a 64-bit number because
+it is defined as part of the same enum definition as some other
+constants that do not fit within a 32-bit integer. This in turn
+leads to some inefficient code on 32-bit architectures as well
+as a link error:
+
+arm-linux-gnueabi/bin/arm-linux-gnueabi-ld: block/blk-iocost.o: in function 
`ioc_timer_fn':
+blk-iocost.c:(.text+0x68e8): undefined reference to `__aeabi_uldivmod'
+arm-linux-gnueabi-ld: blk-iocost.c:(.text+0x6908): undefined reference to 
`__aeabi_uldivmod'
+
+Split the enum definition to keep the 64-bit timing constants in
+a separate enum type from those constants that can clearly fit
+within a smaller type.
+
+Signed-off-by: Arnd Bergmann <[email protected]>
+Acked-by: Tejun Heo <[email protected]>
+Link: https://lore.kernel.org/r/[email protected]
+Signed-off-by: Jens Axboe <[email protected]>
+---
+ block/blk-iocost.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+(limited to 'block')
+
+diff --git a/block/blk-iocost.c b/block/blk-iocost.c
+index 6955605629e4f..b691b6bb498f3 100644
+--- a/block/blk-iocost.c
++++ b/block/blk-iocost.c
+@@ -258,6 +258,11 @@ enum {
+       VRATE_MIN               = VTIME_PER_USEC * VRATE_MIN_PPM / MILLION,
+       VRATE_CLAMP_ADJ_PCT     = 4,
+ 
++      /* switch iff the conditions are met for longer than this */
++      AUTOP_CYCLE_NSEC        = 10LLU * NSEC_PER_SEC,
++};
++
++enum {
+       /* if IOs end up waiting for requests, issue less */
+       RQ_WAIT_BUSY_PCT        = 5,
+ 
+@@ -296,9 +301,6 @@ enum {
+       /* don't let cmds which take a very long time pin lagging for too long 
*/
+       MAX_LAGGING_PERIODS     = 10,
+ 
+-      /* switch iff the conditions are met for longer than this */
+-      AUTOP_CYCLE_NSEC        = 10LLU * NSEC_PER_SEC,
+-
+       /*
+        * Count IO size in 4k pages.  The 12bit shift helps keeping
+        * size-proportional components of cost calculation in closer
+-- 
+cgit 
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/kernel.git/commitdiff/43be428de74982c6dea7faa82a366ab5b44e6933

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to