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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141203081245.GH2129@pengutronix.de>
Date:	Wed, 3 Dec 2014 09:12:45 +0100
From:	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>
To:	Stefan Agner <stefan@...er.ch>
Cc:	shawn.guo@...aro.org, kernel@...gutronix.de,
	linux@....linux.org.uk, jason@...edaemon.net, olof@...om.net,
	arnd@...db.de, daniel.lezcano@...aro.org, tglx@...utronix.de,
	mark.rutland@....com, pawel.moll@....com, robh+dt@...nel.org,
	ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
	devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 05/12] irqchip: nvic: increase number of external
 interrupts to 112

Hallo Stefan,

On Wed, Dec 03, 2014 at 01:12:04AM +0100, Stefan Agner wrote:
> So far only vectors for up to 48 external interrupts have been
> registred in the vector table. Increase the amount of registred
s/registred/registered/

> external vectors to 112. Also, add a warning in case NVIC reports
> support for more interrupts than 128.
s/interrupts than 128/than 128 interrupts/ (not sure about this one)

> Note: the vector table must align to the number of entires in the
s/entires/entries/

Maybe point out that "X external interrupts" corresponds to "X + 16
vectors".

> vector table, hence increase the alignment to 0x200.
> 
> Signed-off-by: Stefan Agner <stefan@...er.ch>
> ---
>  arch/arm/kernel/entry-v7m.S | 6 +++---
>  drivers/irqchip/irq-nvic.c  | 2 ++
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/kernel/entry-v7m.S b/arch/arm/kernel/entry-v7m.S
> index 2260f18..754a1fa 100644
> --- a/arch/arm/kernel/entry-v7m.S
> +++ b/arch/arm/kernel/entry-v7m.S
> @@ -115,7 +115,7 @@ ENTRY(__switch_to)
>  ENDPROC(__switch_to)
>  
>  	.data
> -	.align	8
> +	.align	9
>  /*
>   * Vector table (64 words => 256 bytes natural alignment)
This comment needs fixing

>   */
> @@ -136,6 +136,6 @@ ENTRY(vector_table)
>  	.long	__invalid_entry		@ 13 - Reserved
>  	.long	__pendsv_entry		@ 14 - PendSV
>  	.long	__invalid_entry		@ 15 - SysTick
> -	.rept	64 - 16
> -	.long	__irq_entry		@ 16..64 - External Interrupts
> +	.rept	128 - 16
> +	.long	__irq_entry		@ 16..128 - External Interrupts
>  	.endr
> diff --git a/drivers/irqchip/irq-nvic.c b/drivers/irqchip/irq-nvic.c
> index dbfb5be..40f62a9 100644
> --- a/drivers/irqchip/irq-nvic.c
> +++ b/drivers/irqchip/irq-nvic.c
> @@ -137,6 +137,8 @@ static int __init nvic_of_init(struct device_node *node,
>  	if (irqs > NVIC_MAX_IRQ)
>  		irqs = NVIC_MAX_IRQ;
>  
> +	WARN(irqs > 128, "vector table in entry-v7m.S configured for 128 irqs");
> +
That's pointless. Better do:

	if (WARN(irqs > 128, "vector table in entry-v7m.S configured for 128 irqs"))
		irqs = 128;

Hmm, I wonder if that is correct. The first 16 exceptions are the system
exception that will not be registered be drivers and so exception 16
(i.e. the first regular irq) is reported as hwirq 0. So I think we can
(in a separate patch) pass irqs - 16 to irq_domain_add_linear. Didn't
test that though.

>  	nvic_irq_domain =
>  		irq_domain_add_linear(node, irqs, &nvic_irq_domain_ops, NULL);
>  	if (!nvic_irq_domain) {

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
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