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:	Mon, 5 May 2014 12:10:39 +0800
From:	黃清隆 <ching2048@...ca.com.tw>
To:	Dan Carpenter <dan.carpenter@...cle.com>
Cc:	James Bottomley <jbottomley@...allels.com>,
	Tomas Henzl <thenzl@...hat.com>,
	"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1.0 14/16] arcmsr: fix sparse checking error

Hi Dan,

In this patch, there are several replace of call readl() or writel()
by direct access to memory.
Because in main memory, we allocated a block of memory for
post_qbuffer and done_qbuffer.
These memory are access by both of CPU and IOP, they are not hardware registers.
This change will not introduce a bug. I have verified it.

Thanks for your comment.

Regards,
Ching


2014-05-02 17:13 GMT+08:00 Dan Carpenter <dan.carpenter@...cle.com>:
> On Wed, Apr 30, 2014 at 07:38:26PM +0800, ching wrote:
>> From: Ching<ching2048@...ca.com.tw>
>>
>> Fix sparse utility checking errors.
>>
>
> I was expecting that this patch would add __iomem annotations throughout
> but in several places it actually removes calls to readl() and writel()
> as well.
>
>>       case ACB_ADAPTER_TYPE_C:{
>> -             struct MessageUnit_C *reg = (struct MessageUnit_C *)acb->pmuC;
>> +             struct MessageUnit_C __iomem *reg = acb->pmuC;
>>               /* disable all outbound interrupt */
>>               orig_mask = readl(&reg->host_int_mask); /* disable outbound message0 int */
>>               writel(orig_mask|ARCMSR_HBCMU_ALL_INTMASKENABLE, &reg->host_int_mask);v
>> @@ -1085,8 +1085,9 @@ static void arcmsr_done4abort_postqueue(
>>               /*clear all outbound posted Q*/
>>               writel(ARCMSR_DOORBELL_INT_CLEAR_PATTERN, reg->iop2drv_doorbell); /* clear doorbell interrupt */
>>               for (i = 0; i < ARCMSR_MAX_HBB_POSTQUEUE; i++) {
>> -                     if ((flag_ccb = readl(&reg->done_qbuffer[i])) != 0) {
>> -                             writel(0, &reg->done_qbuffer[i]);
>> +                     flag_ccb = reg->done_qbuffer[i];
>> +                     if (flag_ccb != 0) {
>> +                             reg->done_qbuffer[i] = 0;
>>                               pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset+(flag_ccb << 5));/*frame must be 32 bytes aligned*/
>>                               pCCB = container_of(pARCMSR_CDB, struct CommandControlBlock, arcmsr_cdb);
>>                               error = (flag_ccb & ARCMSR_CCBREPLY_FLAG_ERROR_MODE0) ? true : false;
>
> I don't know the hardware, but it doesn't even seem to make sense to me.
> if "reg" is an __iomem pointer surely an offset into reg is an iomem
> pointer as well.
>
> I am worried that this introduces a bug.
>
> regards,
> dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ