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: <877d9h7wb9.wl-maz@kernel.org>
Date:   Sat, 26 Feb 2022 10:32:10 +0000
From:   Marc Zyngier <maz@...nel.org>
To:     Thierry Reding <thierry.reding@...il.com>
Cc:     linux-kernel@...r.kernel.org,
        Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <brgl@...ev.pl>,
        Joey Gouly <joey.gouly@....com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Hector Martin <marcan@...can.st>,
        Sven Peter <sven@...npeter.dev>,
        Alyssa Rosenzweig <alyssa@...enzweig.io>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Andy Gross <agross@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-gpio@...r.kernel.org, linux-tegra@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-arm-msm@...r.kernel.org, kernel-team@...roid.com
Subject: Re: [PATCH 1/5] gpio: Don't fiddle with irqchips marked as immutable

On Thu, 24 Feb 2022 16:51:41 +0000,
Thierry Reding <thierry.reding@...il.com> wrote:
> 
> On Wed, Feb 23, 2022 at 03:44:01PM +0000, Marc Zyngier wrote:
> > In order to move away from gpiolib messing with the internals of
> > unsuspecting irqchips, add a flag by which irqchips advertise
> > that they are not to be messed with, and do solemnly swear that
> > they correctly call into the gpiolib helpers wueh required.
> > 
> > Signed-off-by: Marc Zyngier <maz@...nel.org>
> > ---
> >  drivers/gpio/gpiolib.c | 7 ++++++-
> >  include/linux/irq.h    | 2 ++
> >  kernel/irq/debugfs.c   | 1 +
> >  3 files changed, 9 insertions(+), 1 deletion(-)
> 
> I kind of like this. The bit where the const cast is essentially guarded
> by an "immutable" flag is a bit funky, but it doesn't look like there is
> a good way to do it by making all references const without doing a huge
> all-at-once conversion.

Exactly. Somehow, we need to advertise it to the gpiolib code, and
this does the job. I hope to be able to simply drop it once everthing
is converted. One day.

> I've always found it a bit irritating that irq_chip was somewhere
> between a container for chip-specific data and an "ops" structure. I
> think it'd be even nicer if this was split into an extra struct
> irq_chip_ops, which could then always be const and a struct irq_chip
> that contained primarily chip-specific data as well as a pointer to
> struct irq_chip_ops.

But that's the thing: it almost is a pure 'ops' structure. Only two
things are getting in the way of it:

- the 'parent_dev' field: this is now sorted, as I moved it to the
  irq_domain structure, and updated all the relevant drivers (see what
  is currently in -next).

- the .name field: it really should never be something that changes
  from one instance of the chip to another. Which is why we have the
  .irq_print_chip() method to handle that (and ideally we'd stick to
  pure const names). I'm addressing this as I go, but everything in
  drivers/irqchip/ should be fixed in -next.

The "context" part really lives in irq_domain.

> But again, this seems fairly tricky to pull off given all the
> interdependencies and we can iterate on this in the future, so this
> seems like a good enough compromise:
> 
> Acked-by: Thierry Reding <treding@...dia.com>

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ