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]
Date:   Tue, 08 Dec 2020 09:51:33 +0000
From:   Marc Zyngier <maz@...nel.org>
To:     Pingfan Liu <kernelfans@...il.com>
Cc:     linux-arm-kernel@...ts.infradead.org,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Mark Rutland <mark.rutland@....com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] arm64/irq: report bug if NR_IPI greater than max SGI
 during compile time

On 2020-12-08 09:43, Pingfan Liu wrote:
> On Tue, Dec 8, 2020 at 5:31 PM Marc Zyngier <maz@...nel.org> wrote:
>> 
>> On 2020-12-08 09:21, Pingfan Liu wrote:
>> > Although there is a runtime WARN_ON() when NR_IPR > max SGI, it had
>> > better
>> > do the check during built time, and associate these related code
>> > together.
>> >
>> > Signed-off-by: Pingfan Liu <kernelfans@...il.com>
>> > Cc: Catalin Marinas <catalin.marinas@....com>
>> > Cc: Will Deacon <will@...nel.org>
>> > Cc: Thomas Gleixner <tglx@...utronix.de>
>> > Cc: Jason Cooper <jason@...edaemon.net>
>> > Cc: Marc Zyngier <maz@...nel.org>
>> > Cc: Mark Rutland <mark.rutland@....com>
>> > To: linux-arm-kernel@...ts.infradead.org
>> > Cc: linux-kernel@...r.kernel.org
>> > ---
>> >  arch/arm64/kernel/smp.c                | 2 ++
>> >  drivers/irqchip/irq-gic-v3.c           | 2 +-
>> >  drivers/irqchip/irq-gic.c              | 2 +-
>> >  include/linux/irqchip/arm-gic-common.h | 2 ++
>> >  4 files changed, 6 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
>> > index 18e9727..9fc383c 100644
>> > --- a/arch/arm64/kernel/smp.c
>> > +++ b/arch/arm64/kernel/smp.c
>> > @@ -33,6 +33,7 @@
>> >  #include <linux/kernel_stat.h>
>> >  #include <linux/kexec.h>
>> >  #include <linux/kvm_host.h>
>> > +#include <linux/irqchip/arm-gic-common.h>
>> >
>> >  #include <asm/alternative.h>
>> >  #include <asm/atomic.h>
>> > @@ -76,6 +77,7 @@ enum ipi_msg_type {
>> >       IPI_WAKEUP,
>> >       NR_IPI
>> >  };
>> > +static_assert(NR_IPI <= MAX_SGI_NUM);
>> 
>> I am trying *very hard* to remove dependencies between the 
>> architecture
>> code and random drivers, so this kind of check really is
>> counter-productive.
>> 
>> Driver code should not have to know the number of IPIs, because there 
>> is
>> no requirement that all IPIs should map 1:1 to SGIs. Conflating the 
>> two
> 
> Just curious about this. Is there an IPI which is not implemented by
> SGI? Or mapping several IPIs to a single SGI, and scatter out due to a
> global variable value?

We currently have a single NS SGI left, and I'd like to move some of the
non-critical IPIs over to dispatching mechanism (the two "CPU stop" IPIs
definitely are candidate for merging). That's not implemented yet, but
I don't see a need to add checks that would otherwise violate this
IPI/SGI distinction.

Thanks,

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ