ide: Cap LBA28 capacity announcement to 2^28-1
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 24 Aug 2021 10:43:44 +0000 (12:43 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 2 Nov 2021 12:02:46 +0000 (13:02 +0100)
commit46e018e9b741731842b93ce23a86fad60445969b
treee83175892453c225f231a71e0b0068227c1032ff
parent0347a8fd4c3faaedf119be04c197804be40a384b
ide: Cap LBA28 capacity announcement to 2^28-1

The LBA28 capacity (at offsets 60/61 of identification) is supposed to
express the maximum size supported by LBA28 commands. If the device is
larger than this, we have to cap it to 2^28-1.

At least NetBSD happens to be using this value to determine whether to use
LBA28 or LBA48 for its commands, using LBA28 for sectors that don't need
LBA48. This commit thus fixes NetBSD access to disks larger than 128GiB.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Message-Id: <20210824104344.3878849-1-samuel.thibault@ens-lyon.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/ide/core.c