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] [day] [month] [year] [list]
Date:   Mon, 19 Aug 2019 12:41:29 +0200 (CEST)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Heiner Kallweit <hkallweit1@...il.com>
cc:     Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/3] x86/irq: factor out IS_ERR_OR_NULL check from
 platfom-specific handle_irq

On Sun, 4 Aug 2019, Heiner Kallweit wrote:
> -
> -	if (!handle_irq(desc, regs)) {
> +	if (IS_ERR_OR_NULL(desc)) {

This really want's an unlikely or preferrably be written as:

	if (likely(!IS_ERR_OR_NULL(desc))) {
		handle_irq(desc);
	} else {

>  		ack_APIC_irq();
>  
>  		if (desc != VECTOR_RETRIGGERED && desc != VECTOR_SHUTDOWN) {
> @@ -254,6 +253,8 @@ __visible unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
>  		} else {
>  			__this_cpu_write(vector_irq[vector], VECTOR_UNUSED);
>  		}
> +	} else {
> +		handle_irq(desc, regs);
>  	}
>  
> diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
> index 6bf6517a0..cd4595b71 100644
> --- a/arch/x86/kernel/irq_64.c
> +++ b/arch/x86/kernel/irq_64.c
> @@ -26,13 +26,9 @@
>  DEFINE_PER_CPU_PAGE_ALIGNED(struct irq_stack, irq_stack_backing_store) __visible;
>  DECLARE_INIT_PER_CPU(irq_stack_backing_store);
>  
> -bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
> +void handle_irq(struct irq_desc *desc, struct pt_regs *regs)
>  {
> -	if (IS_ERR_OR_NULL(desc))
> -		return false;
> -
>  	generic_handle_irq_desc(desc);

With that the function call does not make any sense for 64bit. So the
wrapper should be an inline and only for 32bit a function call.

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ