From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 14430 invoked from network); 24 Feb 1999 04:56:27 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 24 Feb 1999 04:56:27 -0000 Received: from mail.op.net (d-bm4-1f.ppp.op.net [209.152.194.127]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id XAA23031 for ; Tue, 23 Feb 1999 23:56:05 -0500 Received: (from rbowles@localhost) by mail.op.net (8.8.7/8.8.7) id AAA10068; Wed, 24 Feb 1999 00:10:56 -0500 Message-ID: <19990224001055.D927@op.net> Date: Wed, 24 Feb 1999 00:10:55 -0500 From: Robert Bowles To: axp-list@redhat.com Cc: dfrasnel@csee.wvu.edu Subject: Re: [patches] patch-2.2.2-nonx86,patch-2.2.2-filter Reply-To: rbowles@infonautics.com References: <19990223211716.B18379@csee.wvu.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Qbvjkv9qwOGw/5Fx" X-Mailer: Mutt 0.93.2 In-Reply-To: <19990223211716.B18379@csee.wvu.edu>; from Daniel J. Frasnelli on Tue, Feb 23, 1999 at 09:17:16PM -0500 X-host-platform: Linux noname 2.2.1 #18 Mon Feb 22 22:56:28 EST 1999 alpha unknown --Qbvjkv9qwOGw/5Fx Content-Type: text/plain; charset=us-ascii Thanks again for the pointers. I think I got a "roll-forward" patch partly thrown together... Changes/Observations - Socket Filtering Code This alone should be a showstopper. I don't see where this could work on any platform. 'struct sk_filter' is referenced but not defined _anywhere_. The only solution is to build w/o socket filtering code. - Semaphore Code All seems well, except for the whole new '__down_trylock() / waking_non_zero_trylock()' bit. Attached is a patch that does compile without too much weirdness. On the plus side, no rollbacks of x86 code. (someone test this) On the minus, I'm not certain about the semaphore code... On the minus, socket filtering is broken. Good Luck, Bob -- I found my brain and it hurts. On Tue, Feb 23, 1999 at 09:17:16PM -0500, Daniel J. Frasnelli wrote: > So I pointed my browser over to www.alphalinux.org earlier today, > and found this little item near the top: > * February 23rd 1999 > The good news is that kernel 2.2.2 has been released. The bad news > is that it does not compile on Alpha. > > Ah, how sad it was indeed. > Maybe the two attached patches will brighten your day. The first patch > (nonx86) should take care of those nasty x86 semaphores like __down_trylock, > and the second (filter) should take care of, well, broken filter code. > I've had 2.2.2 running for approximately 7+ hours total today, so > the patch appears to be safe. > Note that it is not a comprehensive solution. The final "fix" > for this problem will be bringing semaphores on axp up to where x86 is > right now. We're working on that as well, but in the meantime this > should allow building of 2.2.2. > I've tested this on my Alpha, but it should work for any non-x86 > platform. I am currently compiling the 2.2.2ac1 kernel with the > non-x86 patch applied, so I assume the patch fixes that one as well. > > Enjoy, > Daniel > -- <- snip -> --Qbvjkv9qwOGw/5Fx Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="axp-patch-2.2.2-rb0" diff -u --recursive linux-2.2.2-dist/include/asm-alpha/semaphore.h linux-2.2.2/include/asm-alpha/semaphore.h --- linux-2.2.2-dist/include/asm-alpha/semaphore.h Fri Jan 22 05:27:21 1999 +++ linux-2.2.2/include/asm-alpha/semaphore.h Tue Feb 23 23:37:40 1999 @@ -42,6 +42,10 @@ extern void __down(struct semaphore * sem); extern int __down_interruptible(struct semaphore * sem); +#ifndef __alpha__ +extern int __down_trylock(struct semaphore * sem); +#endif + extern void __up(struct semaphore * sem); /* All three have custom assembly linkages. */ diff -u --recursive linux-2.2.2-dist/include/linux/filter.h linux-2.2.2/include/linux/filter.h --- linux-2.2.2-dist/include/linux/filter.h Sun Dec 21 20:41:24 1997 +++ linux-2.2.2/include/linux/filter.h Tue Feb 23 23:08:05 1999 @@ -100,7 +100,14 @@ #define BPF_MEMWORDS 16 #ifdef __KERNEL__ +/* doing this for an axp-fix, but this seems right period + * as per net/core/filter.c + */ +#if 1 +extern int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen); +#else extern int sk_run_filter(unsigned char *data, int len, struct sock_filter *filter, int flen); +#endif extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); #endif /* __KERNEL__ */ diff -u --recursive linux-2.2.2-dist/include/net/sock.h linux-2.2.2/include/net/sock.h --- linux-2.2.2-dist/include/net/sock.h Mon Feb 22 23:22:47 1999 +++ linux-2.2.2/include/net/sock.h Tue Feb 23 23:38:56 1999 @@ -793,7 +793,7 @@ { int pkt_len; - pkt_len = sk_run_filter(skb, filter->insns, filter->len); + pkt_len = sk_run_filter(skb, &(filter->insns), filter->len); if(!pkt_len) return 1; /* Toss Packet */ else @@ -801,6 +801,10 @@ return 0; } + +#ifdef __alpha__ +#define sk_filter_len(filt) filt->len +#endif extern __inline__ void sk_filter_release(struct sock *sk, struct sk_filter *fp) { diff -u --recursive linux-2.2.2-dist/kernel/ksyms.c linux-2.2.2/kernel/ksyms.c --- linux-2.2.2-dist/kernel/ksyms.c Tue Feb 23 22:27:42 1999 +++ linux-2.2.2/kernel/ksyms.c Tue Feb 23 23:37:09 1999 @@ -61,7 +61,7 @@ extern void free_dma(unsigned int dmanr); extern spinlock_t dma_spin_lock; -#ifdef CONFIG_MODVERSIONS +#ifdef MODVERSIONS const struct module_symbol __export_Using_Versions __attribute__((section("__ksymtab"))) = { 1 /* Version version */, "Using_Versions" @@ -322,8 +322,10 @@ EXPORT_SYMBOL(sprintf); EXPORT_SYMBOL(vsprintf); EXPORT_SYMBOL(kdevname); +#ifndef __alpha__ EXPORT_SYMBOL(bdevname); EXPORT_SYMBOL(cdevname); +#endif EXPORT_SYMBOL(simple_strtoul); EXPORT_SYMBOL(system_utsname); /* UTS data */ EXPORT_SYMBOL(uts_sem); /* UTS semaphore */ @@ -372,7 +370,9 @@ EXPORT_SYMBOL(event); EXPORT_SYMBOL(__down); EXPORT_SYMBOL(__down_interruptible); +#ifndef __alpha__ EXPORT_SYMBOL(__down_trylock); +#endif EXPORT_SYMBOL(__up); EXPORT_SYMBOL(brw_page); diff -u --recursive linux-2.2.2-dist/kernel/sched.c linux-2.2.2/kernel/sched.c --- linux-2.2.2-dist/kernel/sched.c Tue Feb 23 07:12:51 1999 +++ linux-2.2.2/kernel/sched.c Tue Feb 23 23:36:47 1999 @@ -36,7 +36,9 @@ #include #include #include +#ifndef __alpha__ #include +#endif #include @@ -906,7 +908,11 @@ { DOWN_VAR DOWN_HEAD(TASK_UNINTERRUPTIBLE) +#ifdef __alpha__ + if (waking_non_zero(sem,tsk)) +#else if (waking_non_zero(sem)) +#endif break; schedule(); DOWN_TAIL(TASK_UNINTERRUPTIBLE) @@ -918,7 +924,9 @@ int ret = 0; DOWN_HEAD(TASK_INTERRUPTIBLE) +#ifndef __alpha__ ret = waking_non_zero_interruptible(sem, tsk); +#endif if (ret) { if (ret == 1) @@ -931,10 +939,12 @@ return ret; } +#ifndef __alpha__ int __down_trylock(struct semaphore * sem) { return waking_non_zero_trylock(sem); } +#endif #define SLEEP_ON_VAR \ unsigned long flags; \ --Qbvjkv9qwOGw/5Fx--