Page MenuHomeFreeBSD

cdboot: add explict suffix to ambiguous or instruction
ClosedPublic

Authored by emaste on Dec 28 2016, 9:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 13 2024, 4:10 PM
Unknown Object (File)
Feb 4 2024, 6:52 AM
Unknown Object (File)
Jan 22 2024, 11:38 PM
Unknown Object (File)
Jan 22 2024, 6:19 PM
Unknown Object (File)
Dec 27 2023, 7:58 PM
Unknown Object (File)
Dec 27 2023, 7:54 PM
Unknown Object (File)
Dec 20 2023, 1:33 AM
Unknown Object (File)
Dec 1 2023, 8:39 AM
Subscribers

Details

Summary

Clang disallows ambiguous instructions (GNU as makes some possibly arbitrary choice).

Diff Detail

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

Event Timeline

emaste retitled this revision from to cdboot: add explict suffix to ambiguous or instruction.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added reviewers: jhb, imp.
emaste added a subscriber: kib.

This is .code16 text, so gas should interpret the instruction as orw. I do think that orw/orl does not matter much there due to the nature of operation and the fact that x86 is little endian.

I looked at the gdb 'disassemble' output after 'set architecture i8086', and orw is displayed there.

In D8959#185165, @kib wrote:

This is .code16 text, so gas should interpret the instruction as orw. I do think that orw/orl does not matter much there due to the nature of operation and the fact that x86 is little endian.

I thought about that, but I believe orl is "more correct" as we're it's a 32-bit field we're operating on. But I suppose you're right, x86 will always be little endian and and KARGS_FLAGS_CD will always be <= 0xffff so we can save the extra bytes.

@kib's suggestion, no need to use a larger instruction. pxeldr already uses orb $KARGS_FLAGS_PXE, 0x8(%bx) # kargs->bootflags |=.

kib added a reviewer: kib.
This revision is now accepted and ready to land.Dec 28 2016, 10:29 PM
This revision was automatically updated to reflect the committed changes.