Jump to content

New OPEMU supporting fully till SSE4.1


35 posts in this topic

Recommended Posts

5 hours ago, Duran Keeley said:

Can you please try a 10.12 build that you know works and drop in these files and try build again? :) 

 

opemu-test-20200410.zip

 

Also can someone share a 10.12 diff...

 

ALso try other SSEPlus as this is a diff version to the one in ANdy's first post

 

Gave it a try but still had issues with the headers. This is the only diff for Sierra I have that I can find.

 

Also probably doesn't help I'm building on Catalina...

 

shaneee@iMac-Pro ~ % gcc --version                                                                
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.29)
Target: x86_64-apple-darwin19.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

 

xnu-3789.51.2-RC1.diff.zip

Link to comment
Share on other sites

Hey all,

 

Will pick this back up once I have finished the QEMU/KVM PCI pass-through on my Debian MacBook Pro.

 

I got Debian to pick up the integrated Intel and the NVIDIA and I can assign the one to the VM. Also with QEMU I can tell in what CPU features I don't want and test the kernel if it brings those in.

  • Like 2
Link to comment
Share on other sites

On 4/13/2020 at 11:11 AM, Duran Keeley said:

Hey all,

Will pick this back up once I have finished the QEMU/KVM PCI pass-through on my Debian MacBook Pro.

I got Debian to pick up the integrated Intel and the NVIDIA and I can assign the one to the VM. Also with QEMU I can tell in what CPU features I don't want and test the kernel if it brings those in.

Hey Duran,

Since our last correspondence, I have come a little further and have also been able to make some corrections at the source.

I think it looks good so far. I'll wait until you've prepared your MacBook, then we can do the rest at the source.

Link to comment
Share on other sites

  • 3 months later...

I think I've read this entire thread, but I'm somewhat confused. Has the development of opcode emulation ever reached the stage that will allow for the generation of a kernel extension that can be used on OpenCore to provide emulation of extra instruction sets for an Intel Xeon on a Mac Pro 1,1-5,1?

Link to comment
Share on other sites

  • 2 weeks later...
On 8/24/2020 at 2:13 AM, jalavoui said:

Hey Jalavoui,
Does that mean that you have an Intel Core2 CPU without SSE4.1 instruction set and that you were ready to boot your system successfully using Lilu and OpcodeEmulator.kext? Is that correct?

 

This is currently my best result with an AMD kernel (see image) with Phenom II X6 1100T CPU. Maybe I should also test this kernel with Lilu and OpcodeEmulator.kext and then see what will happen.


and the other Opemu emulator either end in an Endless loop with:

 

invalid kernel opcode (64-bit)
invalid kernel ip, won't attempt to handle trap
o6 oo 36 00 80 ff ff ff 08 00 00 00 00 00 00 00

 

or in:

OPEMU: movzx ecx, word [rax+0x16]

 

Edit:

Test with Lilu+OpcodeEmulator

 

I've tested Lilu + OpcodeEmulator, but the boot was unsuccessful. neither with amd kernel or with vanilla kernel. with amd kernel, the same panic message occurred as can be seen in the picture below and when using vanilla kernel, only a black screen was visible.

 

 

WhatsApp Image 2020-08-22 at 13.05.47.jpeg

Link to comment
Share on other sites

yes this boots 10.14 setup but hangs on graphics on a junk c2d without vmx

you need to test with a amd xnu without embedded  opemu as this will crash OpcodeEmulator

maybe the vanilla kernel with amd patches also can boot.

 

you can also give it a try with amd-v disabled (if u can set it in bios)

on 10.13 i got crash at boot

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Grabbed few more sources for testing - got 3 different approaches

got sse4.1 and 4.2 enabled only

you can test the bin version or play with source code. Active version as best results so far but crashes on trust daemon.

 

the Andy source for sse4.1 is ported but inactive in bin release.

the OpcodeEmulator source is inactive.

the ydeng source is active and boots 10.3 and 10.4 kernels.

also including vanila kernel+prelinkedkernel for 10.3.5 and 10.4.2

 

for testing on AMD you will need a kernel with builtin opemu disabled.

10.3.5.zip

10.14.2.zip

bin.zip

src.zip

 

Best sources i have found are from qemu. 

 

static const struct SSEOpHelper_epp sse_op_table6[256] = {
    [0x00] = SSSE3_OP(pshufb),
    [0x01] = SSSE3_OP(phaddw),
    [0x02] = SSSE3_OP(phaddd),
    [0x03] = SSSE3_OP(phaddsw),
    [0x04] = SSSE3_OP(pmaddubsw),
    [0x05] = SSSE3_OP(phsubw),
    [0x06] = SSSE3_OP(phsubd),
    [0x07] = SSSE3_OP(phsubsw),
    [0x08] = SSSE3_OP(psignb),
    [0x09] = SSSE3_OP(psignw),
    [0x0a] = SSSE3_OP(psignd),
    [0x0b] = SSSE3_OP(pmulhrsw),
    [0x10] = SSE41_OP(pblendvb),
    [0x14] = SSE41_OP(blendvps),
    [0x15] = SSE41_OP(blendvpd),
    [0x17] = SSE41_OP(ptest),
    [0x1c] = SSSE3_OP(pabsb),
    [0x1d] = SSSE3_OP(pabsw),
    [0x1e] = SSSE3_OP(pabsd),
    [0x20] = SSE41_OP(pmovsxbw),
    [0x21] = SSE41_OP(pmovsxbd),
    [0x22] = SSE41_OP(pmovsxbq),
    [0x23] = SSE41_OP(pmovsxwd),
    [0x24] = SSE41_OP(pmovsxwq),
    [0x25] = SSE41_OP(pmovsxdq),
    [0x28] = SSE41_OP(pmuldq),
    [0x29] = SSE41_OP(pcmpeqq),
    [0x2a] = SSE41_SPECIAL, /* movntqda */
    [0x2b] = SSE41_OP(packusdw),
    [0x30] = SSE41_OP(pmovzxbw),
    [0x31] = SSE41_OP(pmovzxbd),
    [0x32] = SSE41_OP(pmovzxbq),
    [0x33] = SSE41_OP(pmovzxwd),
    [0x34] = SSE41_OP(pmovzxwq),
    [0x35] = SSE41_OP(pmovzxdq),
    [0x37] = SSE42_OP(pcmpgtq),
    [0x38] = SSE41_OP(pminsb),
    [0x39] = SSE41_OP(pminsd),
    [0x3a] = SSE41_OP(pminuw),
    [0x3b] = SSE41_OP(pminud),
    [0x3c] = SSE41_OP(pmaxsb),
    [0x3d] = SSE41_OP(pmaxsd),
    [0x3e] = SSE41_OP(pmaxuw),
    [0x3f] = SSE41_OP(pmaxud),
    [0x40] = SSE41_OP(pmulld),
    [0x41] = SSE41_OP(phminposuw),
    [0xdb] = AESNI_OP(aesimc),
    [0xdc] = AESNI_OP(aesenc),
    [0xdd] = AESNI_OP(aesenclast),
    [0xde] = AESNI_OP(aesdec),
    [0xdf] = AESNI_OP(aesdeclast),
};

static const struct SSEOpHelper_eppi sse_op_table7[256] = {
    [0x08] = SSE41_OP(roundps),
    [0x09] = SSE41_OP(roundpd),
    [0x0a] = SSE41_OP(roundss),
    [0x0b] = SSE41_OP(roundsd),
    [0x0c] = SSE41_OP(blendps),
    [0x0d] = SSE41_OP(blendpd),
    [0x0e] = SSE41_OP(pblendw),
    [0x0f] = SSSE3_OP(palignr),
    [0x14] = SSE41_SPECIAL, /* pextrb */
    [0x15] = SSE41_SPECIAL, /* pextrw */
    [0x16] = SSE41_SPECIAL, /* pextrd/pextrq */
    [0x17] = SSE41_SPECIAL, /* extractps */
    [0x20] = SSE41_SPECIAL, /* pinsrb */
    [0x21] = SSE41_SPECIAL, /* insertps */
    [0x22] = SSE41_SPECIAL, /* pinsrd/pinsrq */
    [0x40] = SSE41_OP(dpps),
    [0x41] = SSE41_OP(dppd),
    [0x42] = SSE41_OP(mpsadbw),
    [0x44] = PCLMULQDQ_OP(pclmulqdq),
    [0x60] = SSE42_OP(pcmpestrm),
    [0x61] = SSE42_OP(pcmpestri),
    [0x62] = SSE42_OP(pcmpistrm),
    [0x63] = SSE42_OP(pcmpistri),
    [0xdf] = AESNI_OP(aeskeygenassist),
};

 

Edited by jalavoui
  • Like 2
Link to comment
Share on other sites

5 minutes ago, jalavoui said:

Grabbed few more sources for testing - got 3 different approaches

got sse4.1 and 4.2 enabled only

you can test the bin version or play with source code. Active version as best results so far but crashes on trust daemon.

 

the Andy source for sse4.1 is ported but inactive in bin release.

also including vanila kernel+prelinkedkernel for 10.3.5 and 10.4.2

10.3.5.zip

10.14.2.zip

bin.zip

src.zip

I'll test it tomorrow and let you know:thumbsup_anim:

  • Like 2
Link to comment
Share on other sites

Unfortunately, all attempts to boot Mojave with the drivers and kernels you uploaded were unsuccessful. As a boot loader I tried to boot all tests with Clover, OC and with Enoch (ver. 2921).
When integrating your sources into the xnu-source, some errors occurred that I still have to fix to complete my tests.

  • Like 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...