[kernel/f21] arm64-fix-ooo-descriptor-read.patch: fix an xgene-enet crash.

Kyle McMartin kyle at fedoraproject.org
Fri Mar 13 18:03:58 UTC 2015


commit 47eba0ef8ff6e7e3167fb456d8eb14b05834d87b
Author: Kyle McMartin <kmcmarti at redhat.com>
Date:   Fri Mar 13 14:03:32 2015 -0400

    arm64-fix-ooo-descriptor-read.patch: fix an xgene-enet crash.

 arm64-fix-ooo-descriptor-read.patch | 64 +++++++++++++++++++++++++++++++++++++
 kernel.spec                         |  5 +--
 2 files changed, 67 insertions(+), 2 deletions(-)
---
diff --git a/arm64-fix-ooo-descriptor-read.patch b/arm64-fix-ooo-descriptor-read.patch
new file mode 100644
index 0000000..dd65c0b
--- /dev/null
+++ b/arm64-fix-ooo-descriptor-read.patch
@@ -0,0 +1,64 @@
+commit ecf6ba83d76e0c78e89401750dc527008e14faa2
+Author: Iyappan Subramanian <isubramanian at apm.com>
+Date:   Thu Jan 29 14:38:23 2015 -0800
+
+    drivers: net: xgene: fix: Out of order descriptor bytes read
+    
+    This patch fixes the following kernel crash,
+    
+    	WARNING: CPU: 2 PID: 0 at net/ipv4/tcp_input.c:3079 tcp_clean_rtx_queue+0x658/0x80c()
+    	Call trace:
+    	[<fffffe0000096b7c>] dump_backtrace+0x0/0x184
+    	[<fffffe0000096d10>] show_stack+0x10/0x1c
+    	[<fffffe0000685ea0>] dump_stack+0x74/0x98
+    	[<fffffe00000b44e0>] warn_slowpath_common+0x88/0xb0
+    	[<fffffe00000b461c>] warn_slowpath_null+0x14/0x20
+    	[<fffffe00005b5c1c>] tcp_clean_rtx_queue+0x654/0x80c
+    	[<fffffe00005b6228>] tcp_ack+0x454/0x688
+    	[<fffffe00005b6ca8>] tcp_rcv_established+0x4a4/0x62c
+    	[<fffffe00005bf4b4>] tcp_v4_do_rcv+0x16c/0x350
+    	[<fffffe00005c225c>] tcp_v4_rcv+0x8e8/0x904
+    	[<fffffe000059d470>] ip_local_deliver_finish+0x100/0x26c
+    	[<fffffe000059dad8>] ip_local_deliver+0xac/0xc4
+    	[<fffffe000059d6c4>] ip_rcv_finish+0xe8/0x328
+    	[<fffffe000059dd3c>] ip_rcv+0x24c/0x38c
+    	[<fffffe0000563950>] __netif_receive_skb_core+0x29c/0x7c8
+    	[<fffffe0000563ea4>] __netif_receive_skb+0x28/0x7c
+    	[<fffffe0000563f54>] netif_receive_skb_internal+0x5c/0xe0
+    	[<fffffe0000564810>] napi_gro_receive+0xb4/0x110
+    	[<fffffe0000482a2c>] xgene_enet_process_ring+0x144/0x338
+    	[<fffffe0000482d18>] xgene_enet_napi+0x1c/0x50
+    	[<fffffe0000565454>] net_rx_action+0x154/0x228
+    	[<fffffe00000b804c>] __do_softirq+0x110/0x28c
+    	[<fffffe00000b8424>] irq_exit+0x8c/0xc0
+    	[<fffffe0000093898>] handle_IRQ+0x44/0xa8
+    	[<fffffe000009032c>] gic_handle_irq+0x38/0x7c
+    	[...]
+    
+    Software writes poison data into the descriptor bytes[15:8] and upon
+    receiving the interrupt, if those bytes are overwritten by the hardware with
+    the valid data, software also reads bytes[7:0] and executes receive/tx
+    completion logic.
+    
+    If the CPU executes the above two reads in out of order fashion, then the
+    bytes[7:0] will have older data and causing the kernel panic.  We have to
+    force the order of the reads and thus this patch introduces read memory
+    barrier between these reads.
+    
+    Signed-off-by: Iyappan Subramanian <isubramanian at apm.com>
+    Signed-off-by: Keyur Chudgar <kchudgar at apm.com>
+    Signed-off-by: David S. Miller <davem at davemloft.net>
+
+diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+index 83a5028..793f3b7 100644
+--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
++++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+@@ -369,6 +369,8 @@ static int xgene_enet_process_ring(struct xgene_enet_desc_ring *ring,
+ 		if (unlikely(xgene_enet_is_desc_slot_empty(raw_desc)))
+ 			break;
+ 
++		/* read fpqnum field after dataaddr field */
++		dmb(oshld);
+ 		if (is_rx_desc(raw_desc))
+ 			ret = xgene_enet_rx_frame(ring, raw_desc);
+ 		else
diff --git a/kernel.spec b/kernel.spec
index 10ab42d..ccf51ad 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -676,6 +676,7 @@ Patch26168: HID-multitouch-add-support-of-clickpads.patch
 # git clone ssh://git.fedorahosted.org/git/kernel-arm64.git, git diff master...devel
 Patch30000: kernel-arm64.patch
 Patch30001: arm64-revert-tlb-rcu_table_free.patch
+Patch30002: arm64-fix-ooo-descriptor-read.patch
 
 # END OF PATCH DEFINITIONS
 
@@ -1461,11 +1462,10 @@ ApplyPatch HID-multitouch-add-support-of-clickpads.patch
 %if 0%{?aarch64patches}
 ApplyPatch kernel-arm64.patch
 ApplyPatch arm64-revert-tlb-rcu_table_free.patch
+ApplyPatch arm64-fix-ooo-descriptor-read.patch
 %ifnarch aarch64 # this is stupid, but i want to notice before secondary koji does.
 ApplyPatch kernel-arm64.patch -R
 ApplyPatch arm64-revert-tlb-rcu_table_free.patch -R
-%else
-#  solved with SPCR in future
 %endif
 %endif
 
@@ -2334,6 +2334,7 @@ fi
 - arm64-revert-tlb-rcu_table_free.patch: revert 5e5f6dc1 which causes
   lockups on arm64 machines.
 - Add kernel-4* to .gitignore.
+- arm64-fix-ooo-descriptor-read.patch: fix an xgene-enet crash.
 
 * Fri Mar 13 2015 Josh Boyer <jwboyer at fedoraproject.org>
 - Add patch to support clickpads (rhbz 1201532)


More information about the scm-commits mailing list