Thread (17 messages) flat view 17 messages, 5 authors, 2011-07-21

Re: [PATCH v2] net: filter: BPF 'JIT' compiler for PPC64

From: Eric Dumazet <hidden>
Date: 2011-07-19 09:06:21
Also in: netdev

Le mardi 19 juillet 2011 à 17:55 +1000, Benjamin Herrenschmidt a écrit :
On Tue, 2011-07-19 at 08:51 +0200, Eric Dumazet wrote:
quoted
quoted
+		case BPF_S_ANC_CPU:
+#ifdef CONFIG_SMP
+			/*
+			 * PACA ptr is r13:
+			 * raw_smp_processor_id() = local_paca->paca_index
+			 */
This could break if one day linux supports more than 65536 cpus :)
quoted
+			PPC_LHZ_OFFS(r_A, 13,
+				     offsetof(struct paca_struct, paca_index));
+#else
+			PPC_LI(r_A, 0);
+#endif
+			break;
As would our implementation of raw_smp_processor_id() and our
spinlocks :-) I don't think we need to fix that -now- but you are
welcome to add something like a
BUILD_BUG_ON(sizeof(local_paca->paca_index) != 2); as a reminder :-)
Please Matt add to your next version this check. I dont think I have to
submit a one line patch later...

On x86_64, cpu_number field is already 32bit, we have some time before
it becomes 64bit ;)

We probably should add some extra check to make sure segment doesnt
change (%gs on x86_64, r13 on ppc64) on a future linux version.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help