lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8bd0f97a0906131725l214007fcpfa90e72b03cad2ac@mail.gmail.com>
Date:	Sat, 13 Jun 2009 20:25:53 -0400
From:	Mike Frysinger <vapier.adi@...il.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	"H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org,
	Steven Rostedt <srostedt@...hat.com>
Subject: Re: [PATCH] asm-generic: hard_irqs: handle NR_IRQS > 256 
	automatically

On Sat, Jun 13, 2009 at 17:18, Arnd Bergmann wrote:
> On Saturday 13 June 2009, H. Peter Anvin wrote:
>> Mike Frysinger wrote:
>> > If we're going to automatically set HARDIRQ_BITS for the arch, might as
>> > well be a little bit smart about it and set it to 9 automatically if
>> > NR_IRQS is larger than 8 bits.
>> >
>>
>> Why would the only possible values be 8 or 9?
>
> All architectures that define this either set it to 8 or 9, I chose
> 8 because it is the more common constant

right, i was going by what was in use -- there are no requirements
here, just defaults

> but I now realized that
> we also have (in include/linux/hardirq.h, last touched by Steven):
>
> #define MAX_HARDIRQ_BITS 10
> #ifndef HARDIRQ_BITS
> # define HARDIRQ_BITS   MAX_HARDIRQ_BITS
> #endif
> #if HARDIRQ_BITS > MAX_HARDIRQ_BITS
> #error HARDIRQ_BITS too high!
> #endif
>
> Not sure why we even need to make this overridable from the architecture,
> 10 still seems like a reasonable default that should always work.
>
> I'd suggest we either drop the definition for HARDIRQ_BITS from
> asm-generic/hardirq.h, or we use
>
>  #ifndef HARDIRQ_BITS
> -#define HARDIRQ_BITS   8
> +# if NR_IRQS > 255
> +#  define HARDIRQ_BITS 9
> +# elif NR_IRQS > 511
> +#  define HARDIRQ_BITS 10
> +# elif NR_IRQS > 1023
> +#  warning too many interrupts for HARDIRQ_BITS
> +# endif
>  #endif

is there any downsides to using a "too large" value ?  i.e. if my
system has less than 256, does it make any difference at all if it's
set to 10 ?
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ