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: <AE90C24D6B3A694183C094C60CF0A2F6D8AD41@saturn3.aculab.com>
Date:	Thu, 19 May 2011 09:35:19 +0100
From:	"David Laight" <David.Laight@...LAB.COM>
To:	"James Bottomley" <James.Bottomley@...senPartnership.com>,
	"Hitoshi Mitake" <h.mitake@...il.com>
Cc:	"linux-arch" <linux-arch@...r.kernel.org>,
	"Prakash,Sathya" <Sathya.Prakash@....com>,
	"Roland Dreier" <roland@...nel.org>,
	"Desai, Kashyap" <Kashyap.Desai@....com>,
	"linux scsi dev" <linux-scsi@...r.kernel.org>,
	"Matthew Wilcox" <matthew@....cx>,
	"Moore, Eric" <Eric.Moore@....com>,
	"linux pci" <linux-pci@...r.kernel.org>,
	"linux powerpc dev" <linuxppc-dev@...ts.ozlabs.org>,
	"Milton Miller" <miltonm@....com>,
	"linux kernel" <linux-kernel@...r.kernel.org>,
	"Ingo Molnar" <mingo@...hat.com>, <paulus@...ba.org>,
	"Ingo Molnar" <mingo@...e.hu>, "Sam Ravnborg" <sam@...nborg.org>
Subject: RE: [PATCH 1/3] mpt2sas: remove the use of writeq, since writeq isnot atomic

 
> The specific mpt2sas problem is that if we write a 64 bit register non
> atomically, we can't allow any interleaving writes for any other
region
> on the chip, otherwise the HW will take the write as complete in the
64
> bit register and latch the wrong value.  The only way to achieve that
> given the semantics of writeq is a global static spinlock.

That sounds like very specific and slightly dodgy hardware.
You don't say what the scope of 'region on the chip' is, but
it looks like you need to disable ALL writes to the memory
area between the first and second writes of the 64bit value
and not just those coming from writeq().
I don't see how this can possibly be done by normal mutexing
around the writeq() sequence, surely you need to lock the bus
between the two transfers.
Even dma writes would be a problem.

The only way I can think to stop other cpus doing writes
is to use IPIs for force them into a busy wait loop.

All rather reminds me of a PCI slave that got things
horribly wrong when a read was done while a write was
still 'posted', or a 2nd master did a cycle did a read
while a read rerun sequence was still in progress.
(required a mutex and dummy cycles).
At least than one wqs confined to one driver.

	David


--
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