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-next>] [day] [month] [year] [list]
Date:   Thu, 21 Oct 2021 10:04:43 +0530
From:   Viresh Kumar <viresh.kumar@...aro.org>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Arnd Bergmann <arnd@...nel.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Bartosz Golaszewski <brgl@...ev.pl>,
        "Enrico Weigelt, metux IT consult" <info@...ux.net>,
        Viresh Kumar <vireshk@...nel.org>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Jason Wang <jasowang@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Jean-Philippe Brucker <jean-philippe@...aro.org>,
        Bill Mills <bill.mills@...aro.org>,
        Alex Bennée <alex.bennee@...aro.org>,
        Cornelia Huck <cohuck@...hat.com>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        "stratos-dev@...lists.linaro.org" <stratos-dev@...lists.linaro.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Marc Zyngier <maz@...nel.org>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "virtualization@...ts.linux-foundation.org" 
        <virtualization@...ts.linux-foundation.org>
Subject: Re: [PATCH V6] gpio: virtio: Add IRQ support

On 20-10-21, 18:10, Andy Shevchenko wrote:
> On Wednesday, October 20, 2021, Viresh Kumar <viresh.kumar@...aro.org>
> wrote:
> > +static int virtio_gpio_irq_set_type(struct irq_data *d, unsigned int
> > type)
> > +{
> > +       struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
> > +       struct virtio_gpio *vgpio = gpiochip_get_data(gc);
> > +       struct vgpio_irq_line *irq_line = &vgpio->irq_lines[d->hwirq];
> > +
> > +       switch (type) {
> > +       case IRQ_TYPE_NONE:
> > +               type = VIRTIO_GPIO_IRQ_TYPE_NONE;
> > +               break;
> 
> 
> IIRC you add dead code. IRQ framework never calls this if type is not set.

Yes, but it is allowed to call

irq_set_irq_type(irq, IRQ_TYPE_NONE);

and the irq framework won't disallow it AFAICT.

> > +static void virtio_gpio_event_vq(struct virtqueue *vq)
> > +{

> > +               irq = irq_find_mapping(vgpio->gc.irq.domain, gpio);
> > +               WARN_ON(!irq);
> > +
> > +               ret = generic_handle_irq(irq);
> 
> 
> IIRC there is a new API that basically combines the two above.

generic_handle_domain_irq(), thanks.

> >  struct virtio_gpio_config {
> >         __le16 ngpio;
> >         __u8 padding[2];
> > @@ -44,4 +56,17 @@ struct virtio_gpio_response_get_names {
> >         __u8 value[];
> >  };
> >
> > +/* Virtio GPIO IRQ Request / Response */
> > +struct virtio_gpio_irq_request {
> > +       __le16 gpio;
> > +};
> > +
> > +struct virtio_gpio_irq_response {
> > +       __u8 status;
> > +};
> >
> >
> I’m wondering if those above should be packed.

You are talking about the newly added ones or the ones before ?

In any case, they are all already packed (i.e. they have explicit
padding wherever required) and properly aligned. Compiler won't add
any other padding to them.
 
-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ