From 47eba0ef8ff6e7e3167fb456d8eb14b05834d87b Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mar 13 2015 18:03:32 +0000 Subject: arm64-fix-ooo-descriptor-read.patch: fix an xgene-enet crash. --- 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 +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: + [] dump_backtrace+0x0/0x184 + [] show_stack+0x10/0x1c + [] dump_stack+0x74/0x98 + [] warn_slowpath_common+0x88/0xb0 + [] warn_slowpath_null+0x14/0x20 + [] tcp_clean_rtx_queue+0x654/0x80c + [] tcp_ack+0x454/0x688 + [] tcp_rcv_established+0x4a4/0x62c + [] tcp_v4_do_rcv+0x16c/0x350 + [] tcp_v4_rcv+0x8e8/0x904 + [] ip_local_deliver_finish+0x100/0x26c + [] ip_local_deliver+0xac/0xc4 + [] ip_rcv_finish+0xe8/0x328 + [] ip_rcv+0x24c/0x38c + [] __netif_receive_skb_core+0x29c/0x7c8 + [] __netif_receive_skb+0x28/0x7c + [] netif_receive_skb_internal+0x5c/0xe0 + [] napi_gro_receive+0xb4/0x110 + [] xgene_enet_process_ring+0x144/0x338 + [] xgene_enet_napi+0x1c/0x50 + [] net_rx_action+0x154/0x228 + [] __do_softirq+0x110/0x28c + [] irq_exit+0x8c/0xc0 + [] handle_IRQ+0x44/0xa8 + [] 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 + Signed-off-by: Keyur Chudgar + Signed-off-by: David S. Miller + +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 - Add patch to support clickpads (rhbz 1201532)