[lkml]   [2005]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectIDE disk and HPA

I have a question concerning the handling of HPA (Host-protected areas) in
current Linux kernels.

Have a look at drivers/ide/ide-disk.c:

static inline void idedisk_check_hpa(ide_drive_t *drive)
unsigned long long capacity, set_max;
int lba48 = idedisk_supports_lba48(drive->id);

capacity = drive->capacity64;
if (lba48)
set_max = idedisk_read_native_max_address_ext(drive);
set_max = idedisk_read_native_max_address(drive);

if (set_max <= capacity)

printk(KERN_INFO "%s: Host Protected Area detected.\n"
"\tcurrent capacity is %llu sectors (%llu MB)\n"
"\tnative capacity is %llu sectors (%llu MB)\n",
capacity, sectors_to_MB(capacity),
set_max, sectors_to_MB(set_max));

if (lba48)
set_max = idedisk_set_max_address_ext(drive, set_max);
set_max = idedisk_set_max_address(drive, set_max);
if (set_max) {
drive->capacity64 = set_max;
printk(KERN_INFO "%s: Host Protected Area disabled.\n",

Do I interpret it right that the following is done in the above function:

1.) The current capacity of the disk is detected.
2.) The "native max. address size" of the disk is detected and stored in
3.) If capacity < set_max then it is rightly stated that an HPA is detected.
4.) If an HPA is detected, then that HPA is disabled, i.e. the maximum address
size is set to the "native max. address size". Afterwards, the HPA is no

My question is now: why is an HPA disabled i.e. disprotected when detected?
Why not let the HPA alone, because a certain set of disk sectors shall not be
accessible by the OS?

Best regards


Acid -- better living through chemistry.
________________________________________creating IT solutions

Dr. Oliver Tennert
Senior Solutions Engineer
CAx Professional Services
science + computing ag
phone +49(0)7071 9457-598 Hagellocher Weg 71-75
fax +49(0)7071 9457-411 D-72070 Tuebingen, Germany

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-07-22 14:20    [W:0.034 / U:31.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site