Page MenuHomeFreeBSD

Emulate the TEST instruction with opcode F7 /0.
ClosedPublic

Authored by rgrimes on Jun 25 2019, 2:00 PM.
Tags
None
Referenced Files
F106107270: D20755.diff
Wed, Dec 25, 12:42 PM
Unknown Object (File)
Mon, Dec 23, 3:41 AM
Unknown Object (File)
Wed, Dec 11, 5:52 PM
Unknown Object (File)
Nov 25 2024, 6:57 PM
Unknown Object (File)
Nov 20 2024, 4:14 AM
Unknown Object (File)
Nov 13 2024, 12:18 PM
Unknown Object (File)
Oct 29 2024, 2:30 PM
Unknown Object (File)
Oct 5 2024, 6:09 AM

Details

Summary

OpenBSD guests compiled with clang 8.0.0 use TEST directly against a
Local APIC register instead of separate read via MOV followed by a
TEST against the register.

PR: 238794

Test Plan
  • only compile tested

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25027
Build 23741: arc lint + arc unit

Event Timeline

I am working with the original poster to get him a binary so he can test this fix.

markj added inline comments.
sys/amd64/vmm/vmm_instruction_emul.c
472

Not sure what "struct __hack" is for.

1274

It should be 0xF7, based on the SDM.

I helped Jason Tubnor test this patch on 11.3RC2, we had to first merge r347065 to get this patch to apply, and then had to make the 0x7F to 0xF7 Markj points out to get it to work. OpenBSD now runs as a guest in 11.3RC2

sys/amd64/vmm/vmm_instruction_emul.c
472

Jason T removed these in his testing, not sure if that was right or not, but the patch does work without this.

1274

Confirmed Jason T could not get a patch to work until this was changed to 0xF7.

Ping, since 11.3RC3 is back on the table I would like to see this pushed through along with r347065 which should of already been pushed through as it is 3 weeks past original MFC.

sys/amd64/vmm/vmm_instruction_emul.c
472

I think I see now, it's so you can add a semicolon after GETANDFLAGS(...) without potentially triggering a compiler warning. Sorry for the noise.

@rgrimes would you help coordinate with re@?

Looks good, once the 7F->F7 fix is made.

sys/amd64/vmm/vmm_instruction_emul.c
472

It looks like it's there to appease the compiler when appending a ; to the macro calls?

rgrimes added a reviewer: jhb.

I was kinda waiting for jhb@ on this, as it is his patch, but given the urgency I am commandering this, and I'll push a new patch up for review. I would like to ask markj and pmooney to final review that and accept it before I commit to ^/head and push for an immediate MFC, and merge to releng. I'll also need to merge r347065 which is 6 weeks past MFC date.

sys/amd64/vmm/vmm_instruction_emul.c
1279

These 3 7F's also should be F7

rgrimes marked 4 inline comments as done.

Finally review please

This revision is now accepted and ready to land.Jun 26 2019, 8:41 PM