HomeFreeBSD

loader: biosdisk fix for 2+TB disks

Description

loader: biosdisk fix for 2+TB disks

This fix is implementing partition based boundary check for
disk IO and updates disk mediasize (if needed), based on information
from partition table.

As it appeared, the signed int based approach still has corner cases,
and the wrapover based behavior is non-standard.

The idea for this fix is based on two assumptions:

The bug about media size is hitting large (2+TB) disks, lesser disks
hopefully, are not affected.

Large disks are using GPT (which does include information about disk size).
Since our concern is about boot support and boot disks are partitioned,
implementing partition boundaries based IO verification should make the
media size issues mostly disappear.

However, for large disk case, we do have the disk size available from GPT table.
If non-GPT cases will appear, we still can make approximate calculation about
disk size based on defined partition(s), however, this is not the objective
of this patch, and can be added later if there is any need.

This patch does implement disk media size adjustment (if needed) in bd_open(),
and boundary check in bd_realstrategy().

Reviewed by: allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D8595

Details

Provenance
tsoomeAuthored on
Reviewer
allanjude
Differential Revision
D8595: loader biosdisk fix for 2+TB disks.
Parents
rS313347: Remove arm64_tlb_flushID_SE, it's unused and may be wrong.
Branches
Unknown
Tags
Unknown