cpu: Add AppleVirtCPU (KvmCPU equiv for Apple hosts)#3076
Draft
BobbyRBruce wants to merge 1 commit intogem5:developfrom
Draft
cpu: Add AppleVirtCPU (KvmCPU equiv for Apple hosts)#3076BobbyRBruce wants to merge 1 commit intogem5:developfrom
AppleVirtCPU (KvmCPU equiv for Apple hosts)#3076BobbyRBruce wants to merge 1 commit intogem5:developfrom
Conversation
Usage Notes ----------- For security purposes, apple requires binaries which require user of the hypervisor to be signed. Therefore the following is required to sign the gem5 executable to run correctly on Apple hosts: ```shell cat > hv.entitlements.plist <<'EOF' <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"\> <plist version="1.0"> <dict> <key>com.apple.security.hypervisor</key> <true/> </dict> </plist> EOF codesign -f -s - --entitlements hv.entitlements.plist ./build/ALL/gem5.opt ``` Example Script -------------- ```shell ./build/ALL/gem5.opt configs/example/apple_virt_simple.py ```
dfb814d to
8233793
Compare
KvmCPU equip for Apple hosts) AppleVirtCPU (KvmCPU equiv for Apple hosts)
Member
Author
|
Note to self: For signing the binary, I can have this are part of the scons building process: sign_identity = ARGUMENTS.get('SIGN_IDENTITY', '-')
entitlements = '#/build_opts/macos/virtualization.entitlements' # Create this
binary = '{path to gem5 bin}' # Whatever way SCons allows us to get this
Command(
action=f'codesign --force --sign "{sign_identity}" --entitlements "{entitlements}" "{binary}"
)Though it needs to check we're running on an Apple host with Apple Virtualization enabled. |
Contributor
|
I would suggest starting with full system simulation. It's going to be a lot easier to get that working that SE mode. SE mode with KVM has all sorts of complications. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
((Just a draft, not ready for review. Still work to be done))
I was testing this on the config script provided in this PR (a simple SE mode hello-world simulation) and while it does load the simulated hardware with a CPU core that utilizes Apple virtualization, it fails due to :
I don't know exactly how close this is to completion but there's certainly some stuff left to do.
Usage Notes
For security purposes, apple requires binaries which require user of the
hypervisor to be signed. Therefore the following is required to sign the
gem5 executable to run correctly on Apple hosts:
Example Script