-
Notifications
You must be signed in to change notification settings - Fork 353
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
Support Big Sur #200
Support Big Sur #200
Conversation
Based on machyve#192 but with fixes to additional issues I've encountered. Tested on Big Sur 11.0 Beta 10 with Xcode 12.1 and Xcode 12.2 Beta 4.
@@ -122,7 +122,7 @@ static struct blockif_sig_elem *blockif_bse_head; | |||
#pragma clang diagnostic pop | |||
|
|||
static ssize_t | |||
preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset) | |||
_preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When building with Xcode 12.2 Beta 4 it fails with the following error:
/Users/shane/Code/xhyve/src/block_if.c:248:15: error: 'preadv' is only available on macOS 11.0 or newer [-Werror,-Wunguarded-availability-new]
if ((len = preadv(bc->bc_fd, br->br_iov, br->br_iovcnt,
^~~~~~
In module 'Darwin' imported from /Users/shane/Code/xhyve/src/block_if.c:30:
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/usr/include/sys/uio.h:103:9: note: 'preadv' has been marked as being introduced in macOS 11.0 here, but the deployment target is macOS 10.10.0
ssize_t preadv(int, const struct iovec *, int, off_t) __DARWIN_NOCANCEL(preadv) __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0));
^
/Users/shane/Code/xhyve/src/block_if.c:248:15: note: enclose 'preadv' in a __builtin_available check to silence this warning
if ((len = preadv(bc->bc_fd, br->br_iov, br->br_iovcnt,
^~~~~~
It seems that preadv
has been added in Big Sur. I couldn't find an easy way of using the builtin function in Big Sur and this shim for earlier versions so I just avoided the name collision. Suggestions for improvement welcome!
Similarly for pwritev
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried to wrap this function as suggested but I get the same error, it seems like it would want the target SDK to be 11.0+ 🤷🏻♂️
src/vmm/intel/vmx.c
Outdated
@@ -90,6 +90,7 @@ | |||
PROCBASED2_RDRAND_EXITING | \ | |||
PROCBASED2_ENABLE_INVPCID /* FIXME */ | \ | |||
PROCBASED2_RDSEED_EXITING | \ | |||
PROCBASED2_ENABLE_XSAVES_XRSTORS | \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an unfortunate problem to have and I'm not sure this ever growing list of flags is the best way to fix this going forwards. Since this is unrelated to macOS Big Sur support, do you think you could pull this change out of the PR and just land the rest? We can then investigate how to fix this more permanently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do!
xhyve.xcodeproj/project.pbxproj
Outdated
@@ -717,6 +718,7 @@ | |||
isa = XCBuildConfiguration; | |||
baseConfigurationReference = 3F3FF9E31BF7C5D5004C89A1 /* xhyve.xcconfig */; | |||
buildSettings = { | |||
ARCHS = x86_64; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Xcode 12.2 Beta 4 includes arm64 as a default target arch, which xhyve does not seem to support and causes build errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think you could put this change in the xhyve.xcconfig?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do!
Also tested successfully on macOS Catalina 10.15.7 |
Just tested this locally on Big Sur (Late 2013 MBP) and xhyve is back up and running for me. Thanks! |
Great—fixes seem good! 👍 |
Thanks for putting this up @shanesmith and other folks for testing it out! Looks like it builds fine against the macOS 11 and macOS 10.15 SDKs. As noted above, I think this patch should be ideally limited to fixing the macOS 11 SDK build issues. We can investigate the issues around VMX flags separately. |
@shanesmith After updating to latest xhyve on Big Sur we're getting hv_vm_create failed on different machines. We tried different things but couldn't get it to work. Maybe it's because of #201 that is not merged yet? |
Updating fixes xhyve problems on Big Sur, see machyve/xhyve#200 for example.
Based on #192 but with fixes to additional issues I've encountered.
Tested on Big Sur 11.0 Beta 10 with Xcode 12.1 and Xcode 12.2 Beta 4.