-
Notifications
You must be signed in to change notification settings - Fork 407
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
feat: Make CPU model and flags configurable #34
Conversation
#33 as mentioned here maybe if the CPU hasn't this features, Macos doesn't boot |
Hi Seitenca, I am not sure if this is needed. Because I already did that by setting the CPU model:
In osx-kvm, they used a much older model (Penryn) and thats why they need to add certain features, because the Penryn CPU does not have those instructions. But we use the Hasswel CPU, so many of these flags (like I also don't have a AMD cpu, but I am pretty confident it will work as it is now. And if some AMD user complaints that it doesnt work, we can try to see which cpu instruction is missing. EDIT: Okay, sorry, I did not see that there was already a complaint, lol! But instead of modifying the code, I would suggest that he first tries out the flags by using the |
Hi @kroese, |
It is already possible to set The reason why I am so hestitant is that emulating CPU instructions that the host processor does not have, is pretty slow. So it should be avoided at all costs, because its better for the guest OS to know that the CPU cannot provide certain instructions (so it can choose to take a different codepath), then to let the guest OS think that the host can hardware accelerate certain operations, while in reality they need to be emulated behind the scenes. |
Yes but I think the value is overwritten in code
Yes maybe add it to the README at best |
You are right.. in |
Okay, it is fixed now.. I had to refresh my memory how these flags actually work in QEMU, but it was like this: If you have KVM enabled, then the only thing they do is to print a warning when the host CPU does not have that feature. So they do not provide any feature that the host does not have (which makes them a bit useless). If you have KVM disabled, those instructions will be emulated and they DO provide features that the host does not have. So you can emulate SSE4 when the host does not have SSE4. But: in most cases its better to not do that, because it prevents the guest from making smart decisions. For example, if the guest knows you have no hardware for SSE4 it can decide to use hardware SSE3 and still have good performance. But if it does not know that, it will use the (slow) emulated SSE4. So unless strictly necessary (for example, a guest that refuses to boot without SSE4) its better to not use them. So this means we cannot magically make macOS work on CPU's that are missing the required instructions/features, unless its without KVM (which is unusably slow). |
Add cpu features as osx-kvm