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)
Wed, Oct 30, 6:50 PM
Unknown Object (File)
Sat, Oct 26, 9:27 PM
Unknown Object (File)
Oct 14 2024, 9:18 PM
Unknown Object (File)
Sep 24 2024, 4:47 AM
Unknown Object (File)
Sep 22 2024, 2:07 PM
Unknown Object (File)
Sep 22 2024, 11:03 AM
Unknown Object (File)
Sep 11 2024, 3:13 AM
Unknown Object (File)
Sep 9 2024, 2:41 AM
Subscribers

Details

Summary

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

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

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.