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)
Sun, Dec 15, 6:19 AM
Unknown Object (File)
Wed, Dec 4, 9:56 AM
Unknown Object (File)
Wed, Dec 4, 4:31 AM
Unknown Object (File)
Wed, Nov 27, 4:22 PM
Unknown Object (File)
Sat, Nov 23, 12:59 PM
Unknown Object (File)
Thu, Nov 21, 1:37 PM
Unknown Object (File)
Tue, Nov 19, 12:42 AM
Unknown Object (File)
Oct 30 2024, 6:50 PM
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.