Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMPXCHG not emulated #127

Open
jckarter opened this issue Jun 25, 2024 · 2 comments
Open

CMPXCHG not emulated #127

jckarter opened this issue Jun 25, 2024 · 2 comments

Comments

@jckarter
Copy link

For fun, I tried building a recent Linux 6.9 kernel using Osamu Kurati's FM TOWNS patchset (http://www.nurs.or.jp/~kurati/towns/#kernel) When trying to boot it in Tsugaru, the VM halts on an unhandled instruction:

VM Aborted!
Device:486DX
Reason:Clocks-Passed is not set.  Opcode=0FB1H
Debugger Enabled.
Towns TIME (Nano-Seconds): 59267737955
CS:EIP=0060:C1422CB3  LINEAR:C1422CB3  EFLAGS=00000046  CPL=00
EAX=00000000  EBX=C16A8DB0  ECX=FFFFFFFB  EDX=C15C27C0
ESI=00000000  EDI=00000001  EBP=C15B7F5C  ESP=C15B7F58
CS=0060(LIN:00000000)  DS=007B(LIN:00000000)  ES=007B(LIN:00000000)  
FS=0000(LIN:00000000)  GS=0000(LIN:00000000)  SS=0068(LIN:00000000)  
CR0=80050033  CR1=00000000  CR2=00000000  CR3=0175B000
CF0  PF1  AF0  ZF1  SF0  TF0  IF0  DF0  OF0  IOPL00  NT0  RF0  VM0  AC0
Default Operand Size=32  Default Address Size=32  Stack Address Size=32
SS+00000000:A0 43 5D C1 70 7F 5B C1 B4 91 72 C1 A0 43 5D C1 
SS+00000010:00 00 00 00 63 32 54 C1 84 7F 5B C1 7D 93 72 C1 
0060:C1422CB3 0FB1                      

0FB1 is the encoding for CMPXCHG according to https://www.felixcloutier.com/x86/cmpxchg .

@captainys
Copy link
Owner

Interesting! Thank you for testing! I've added support for CMPXCHG in the latest source. But, I cannot test in my environment if it is correct. Let me know if it makes your Linux kernel run!

@jckarter
Copy link
Author

jckarter commented Jul 3, 2024

Nice, thanks! I'll give it a try when the next binary gets tagged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants