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:	Thu, 09 Oct 2008 21:15:52 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	akpm@...ux-foundation.org
Cc:	mingo@...e.hu, netdev@...r.kernel.org
Subject: Re: drivers/net/enic/vnic_cq.c

From: Andrew Morton <akpm@...ux-foundation.org>
Date: Thu, 9 Oct 2008 21:12:17 -0700

> 
> i386 allmodconfig, all trees applied:
> 
> drivers/net/enic/vnic_cq.c: In function 'vnic_cq_init':
> drivers/net/enic/vnic_cq.c:65: error: implicit declaration of function 'writeq'
> 
> I can't immediately find an i386 implementation of writeq.

There isn't, because only a non-atomic implementation (two writew's)
is possible.

So what ends up happening is that every driver that wants readq and
writeq does this ifdef dance:

#ifndef readq
static u64 readq(void __iomem *reg)
{
	return (((u64)readl(reg + 0x4UL) << 32) |
		(u64)readl(reg));
}

static void writeq(u64 val, void __iomem *reg)
{
	writel(val & 0xffffffff, reg);
	writel(val >> 32, reg + 0x4UL);
}
#endif

basically stating that they explicitly understand that these are
non-atomic and that the driver can handle it.

But this is completely stupid.  Instead of putting this in every driver
we should put it in the 32-bit asm/io.h files and guard it with
some ifdef test, on a macro that the driver can define.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ