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-next>] [day] [month] [year] [list]
Message-ID: <AANLkTinx-cgn7zony8UO__zejj36GxcJTf3Pr2Z9G2af@mail.gmail.com>
Date:	Tue, 17 Aug 2010 10:56:53 -0700
From:	Grant Grundler <grundler@...gle.com>
To:	Jeff Garzik <jgarzik@...ox.com>, Tejun Heo <tj@...nel.org>
Cc:	Linux IDE <linux-ide@...r.kernel.org>,
	Gwendal Grignou <gwendal@...gle.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Matthew Wilcox <matthew@....cx>,
	Matthew Wilcox <matthew.r.wilcox@...el.com>
Subject: [PATCH] V2 2.6.35 libata support for > 512 byte sectors (e.g. 4K Native)

Attached patch enables my x86 machine to recognize and talk to a
"Native 4K" SATA device.

When I started working on this, I didn't know Matthew Wilcox had
posted a similar patch 2 years ago:
  http://git.kernel.org/?p=linux/kernel/git/willy/ata.git;a=shortlog;h=refs/heads/ata-large-sectors

Gwendal Grignou pointed me at the the above code and small portions of
this patch include Matthew's work. That's why Mathew is first on the
"Signed-off-by:". I've NOT included his use of a bitmap to determine
512 vs Native for ATA command block size - just used a simple table.
And bugs are almost certainly mine.

Lastly, the patch has been tested with a native 4K 'Engineering
Sample' drive provided by Hitachi GST.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox@...el.com>
Signed-off-by: Grant Grundler <grundler@...gle.com>
Reviewed-by: Gwendal Grignou <gwendal@...gle.com>

----

V1: Gwendal reviewed had concerns about dev->sdev->sector_size which
seems to be ok.

V2: Matthew Wilcox suggested:
      o remove comment about Big Endian (already handled)
      o use "scmd->device->sector_size" instead of "dev->sdev->sector_size"
      o ata_cmd_ioctl() does PIO data IN and thus should use native size.
      o add "safe for large sectors" flag in the case that a
controller can't tolerate >512byte sector commands.

      I did NOT add such a flag since I think the right answer would
be "Don't attach a Native 4K block device to that controller" - it
just won't work.

      Tejun Heo (and I) prefer to leave ata_cmd_ioctl() hard coded to
512 byte since this ioctl is "should probably be deprecated one day".

thanks,
grant

[ patch NOT inlined because gmail will word-wrap and make a mess of
it. Please use attached file.]

Download attachment "2.6.35-libata_4k_block_support-02" of type "application/octet-stream" (8499 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ