From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755560AbdIGRv0 (ORCPT ); Thu, 7 Sep 2017 13:51:26 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:33107 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751634AbdIGRvX (ORCPT ); Thu, 7 Sep 2017 13:51:23 -0400 X-Google-Smtp-Source: AOwi7QC6q+De54+h1EkAtaIrDNJTLH5Idc/Y/rTdPIXfjWsJla/33ML0KsOFqmviRoc+x3G8C7Ysp7V16nEj/sdf3Z8= MIME-Version: 1.0 From: Linus Torvalds Date: Thu, 7 Sep 2017 10:51:21 -0700 X-Google-Sender-Auth: _fwzWcc_YysoTZP2OHxPRJr0PBA Message-ID: Subject: xt_hashlimig build error (was Re: [RFC 01/17] x86/asm/64: Remove the restore_c_regs_and_iret label) To: Ingo Molnar , Igor Lubashev , Josh Hunt , Vishwanath Pai , Pablo Neira Ayuso Cc: Borislav Petkov , Andy Lutomirski , "the arch/x86 maintainers" , Linux Kernel Mailing List , Brian Gerst , Andrew Cooper , Juergen Gross , Boris Ostrovsky , Kees Cook , Andrew Morton , "David S. Miller" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 7, 2017 at 3:29 AM, Ingo Molnar wrote: > > not the best of kernels, 32-bit allyesconfig doesn't even appear to build: > > net/netfilter/xt_hashlimit.o: In function `hashlimit_mt_common.isra.6': > xt_hashlimit.c:(.text+0x1146): undefined reference to `__udivdi3' I think this is due to commit bea74641e378 ("netfilter: xt_hashlimit: add rate match mode"). It adds a 64-bit divide in user2rate_bytes() afaik, and to make things worse it seems to be a really stupid one too. Although I guess "worse" is not bad when the stupidity of it should mean that it's easy to avoid the 64-bit issue. Oddly, user2rate() that actually *does* need a 64-bit divide, seems to do it right and use "div64_u64()" to do so. But user2rate_bytes() could easily avoid any 64-bit issues, since it divides the max 32-bit (unsigned) number with a 64-bit unsigned number. It would be easy to just say - "if high 32 bits are set, result is 0" - else do a 32-bit divide or just use "div64_u64()" in that code too. But honestly, that math is odd in other ways too (is that "r-1" _supposed_ to underflow to -1 for large 'user' counts?), so somebody needs to look at that logic. And there might be some other 64-bit divide I missed, so please, netfilter people, check the 32-bit build. Linus