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: <671202a1-4080-0104-abd8-4718c53dd61e@arm.com>
Date:   Mon, 26 Mar 2018 09:17:36 +0100
From:   Marc Zyngier <marc.zyngier@....com>
To:     Davidlohr Bueso <dave@...olabs.net>, peterz@...radead.org,
        akpm@...ux-foundation.org
Cc:     linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
        Jason Cooper <jason@...edaemon.net>,
        Davidlohr Bueso <dbueso@...e.de>
Subject: Re: [PATCH 2/3] drivers/irqchip: update supports_deactivate static
 key to modern api

Hi Davidlohr,

On 25/03/18 20:10, Davidlohr Bueso wrote:
> Minor changes in semantics -- key init is true; replace
> 
> static_key_slow_dec       with   static_branch_disable
> static_key_true           with   static_branch_likely
> 
> The first is because we never actually do any couterpart incs,
> thus there is really no reference counting semantics going on.
> Use the more proper static_branch_disable() construct.
> 
> Also added a '_key' suffix to supports_deactivate, for better
> self documentation.
> 
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Jason Cooper <jason@...edaemon.net>
> Cc: Marc Zyngier <marc.zyngier@....com>
> Signed-off-by: Davidlohr Bueso <dbueso@...e.de>
> ---
>  drivers/irqchip/irq-gic-v3.c | 20 ++++++++++----------
>  drivers/irqchip/irq-gic.c    | 22 +++++++++++-----------
>  2 files changed, 21 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> index 56c8de84a72b..f32b1814278b 100644
> --- a/drivers/irqchip/irq-gic-v3.c
> +++ b/drivers/irqchip/irq-gic-v3.c
> @@ -61,7 +61,7 @@ struct gic_chip_data {
>  };
>  
>  static struct gic_chip_data gic_data __read_mostly;
> -static struct static_key supports_deactivate = STATIC_KEY_INIT_TRUE;
> +DEFINE_STATIC_KEY_TRUE(supports_deactivate_key);

When you combine this...

[...]

> diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
> index ac2e62d613d1..9b7630cee56c 100644
> --- a/drivers/irqchip/irq-gic.c
> +++ b/drivers/irqchip/irq-gic.c
> @@ -121,7 +121,7 @@ static DEFINE_RAW_SPINLOCK(cpu_map_lock);
>  #define NR_GIC_CPU_IF 8
>  static u8 gic_cpu_map[NR_GIC_CPU_IF] __read_mostly;
>  
> -static struct static_key supports_deactivate = STATIC_KEY_INIT_TRUE;
> +DEFINE_STATIC_KEY_TRUE(supports_deactivate_key);

...with that, bad things happen:

drivers/irqchip/irq-gic-v3.o:(.data+0x278): multiple definition of `supports_deactivate_key'
drivers/irqchip/irq-gic.o:(.data+0x18): first defined here
Makefile:1032: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ