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, Dec 2, 9:27 AM
Unknown Object (File)
Nov 30 2024, 4:02 AM
Unknown Object (File)
Nov 22 2024, 3:47 AM
Unknown Object (File)
Nov 12 2024, 9:21 PM
Unknown Object (File)
Nov 12 2024, 6:34 PM
Unknown Object (File)
Oct 5 2024, 10:00 PM
Unknown Object (File)
Oct 5 2024, 1:50 PM
Unknown Object (File)
Oct 2 2024, 8:24 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.