View Issue Details

IDProjectCategoryView StatusLast Update
0016324CentOS-7CentOS-7-Pluspublic2019-09-10 22:14
Reportertoracat 
PrioritynormalSeverityminorReproducibilityN/A
Status assignedResolutionopen 
Product Version7.7-1908 
Target Version7.7-1908Fixed in Version 
Summary0016324: i386 plus kernel for CentOS 7.7 fails to build
DescriptionThe i386 version of plus kernel for CentOS 7.7 fails to build.

The following 3 patches have been modified from 7.6 because of code changes:

patch-i686-bpf-nojit-v7_7.patch
patch-i686-fpu-issues-v4-8_0-v7_7.patch
patch-vmx-cmpxchg64-c0a1666bcb-v7_7.patch

The following patch has been removed because the fix was in the distro kernel:

patch-md-dax-toiovecend-null.patch

%prep goes through fine.
%build fails.

The src.rpm, kernel-3.10.0-1062.el7.centos.plus.src.rpm, is found in https://people.centos.org/toracat/kernel/7/plus/i386/ .
Additional InformationActual error below, although more errors are likely to occur as the build advances.

In file included from ./arch/x86/include/asm/atomic.h:4:0,
                 from include/linux/atomic.h:4,
                 from include/linux/crypto.h:20,
                 from arch/x86/kernel/asm-offsets.c:8:
include/linux/fs.h: In function 'i_readcount_dec':
include/linux/fs.h:2858:28: error: 'struct inode' has no member named 'i_readcount'
  BUG_ON(!atomic_read(&inode->i_readcount));
                            ^
include/linux/compiler.h:153:42: note: in definition of macro 'unlikely'
 # define unlikely(x) __builtin_expect(!!(x), 0)
                                          ^
include/linux/fs.h:2858:2: note: in expansion of macro 'BUG_ON'
  BUG_ON(!atomic_read(&inode->i_readcount));
  ^
In file included from include/linux/cgroup.h:22:0,
                 from include/linux/memcontrol.h:22,
                 from include/linux/swap.h:8,
                 from include/linux/suspend.h:4,
                 from arch/x86/kernel/asm-offsets.c:12:
include/linux/fs.h:2859:19: error: 'struct inode' has no member named 'i_readcount'
  atomic_dec(&inode->i_readcount);
                   ^
include/linux/fs.h: In function 'i_readcount_inc':
include/linux/fs.h:2863:19: error: 'struct inode' has no member named 'i_readcount'
  atomic_inc(&inode->i_readcount);
                   ^
make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1
TagsNo tags attached.
abrt_hash
URL

Activities

toracat

toracat

2019-08-09 05:18

manager   ~0034938

Patch submitted by @pgreco attached.

patch-i686-v7_7.patch (3,146 bytes)
centos 7.7 plus kerenl patch for i686 

Written-by: Pablo Greco <pablo@fliagreco.com.ar>

diff -aurp a/drivers/net/ethernet/intel/ice/ice_osdep.h b/drivers/net/ethernet/intel/ice/ice_osdep.h
--- a/drivers/net/ethernet/intel/ice/ice_osdep.h	2019-07-18 16:58:03.000000000 -0300
+++ b/drivers/net/ethernet/intel/ice/ice_osdep.h	2019-08-08 23:16:36.399822146 -0300
@@ -7,7 +7,7 @@
 #include <linux/types.h>
 #include <linux/io.h>
 #ifndef CONFIG_64BIT
-#include <linux/io-64-nonatomic-lo-hi.h>
+#include <asm-generic/io-64-nonatomic-lo-hi.h>
 #endif
 
 #define wr32(a, reg, value)	writel((value), ((a)->hw_addr + (reg)))
diff -aurp a/drivers/net/ethernet/netronome/nfp/flower/cmsg.c b/drivers/net/ethernet/netronome/nfp/flower/cmsg.c
--- a/drivers/net/ethernet/netronome/nfp/flower/cmsg.c	2019-07-18 16:58:03.000000000 -0300
+++ b/drivers/net/ethernet/netronome/nfp/flower/cmsg.c	2019-08-08 22:55:29.332993839 -0300
@@ -219,7 +219,7 @@ nfp_flower_cmsg_merge_hint_rx(struct nfp
 	flow_cnt = msg->count + 1;
 
 	if (msg_len < struct_size(msg, flow, flow_cnt)) {
-		nfp_flower_cmsg_warn(app, "Merge hint ctrl msg too short - %d bytes but expect %ld\n",
+		nfp_flower_cmsg_warn(app, "Merge hint ctrl msg too short - %d bytes but expect %zd\n",
 				     msg_len, struct_size(msg, flow, flow_cnt));
 		return;
 	}
diff -aurp a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c
--- a/drivers/net/ethernet/qlogic/qed/qed_dev.c	2019-07-18 16:58:03.000000000 -0300
+++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c	2019-08-08 23:17:47.859935008 -0300
@@ -63,6 +63,9 @@
 #include "qed_sriov.h"
 #include "qed_vf.h"
 #include "qed_rdma.h"
+#ifndef CONFIG_64BIT
+#include <asm-generic/io-64-nonatomic-lo-hi.h>
+#endif
 
 static DEFINE_SPINLOCK(qm_lock);
 
diff -aurp a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
--- a/fs/gfs2/bmap.c	2019-07-18 16:58:03.000000000 -0300
+++ b/fs/gfs2/bmap.c	2019-08-08 22:18:24.501014640 -0300
@@ -813,9 +813,9 @@ static int gfs2_iomap_get(struct inode *
 	sector_t lblock_stop;
 	int ret;
 	int eob;
-	u64 len;
+	u64 uninitialized_var(len);
 	struct buffer_head *dibh = NULL, *bh;
-	u8 height;
+	u8 uninitialized_var(height);
 
 	if (!length)
 		return -EINVAL;
diff -aurp a/include/linux/fs.h b/include/linux/fs.h
--- a/include/linux/fs.h	2019-07-18 16:58:03.000000000 -0300
+++ b/include/linux/fs.h	2019-08-08 22:18:24.496014844 -0300
@@ -681,7 +681,7 @@ struct inode {
 			struct fsnotify_mark_connector __rcu *i_fsnotify_marks)
 #endif
 
-#if defined(CONFIG_IMA) && defined(CONFIG_X86_64)
+#if defined(CONFIG_IMA) && defined(CONFIG_X86)
 	atomic_t		i_readcount; /* struct files open RO */
 #endif
 	void			*i_private; /* fs or device private pointer */
diff -aurp a/kernel/bpf/core.c b/kernel/bpf/core.c
--- a/kernel/bpf/core.c	2019-07-18 16:58:03.000000000 -0300
+++ b/kernel/bpf/core.c	2019-08-08 22:18:24.499014722 -0300
@@ -1800,6 +1800,12 @@ int bpf_prog_array_copy_info(struct bpf_
 								     : 0;
 }
 
+#if defined(CONFIG_X86_32)
+void __weak trace_bpf_jit_free(struct bpf_prog *fp)
+{
+}
+#endif
+
 static void bpf_prog_free_deferred(struct work_struct *work)
 {
 	struct bpf_prog_aux *aux;
patch-i686-v7_7.patch (3,146 bytes)
toracat

toracat

2019-08-09 15:17

manager   ~0034940

With @pgreco's patch, the kernel built and booted without any apparent issues.
kabe

kabe

2019-08-11 11:27

reporter   ~0034943

With @pgreco 's patch, I confirmed it seems to be working on real machine (Pentium 4) and Hyper-V.
pgreco

pgreco

2019-08-11 14:07

developer   ~0034944

@kabe, I was waiting to hear your thoughts on the patch.
I don't like very much that empty trace_bpf_jit_free, but it is what was used in 7.6.
toracat

toracat

2019-08-11 17:46

manager   ~0034945

@kabe, thanks for running a real test and the confirmation.
kabe

kabe

2019-08-12 15:57

reporter   ~0034964

@pgreco,
I reviewed the trace_bpf_jit_free() usage.
I couldn't get out of the exact rationale of that function (only RHEL guys know), but
since for i386 we don't have CONFIG_BPF_JIT (only for X86_64),
doing nothing here seems correct.
I'll attach a modified patch essentially doing same thing as yours with comments.

patch-i686-v7_7.2.patch (3,432 bytes)
diff -up ./drivers/net/ethernet/intel/ice/ice_osdep.h.pgr ./drivers/net/ethernet/intel/ice/ice_osdep.h
--- ./drivers/net/ethernet/intel/ice/ice_osdep.h.pgr	2019-07-19 04:58:03.000000000 +0900
+++ ./drivers/net/ethernet/intel/ice/ice_osdep.h	2019-08-12 23:06:50.000000000 +0900
@@ -7,7 +7,7 @@
 #include <linux/types.h>
 #include <linux/io.h>
 #ifndef CONFIG_64BIT
-#include <linux/io-64-nonatomic-lo-hi.h>
+#include <asm-generic/io-64-nonatomic-lo-hi.h>
 #endif
 
 #define wr32(a, reg, value)	writel((value), ((a)->hw_addr + (reg)))
diff -up ./drivers/net/ethernet/netronome/nfp/flower/cmsg.c.pgr ./drivers/net/ethernet/netronome/nfp/flower/cmsg.c
--- ./drivers/net/ethernet/netronome/nfp/flower/cmsg.c.pgr	2019-07-19 04:58:03.000000000 +0900
+++ ./drivers/net/ethernet/netronome/nfp/flower/cmsg.c	2019-08-12 23:06:50.000000000 +0900
@@ -219,7 +219,7 @@ nfp_flower_cmsg_merge_hint_rx(struct nfp
 	flow_cnt = msg->count + 1;
 
 	if (msg_len < struct_size(msg, flow, flow_cnt)) {
-		nfp_flower_cmsg_warn(app, "Merge hint ctrl msg too short - %d bytes but expect %ld\n",
+		nfp_flower_cmsg_warn(app, "Merge hint ctrl msg too short - %d bytes but expect %zd\n",
 				     msg_len, struct_size(msg, flow, flow_cnt));
 		return;
 	}
diff -up ./drivers/net/ethernet/qlogic/qed/qed_dev.c.pgr ./drivers/net/ethernet/qlogic/qed/qed_dev.c
--- ./drivers/net/ethernet/qlogic/qed/qed_dev.c.pgr	2019-07-19 04:58:03.000000000 +0900
+++ ./drivers/net/ethernet/qlogic/qed/qed_dev.c	2019-08-12 23:06:50.000000000 +0900
@@ -63,6 +63,9 @@
 #include "qed_sriov.h"
 #include "qed_vf.h"
 #include "qed_rdma.h"
+#ifndef CONFIG_64BIT
+#include <asm-generic/io-64-nonatomic-lo-hi.h>
+#endif
 
 static DEFINE_SPINLOCK(qm_lock);
 
diff -up ./fs/gfs2/bmap.c.pgr ./fs/gfs2/bmap.c
--- ./fs/gfs2/bmap.c.pgr	2019-07-19 04:58:03.000000000 +0900
+++ ./fs/gfs2/bmap.c	2019-08-12 23:06:50.000000000 +0900
@@ -813,9 +813,9 @@ static int gfs2_iomap_get(struct inode *
 	sector_t lblock_stop;
 	int ret;
 	int eob;
-	u64 len;
+	u64 uninitialized_var(len);
 	struct buffer_head *dibh = NULL, *bh;
-	u8 height;
+	u8 uninitialized_var(height);
 
 	if (!length)
 		return -EINVAL;
diff -up ./include/linux/fs.h.pgr ./include/linux/fs.h
--- ./include/linux/fs.h.pgr	2019-08-12 23:06:50.000000000 +0900
+++ ./include/linux/fs.h	2019-08-12 23:06:50.000000000 +0900
@@ -681,7 +681,7 @@ struct inode {
 			struct fsnotify_mark_connector __rcu *i_fsnotify_marks)
 #endif
 
-#if defined(CONFIG_IMA) && defined(CONFIG_X86_64)
+#if defined(CONFIG_IMA) && defined(CONFIG_X86)
 	atomic_t		i_readcount; /* struct files open RO */
 #endif
 	void			*i_private; /* fs or device private pointer */
diff -up ./kernel/bpf/core.c.pgr ./kernel/bpf/core.c
--- ./kernel/bpf/core.c.pgr	2019-07-19 04:58:03.000000000 +0900
+++ ./kernel/bpf/core.c	2019-08-13 00:24:50.000000000 +0900
@@ -1548,6 +1548,19 @@ void __weak trace_bpf_jit_compile(struct
 {
 }
 
+#ifndef CONFIG_BPF_JIT
+/* trace_bpf_jit_compile() above seems unused? */
+/* trace_bpf_jit_free() is an RHEL artifact.
+ * It seems that #ifdef CONFIG_BPF_JIT around trace_bpf_jit_free() should be
+ * correct, as in kernel/bpf/verifier.c does, but we just
+ * define a null function here.
+ * (fp should not be bpf_prog_unlock_free(fp)'ed here)
+ */
+void __weak trace_bpf_jit_free(struct bpf_prog *fp)
+{
+}
+#endif
+
 /**
  *	bpf_prog_select_runtime - select exec runtime for BPF program
  *	@fp: bpf_prog populated with internal BPF program
patch-i686-v7_7.2.patch (3,432 bytes)
pgreco

pgreco

2019-08-12 16:17

developer   ~0034965

@kabe, that was my rationale too, thanks for looking into it
@toracat, can you update the patch for the next version?, there is no need to rebuild, since it is the same functionality.
toracat

toracat

2019-08-12 16:41

manager   ~0034966

@pgreco, will do.
toracat

toracat

2019-09-10 22:14

manager   ~0035087

@kabe's patch-i686-v7_7.2.patch will be in kernel-3.10.0-1062.1.1.el7.centos.plus.i686.rpm.

Issue History

Date Modified Username Field Change
2019-08-08 19:12 toracat New Issue
2019-08-08 19:16 toracat Status new => assigned
2019-08-08 19:16 toracat Product Version 7.6.1810 => 7.7-1908
2019-08-08 19:16 toracat Target Version => 7.7-1908
2019-08-09 05:18 toracat File Added: patch-i686-v7_7.patch
2019-08-09 05:18 toracat Note Added: 0034938
2019-08-09 15:17 toracat Note Added: 0034940
2019-08-11 11:27 kabe Note Added: 0034943
2019-08-11 14:07 pgreco Note Added: 0034944
2019-08-11 17:46 toracat Note Added: 0034945
2019-08-12 15:57 kabe File Added: patch-i686-v7_7.2.patch
2019-08-12 15:57 kabe Note Added: 0034964
2019-08-12 16:17 pgreco Note Added: 0034965
2019-08-12 16:41 toracat Note Added: 0034966
2019-09-10 22:14 toracat Note Added: 0035087