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]
Date:   Fri, 25 Jan 2019 16:22:52 -0800
From:   Maya Nakamura <m.maya.nakamura@...il.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>
Cc:     lorenzo.pieralisi@....com, bhelgaas@...gle.com,
        linux-pci@...r.kernel.org, kys@...rosoft.com,
        sthemmin@...rosoft.com, olaf@...fle.de, apw@...onical.com,
        jasowang@...hat.com, mikelley@...rosoft.com,
        Alexander.Levin@...rosoft.com, marcelo.cerri@...onical.com,
        vkuznets@...hat.com, haiyangz@...rosoft.com,
        driverdev-devel@...uxdriverproject.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] PCI: hv: Refactor hv_irq_unmask() to use
 cpumask_to_vpset()

On Thu, Jan 24, 2019 at 03:29:18PM +0300, Dan Carpenter wrote:
> On Wed, Jan 23, 2019 at 01:02:12PM -0800, Maya Nakamura wrote:
> > @@ -908,12 +906,12 @@ static void hv_irq_unmask(struct irq_data *data)
> >  	struct retarget_msi_interrupt *params;
> >  	struct hv_pcibus_device *hbus;
> >  	struct cpumask *dest;
> > +	cpumask_var_t tmp;
> >  	struct pci_bus *pbus;
> >  	struct pci_dev *pdev;
> >  	unsigned long flags;
> >  	u32 var_size = 0;
> > -	int cpu_vmbus;
> > -	int cpu;
> > +	int cpu, nr_bank = 0;
>                         ^^^^^
> No need to initialize this to a bogus value.  It's misleading and it
> turns off GCC's uninitialized variable warning so it can lead to bugs.
>
Thank you for pointing that out. I will remove its initialization in v2.

> > @@ -953,29 +951,28 @@ static void hv_irq_unmask(struct irq_data *data)
> >  		 */
> >  		params->int_target.flags |=
> >  			HV_DEVICE_INTERRUPT_TARGET_PROCESSOR_SET;
> > -		params->int_target.vp_set.valid_bank_mask =
> > -			(1ull << HV_VP_SET_BANK_COUNT_MAX) - 1;
> > +
> > +		if (!alloc_cpumask_var(&tmp, GFP_KERNEL)) {
> > +			dev_err(&hbus->hdev->device, "out of memory");
> 
> 
> No need for this error message.  alloc_cpumask_var() already has better
> debug messages built in.
> 
I will delete this dev_err() in v2.

> > +			return;
> 
> We can't return directly.  We need to unlock first.
> 
I will unlock in v2.

> > +		if (!nr_bank) {
> > +			dev_err(&hbus->hdev->device, "too high CPU");
> 
> This error message is not useful.
> 
I will delete this dev_err() in v2.

Maya
> 
> regards,
> dan carpenter
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ