Few updates and tweaks

mine
Dhiru Kholia 7 years ago
parent c08ccd4111
commit af92fb163e

@ -23,3 +23,5 @@
* http://www.insanelymac.com/ - Enoch bootloader * http://www.insanelymac.com/ - Enoch bootloader
* Nicholas Sherlock - UEFI, Clover, and other hacks * Nicholas Sherlock - UEFI, Clover, and other hacks
* Phil Dennis-Jordan - virtio-net-osx, usb-tablet and other hacks

@ -4,7 +4,13 @@
# #
# The "pc-q35-2.4" machine type was changed to "pc-q35-2.9" on 06-August-2017. # The "pc-q35-2.4" machine type was changed to "pc-q35-2.9" on 06-August-2017.
qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on \ ##################################################################################
# NOTE: Comment out the "MY_OPTIONS" line in case you are having booting problems!
##################################################################################
MY_OPTIONS="+aes,+xsave,+avx,+xsaveopt,+xsavec,+xgetbv1,+xsaves,+avx2,+bmi2,+smep,+bmi1,+fma,+movbe"
qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
-machine pc-q35-2.9 \ -machine pc-q35-2.9 \
-smp 4,cores=2 \ -smp 4,cores=2 \
-usb -device usb-kbd -device usb-tablet \ -usb -device usb-kbd -device usb-tablet \

@ -23,7 +23,7 @@ qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,kvm=off,vendor=GenuineIntel \
-smp 4,cores=2 \ -smp 4,cores=2 \
-usb -device usb-kbd -device usb-mouse \ -usb -device usb-kbd -device usb-mouse \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \ -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-kernel ./enoch_rev2889_boot \ -kernel ./enoch_rev2898_boot \
-smbios type=2 \ -smbios type=2 \
-device ich9-intel-hda -device hda-duplex \ -device ich9-intel-hda -device hda-duplex \
-device ide-drive,bus=ide.2,drive=MacHDD \ -device ide-drive,bus=ide.2,drive=MacHDD \

Binary file not shown.

@ -0,0 +1,33 @@
1. How do I symbolicate kernel panic traces?
Just add keepsyms=1 to either the Kernel Flags setting in /Library/Preferences/SystemConfiguration/com.apple.Boot.plist,
or to the boot-args NVRAM variable. Reboot, and any subsequent panics will be automatically symbolicated. You can run
mangled C++ symbols through the c++filt command line utility to get the proper C++ function signatures.
$ sudo nvram boot-args="-v keepsyms=1"
Thanks for Phil Dennis-Jordan for this great tip.
2. Debugging a AVX related crash which occurs at bootup.
$ nm /System/Library/Extensions/corecrypto.kext/Contents/MacOS/corecrypto | grep avx
0000000000001840 T _ccsha256_vng_intel_avx1_compress
0000000000036708 T _ccsha256_vng_intel_avx2_compress
0000000000026973 T _ccsha512_vng_intel_avx1_compress
00000000000327cb T _ccsha512_vng_intel_avx2_compress
000000000001d960 T _gcmDecrypt_avx1
000000000001c980 T _gcmEncrypt_avx1
$ gdb /System/Library/Extensions/corecrypto.kext/Contents/MacOS/corecrypto
(gdb) x/16i 0x0000000000001840
0x1840: push %rbp
0x1841: mov %rsp,%rbp
0x1844: push %rbx
0x1845: push %r12
0x1847: push %r13
0x1849: push %r14
0x184b: push %r15
0x184d: sub $0x168,%rsp
0x1854: lea 0x60(%rsp),%rax
0x1859: and $0xffffffffffffffe0,%rax
0x185d: vmovdqa %ymm0,(%rax) <--- the crash occurs here due to lack of "xsave" support

Binary file not shown.

@ -41,7 +41,7 @@ to your qemu-system-x86_64 command.
QEMU networking tip QEMU networking tip
------------------- -------------------
# printf 'DE:AD:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256)) # generates QEMU compatible mac addresses! # printf '52:54:00:AB:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256)) # generates QEMU compatible mac addresses!
------------------ ------------------
Bridged Networking Bridged Networking

@ -141,6 +141,8 @@ Thanks to Zhang Tong and Kfir Ozer for finding this.
See `UEFI/README.md` for GPU passthrough notes. See `UEFI/README.md` for GPU passthrough notes.
Note: There is no working QXL driver for macOS so far.
### Virtual Sound Device ### Virtual Sound Device
No support is provided for this. You are on your own. The sound output is known No support is provided for this. You are on your own. The sound output is known
@ -152,6 +154,8 @@ to be choppy and distorted.
* To get sound on your virtual Mac, install the VoodooHDA driver from * To get sound on your virtual Mac, install the VoodooHDA driver from
[here](https://sourceforge.net/projects/voodoohda/files/). [here](https://sourceforge.net/projects/voodoohda/files/).
Note: It seems that playback of Flash videos requires an audio device to be
present.
### Building QEMU from source ### Building QEMU from source
@ -211,6 +215,48 @@ openssl speed aes-128-cbc
openssl speed -evp aes-128-cbc # uses AES-NI openssl speed -evp aes-128-cbc # uses AES-NI
``` ```
### Exposing AVX and AVX2 instructions to macOS
Exposing AVX and AVX2 instructions to macOS requires support for these
instructions on the host CPU.
The `boot-clover.sh` script already exposes AVX and AVX2 instructions to the
macOS guest by default. Modify or comment out the `MY_OPTIONS` line in
`boot-clover.sh` file in case you are having problems.
To enable AVX2, do the following change,
`Clover boot menu -> Options -> Binaries patching -> Fake CPUID -> 0x0306C0 # for Haswell`
For details, see [this wiki](https://clover-wiki.zetam.org/Configuration/KernelAndKextPatches) page.
Once enabled, the following commands can be used to confirm the presence of AVX
and AVX2 instructions on the macOS guest.
```
$ sysctl -a | grep avx
hw.optional.avx2_0: 1
hw.optional.avx1_0: 1
$ sysctl -a | grep leaf7
machdep.cpu.leaf7_features: SMEP BMI1 AVX2 BMI2
machdep.cpu.leaf7_feature_bits: 424
```
### Using virtio-net-osx with macOS
Configuration options for macOS Sierra (thanks to virtio-net-osx project users),
```
-netdev user,id=hub0port0 \
-device virtio-net,netdev=hub0port0,id=eth0 \
-set device.eth0.vectors=0
```
Adapt these to your use case. These changes need to be made in the `boot-*`
scripts. On the guest, install the included `Virtio-Net-Driver-0.9.4.pkg`
package.
### Boot Notes ### Boot Notes
Type the following after boot, Type the following after boot,

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Loading…
Cancel
Save