Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S264152AbTEaGRc (ORCPT ); Sat, 31 May 2003 02:17:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S264153AbTEaGRc (ORCPT ); Sat, 31 May 2003 02:17:32 -0400 Received: from holomorphy.com ([66.224.33.161]:29075 "EHLO holomorphy") by vger.kernel.org with ESMTP id S264152AbTEaGRb (ORCPT ); Sat, 31 May 2003 02:17:31 -0400 Date: Fri, 30 May 2003 23:30:40 -0700 From: William Lee Irwin III To: "David S. Miller" Cc: alexander.riesen@synopsys.COM, scrosby@cs.rice.edu, linux-kernel@vger.kernel.org Subject: Re: Algoritmic Complexity Attacks and 2.4.20 the dcache code Message-ID: <20030531063040.GI8978@holomorphy.com> Mail-Followup-To: William Lee Irwin III , "David S. Miller" , alexander.riesen@synopsys.COM, scrosby@cs.rice.edu, linux-kernel@vger.kernel.org References: <20030529.232440.122068039.davem@redhat.com> <20030530085901.GB11885@Synopsys.COM> <20030530.020040.52897577.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030530.020040.52897577.davem@redhat.com> Organization: The Domain of Holomorphy User-Agent: Mutt/1.5.4i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org From: Alex Riesen Date: Fri, 30 May 2003 10:59:01 +0200 > static > int hash_3(int hi, int c) > { > return (hi + (c << 4) + (c >> 4)) * 11; > } > gcc-3.2.1 -O2 -march=pentium > ... > It is not guaranteed to be this way on all architectures, of course. > But still - no multiplications. On Fri, May 30, 2003 at 02:00:40AM -0700, David S. Miller wrote: > Indeed, I'd missed this. GCC will emit the constant multiply > expansion unless the multiply cost is set VERY low. If the strength reduction situation changes to being properly handled by gcc for most/all 64-bit arches, include/linux/hash.h can lose a #ifdef. -- wli - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/