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]
Message-ID: <20230217083240.147d2c76@jacob-builder>
Date:   Fri, 17 Feb 2023 08:32:40 -0800
From:   Jacob Pan <jacob.jun.pan@...ux.intel.com>
To:     Fenghua Yu <fenghua.yu@...el.com>
Cc:     LKML <linux-kernel@...r.kernel.org>, <iommu@...ts.linux.dev>,
        Jason Gunthorpe <jgg@...dia.com>,
        Lu Baolu <baolu.lu@...ux.intel.com>,
        Joerg Roedel <joro@...tes.org>,
        Jean-Philippe Brucker <jean-philippe@...aro.com>,
        Robin Murphy <robin.murphy@....com>,
        Will Deacon <will@...nel.org>,
        "David Woodhouse" <dwmw2@...radead.org>,
        Raj Ashok <ashok.raj@...el.com>,
        "Tian, Kevin" <kevin.tian@...el.com>, Yi Liu <yi.l.liu@...el.com>,
        Dave Hansen <dave.hansen@...el.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        X86 Kernel <x86@...nel.org>, Dave Jiang <dave.jiang@...el.com>,
        jacob.jun.pan@...ux.intel.com
Subject: Re: [PATCH v3 4/5] iommu/ioasid: Rename INVALID_IOASID

Hi Fenghua,

On Thu, 16 Feb 2023 17:23:15 -0800, Fenghua Yu <fenghua.yu@...el.com> wrote:

> > --- a/drivers/dma/idxd/irq.c
> > +++ b/drivers/dma/idxd/irq.c
> > @@ -80,7 +80,7 @@ static void idxd_int_handle_revoke_drain(struct
> > idxd_irq_entry *ie) desc.opcode = DSA_OPCODE_DRAIN;
> >   	desc.priv = 1;
> >   
> > -	if (ie->pasid != INVALID_IOASID)
> > +	if (ie->pasid != IOMMU_PASID_INVALID)  
> 
> It's better to change to:
> +	if (pasid_valid(ie->paid))
> 
> If pasid_vaild() is called, any invalid PASID value change in the future 
> will be hidden in pasid_valid() and won't impact this code any more.
> 
> And checking pasid_valid() is more readable and meaninful than direct 
> checking the invalid PASID value.
Sounds good, here I'm just renaming. I will submit another patch to
convert.

Thanks,

Jacob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ