linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] ATA host-protected area (HPA) device mapper?
@ 2006-06-09 10:47 Etienne Lorrain
  2006-06-09 14:48 ` Jeff Garzik
  2006-06-09 17:22 ` Alan Cox
  0 siblings, 2 replies; 11+ messages in thread
From: Etienne Lorrain @ 2006-06-09 10:47 UTC (permalink / raw)
  To: linux-kernel, linux-ide; +Cc: jeff

Jeff Garzik wrote:
> libata should -- like drivers/ide -- call the ATA "set max" command to 
> fully address the hard drive, including the special "host-protected 
> area" (HPA).  We should do this because the Linux standard is to export 
> the raw hardware directly, making 100% of the hardware capability 
> available to the user (and, in this case, Linux-based BIOS and recovery 
> tools).
> .....
> Comments?  Questions?  Am I completely insane?  ;-)

  Your hard disk is a lot more powerfull than what you think, only very old
 hard disks only have ATA set max command. Nowadays, you can not only set the
 maximum size of the hard disk by HPA, but you can also protect the change of
 the HPA by password and even freeze the HPA (i.e. unmodifiable without power
 cycle).
  Changing the accessible size of the disk using the HPA is relatively safe
 because the disk is still reporting it complete size, so the BIOS and Linux
 do not have disks changing their size during use.

  You can also read and write the configuration of the hard disk, and so hide
 the fact that your hard disk has the HPA feature, change the real size of
 the hard disk (so hide the end, and none of Linux or the BIOS will know the
 hidden part) independantly of the HPA, make the HPA area appear as a complete
 hard disk by offseting the LBA (for a safety recovery), manage the noise
 level and protect the content of the disk by password.

  All this is documented in the ATA specification, available for free at least
 at http://www.t13.org/. If you want a (GPL only) source code showing how to
 use it, have a look at the Gujin bootloader at http://gujin.org : in the way
 I am using it, the bootloader installs itself into an HPA and keep a copy of
 the current MBR in the HPA so is nearly indestructible, if the MBR is
 overwritten another floppy or CDROM booting with Gujin will propose to restore
 the MBR. You may want to run a DOS floppy, run the gujin provided dbgdisk.exe,
 go to the setup menu and enable IDE probing, go back to the kernel selection,
 and exit the dbgdisk.exe software by ^C. Then, have a look at the "A:\DBG" file
 created to see what your hard disk is reporting.
 Gujin can also install in a partition if there is no unused space after your
 extended partition at the end of the disk to create a HPA.

 Gujin also do the absolutely needed setup of the IDE hard disk which is to freeze
 the password system _and_ the config system of all the IDE hard disks present, so
 that no virus can put a random password and send you an E-mail with the address
 where to send the money to get the password to unlock the hard disk and so access
 again your data. Again, freezing means no more modifiable until next power cycle,
 so IMO it is the job of the bootloader to setup the hard disk, before running
 anything like Linux, a commercial OS, a bootable CDROM...

 Gujin is assuming that your hard disk are accessible by the documented ATA ide
 system, and some (or all?) IDE SATA interface have (volumtary?) broken
 implementation: they are not IDE register compatible.
 If you buy broken hardware, Gujin will not help you and cannot take care of the
 details for you - it is another win{modem,video,sensor} device.

 Etienne.

__________________________________________________
Do You Yahoo!?
En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible contre les messages non sollicités 
http://mail.yahoo.fr Yahoo! Mail 

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [RFC] ATA host-protected area (HPA) device mapper?
@ 2006-06-09 20:41 Etienne Lorrain
  0 siblings, 0 replies; 11+ messages in thread
From: Etienne Lorrain @ 2006-06-09 20:41 UTC (permalink / raw)
  To: linux-kernel, linux-ide

--- XXXXXXXX wrote:
> It tends to be preferred around here to implement hardware features so 
> that hardware actually works, rather than to implement spec and blame 
> the hardware for failing to work to the spec.

 Well, the IDE hardware works, and conform to the ATA specs.
 Gujin is using those ATA command for quite a long time.
 I just have a problem with SATA chipset not being ATA1-7 compatible.

>  If, as you say, most BIOS 
> don't obey the spec, then implementing a spec that bears little 
> resemblance to actual behavior only helps the small number of 
> spec-compliant implementations.

  The main problem for BIOS manufacturer is the keyboard mapping
 recognition to enter the password. And there is no real point
 in freezing the password system of a locked drive.
  Gujin try to solve most of those problems, but because it is
 located on the hard disk itself limit the choice - it would be
 so nice to have a big enough BIOS FLASH and put Gujin there.
 Second best choice is having two hard disks (compact flash as
 first HD with compact flash <-> IDE adapter).

> >   The complete ATA specification is describing a register interface since ATA1,
> >  SATA chipsets should be software compatible, even if they add commands/interfaces:
> > http://www.sata-io.org/interopfaq.asp    say:
> >     Are there any known interoperability issues with SATA?
> >     One of the primary requirements of the SATA 1.0 specification was to
> >     maintain backward compatibility with existing operating system drivers
> >     to eliminate incompatibility issues.
> > 
> 
> Again with the "The spec says it works this way, so I can do it this 
> way."  I realize that you can be perfectly, legally, safe implementing 
> specified behavior, but it leaves you doing what you are doing here, 
> which is blaming the hardware for not living up to the specification. 

  Well the ATA specs are quite old, Gujin still work with the BIOS hard disk
 so still act as a bootloader, but it can not protecting you against a
 1 milisecond attack setting password.
 By the way the SATA specs are not free.

> It is generally the choice in the linux kernel to make the hardware 
> work, and ignore the specification where it is irrelevant to actual 
> functionality.  Read up on the SAS Transport Layer.

  Oh yes, Gujin has some strange code to make things work at the end,
 look for ATAPI stuff - I can and do ignore the specs to make the software
 work on real hardware.

  Cheers,
  Etienne.



__________________________________________________
Do You Yahoo!?
En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible contre les messages non sollicités 
http://mail.yahoo.fr Yahoo! Mail 

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [RFC] AHCI Command Completion Coalescing(CCC) proposal
@ 2006-06-08  7:30 zhao, forrest
  2006-06-08 15:01 ` Jeff Garzik
  0 siblings, 1 reply; 11+ messages in thread
From: zhao, forrest @ 2006-06-08  7:30 UTC (permalink / raw)
  To: jgarzik, htejun; +Cc: linux-ide

Hello, all

0 Why this RFC?
Although AHCI spec 1.1 provides a detailed explanation about how to play
with CCC-related registers to enable CCC, several CCC-policy-related
parameters need to be defined(or the consensus need to be achieved)
before we start to write the code.

1 What is CCC used for?
As described in AHCI spec 1.1, "CCC is a feature designed to reduce the
interrupt and command completion overhead in a heavily loaded system.
The feature enables the number of interrupts taken per completion to be
reduced significantly, while ensuring a minimum quality of service for
command completions. When a software specified number of commands have
completed or a software specified timeout has expired, an interrupt is
generated by hardware to allow software to process completed commands."

2 When is CCC activated?
As stated above, CCC is useful only if the system is heavily loaded. So
CCC should be activated when the system is heavily loaded. Then the
question is how to determine whether the system is heavily-loaded or
not? In other words, how many interrupts generated per second can be
defined as "heavily-loaded system"? Does it make sense to define "1000
IRQs per second" as a heavily-loaded system?

3 What should the software specified number of commands be?
>From my understanding, the measurement of "IRQ numbers per second"
should be based on per-port instead of all ports of a SATA controller.
For NCQ, the usable command slots for each port is 31(the 32nd command
slot is reserved for internal command), so the software specified number
of commands should be 31*n (n is the number of ports, which is selected
to join CCC).
For non-NCQ, the usable command slots for each port is 32, so the
software specified number of commands should be 32*n.

4 What should the software specified timeout be?
I don't have the strong reasoning of a specific timeout value. 500ms? or
1000ms? We should trade-off between the delay and overhead.

5 When is CCC de-activated?
When the port becomes lightly-loaded, we should de-activate CCC of this
port. Otherwise the unnecessary delay would be introduced. However we
should not de-activate CCC of a port immediately when IRQ's per second
drops down the threshold in order to avoid jitter. My suggestion is that
if consecutive 3 timeout occurs, then we de-activate CCC of a port with
least "IRQ's per second".

Your comments are welcome.

Thanks,
Forrest

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-06-13 10:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-09 10:47 [RFC] ATA host-protected area (HPA) device mapper? Etienne Lorrain
2006-06-09 14:48 ` Jeff Garzik
2006-06-09 15:55   ` RE : " Etienne Lorrain
2006-06-09 17:22 ` Alan Cox
2006-06-09 20:10   ` RE : " Etienne Lorrain
2006-06-10 11:56   ` Etienne Lorrain
2006-06-11 15:48     ` Arjan van de Ven
2006-06-13 10:00   ` Etienne Lorrain
  -- strict thread matches above, loose matches on Subject: below --
2006-06-09 20:41 Etienne Lorrain
2006-06-08  7:30 [RFC] AHCI Command Completion Coalescing(CCC) proposal zhao, forrest
2006-06-08 15:01 ` Jeff Garzik
2006-06-09  2:27   ` zhao, forrest
2006-06-09  3:11     ` Another project for you... :) Jeff Garzik
2006-06-09  3:43       ` [RFC] ATA host-protected area (HPA) device mapper? Jeff Garzik
2006-06-09  4:51         ` Matthew Frost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).