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: <20fc6ceee1d45e3d4e71e3ac6887ef2860a1c341.camel@au1.ibm.com>
Date:   Wed, 20 Mar 2019 11:28:43 +1100
From:   "Alastair D'Silva" <alastair@....ibm.com>
To:     Greg Kurz <groug@...d.org>
Cc:     Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-kernel@...r.kernel.org,
        Andrew Donnellan <andrew.donnellan@....ibm.com>,
        Frederic Barrat <fbarrat@...ux.ibm.com>,
        linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH 6/7] ocxl: afu_irq only deals with IRQ IDs, not offsets

On Fri, 2019-03-15 at 14:56 +0100, Greg Kurz wrote:
> On Wed, 13 Mar 2019 15:15:21 +1100
> "Alastair D'Silva" <alastair@....ibm.com> wrote:
> 
> > From: Alastair D'Silva <alastair@...ilva.org>
> > 
> > The use of offsets is required only in the frontend, so alter
> > the IRQ API to only work with IRQ IDs in the backend.
> > 
> > Signed-off-by: Alastair D'Silva <alastair@...ilva.org>
> > ---
> >  drivers/misc/ocxl/afu_irq.c       | 31 +++++++++++++------------
> > ------
> >  drivers/misc/ocxl/context.c       |  7 +++++--
> >  drivers/misc/ocxl/file.c          | 13 ++++++++-----
> >  drivers/misc/ocxl/ocxl_internal.h | 10 ++++++----
> >  drivers/misc/ocxl/trace.h         | 12 ++++--------
> >  5 files changed, 36 insertions(+), 37 deletions(-)
> > 
> > diff --git a/drivers/misc/ocxl/afu_irq.c
> > b/drivers/misc/ocxl/afu_irq.c
> > index 11ab996657a2..1885c472df58 100644
> > --- a/drivers/misc/ocxl/afu_irq.c
> > +++ b/drivers/misc/ocxl/afu_irq.c
> > @@ -14,14 +14,14 @@ struct afu_irq {
> >  	struct eventfd_ctx *ev_ctx;
> >  };
> >  
> > -static int irq_offset_to_id(struct ocxl_context *ctx, u64 offset)
> > +int ocxl_irq_offset_to_id(struct ocxl_context *ctx, u64 offset)
> >  {
> >  	return (offset - ctx->afu->irq_base_offset) >> PAGE_SHIFT;
> >  }
> >  
> > -static u64 irq_id_to_offset(struct ocxl_context *ctx, int id)
> > +u64 ocxl_irq_id_to_offset(struct ocxl_context *ctx, int irq_id)
> >  {
> > -	return ctx->afu->irq_base_offset + (id << PAGE_SHIFT);
> > +	return ctx->afu->irq_base_offset + (irq_id << PAGE_SHIFT);
> >  }
> >  
> >  static irqreturn_t afu_irq_handler(int virq, void *data)
> > @@ -69,7 +69,7 @@ static void release_afu_irq(struct afu_irq *irq)
> >  	kfree(irq->name);
> >  }
> >  
> > -int ocxl_afu_irq_alloc(struct ocxl_context *ctx, u64 *irq_offset)
> > +int ocxl_afu_irq_alloc(struct ocxl_context *ctx, int *irq_id)
> >  {
> >  	struct afu_irq *irq;
> >  	int rc;
> > @@ -101,10 +101,7 @@ int ocxl_afu_irq_alloc(struct ocxl_context
> > *ctx, u64 *irq_offset)
> >  	if (rc)
> >  		goto err_alloc;
> >  
> > -	*irq_offset = irq_id_to_offset(ctx, irq->id);
> 
> This should be replaced by:
> 
> 	*irq_id = irq->id;
> 

Whoops, good catch, thanks :)

-- 
Alastair D'Silva
Open Source Developer
Linux Technology Centre, IBM Australia
mob: 0423 762 819

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ