Page MenuHomeFreeBSD

Fixup the geliboot sector round code
ClosedPublic

Authored by allanjude on May 5 2016, 1:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 29, 8:48 PM
Unknown Object (File)
Fri, Apr 26, 10:20 AM
Unknown Object (File)
Fri, Apr 26, 1:20 AM
Unknown Object (File)
Thu, Apr 25, 2:04 PM
Unknown Object (File)
Mar 4 2024, 2:42 PM
Unknown Object (File)
Jan 29 2024, 1:55 PM
Unknown Object (File)
Jan 13 2024, 8:55 PM
Unknown Object (File)
Jan 3 2024, 9:08 PM
Subscribers

Details

Summary

Replace all rounding with the round{up,down}2 macros, a missing set of braces caused the previous code to be incorrect Also, replace alloca() with malloc() because alloca() can return an allocation that is actually invalid, causing boot to fail

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

allanjude retitled this revision from to Fixup the geliboot sector round code Replace all rounding with the round{up,down}2 macros, a missing set of braces caused the previous code to be incorrect Also, replace alloca() with malloc() because alloca() can return an allocation that is....
allanjude updated this object.
allanjude edited the test plan for this revision. (Show Details)
allanjude added reviewers: ed, emaste, peter.
sys/boot/i386/libi386/biosdisk.c
749 ↗(On Diff #15912)

since bd structure is already having bd_sectorsize member, I would suggest to use bd_sectorsize here and below and avoid hardcoded constant; this will help to get ready for non-512B sector disks.

769 ↗(On Diff #15912)

bd_io() is returning -1 in case of error, I would keep the same logic, maybe also set errno to ENOMEM.

Updated with feedback from tsoome

Updating D6213: Fixup the geliboot sector round code

Replace all rounding with the round{up,down}2 macros, a missing set of braces caused the previous code to be incorrect

Also, replace alloca() with malloc() because alloca() can return an allocation that is...

allanjude retitled this revision from Fixup the geliboot sector round code Replace all rounding with the round{up,down}2 macros, a missing set of braces caused the previous code to be incorrect Also, replace alloca() with malloc() because alloca() can return an allocation that is... to Fixup the geliboot sector round code.
ed edited edge metadata.
This revision is now accepted and ready to land.May 6 2016, 9:41 AM
allanjude edited edge metadata.

Make it actually compile

This revision now requires review to proceed.May 19 2016, 6:34 PM
ed edited edge metadata.
This revision is now accepted and ready to land.May 19 2016, 7:34 PM
This revision was automatically updated to reflect the committed changes.