while ( (l1i = ffs(l1)) != 0 ) { l1i--; l1 &= ~(1 << l1i); l2 = s->evtchn_pending[l1i] & ~s->evtchn_mask[l1i]; while ( (l2i = ffs(l2)) != 0 ) { l2i--; from evtchn.c This seems to assume that ffs is 1-relative in the bit numbers. My testing shows it is 0-relative, and the manual bears me out. Has this code changed in the latest, am I missing something, or ... For Plan 9 I changed it to: while ( (l1i = ffs(l1)) >= 0 ) { l1 &= ~(1 << l1i); l2 = s->evtchn_pending[l1i] & ~s->evtchn_mask[l1i]; while ( (l2i = ffs(l2)) >= 0 ) { ron ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
> This seems to assume that ffs is 1-relative in the bit numbers. My testing > shows it is 0-relative, and the manual bears me out.Linux follows the libc convention of returning a 1-relative bit offset, or 0 for ''no bits set''. Maybe your ffs() routine is different? -- Keir ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
On Tue, 29 Jun 2004, Keir Fraser wrote:> Linux follows the libc convention of returning a 1-relative bit > offset, or 0 for ''no bits set''.this is weird. I''m beginning to worry about vmware. I had a printk on this ffs() stuff in vmware and for ffs(1) I got a zero; on my laptop it just got 1. damn. Also, I fixed another problem in hypervisor_callback by removing PUSHW ES (push %es for linux folks). Yep, if the callback pushed ES it would trap, otherwise not. arg. I really need to get off vmware soon :-) ron ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel