Skip to content
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

修复在AMD cpu上进行实验遇到的小问题 #5

Merged
merged 3 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/guest/jailhouse.patch
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ index 00000000..6f9dc246
+echo "Created config file at './configs/x86/qemu-ubuntu.c'"
+
+# Extract kernel command line
+cmdline=$(cat ./configs/x86/qemu-ubuntu.c | grep memmap | tr -d " \*" | sed 's/\$/\\\\\\\\\\$/g')
+cmdline=$(cat ./configs/x86/qemu-ubuntu.c | grep memmap | tr -d " \*" | sed 's/\$/\\\\\\$/g')
+
+# Update grub config
+cmdline=$(echo $cmdline | sed 's/\\/\\\\/g')
Expand Down
3 changes: 2 additions & 1 deletion scripts/guest/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ sudo sed -i "s/http:\/\/archive.ubuntu.com/http:\/\/mirrors.tuna.tsinghua.edu.cn
sudo apt-get update
sudo apt-get install -y build-essential python3-mako

# Create a hypervisor image link to /lib/firmware/rvm-intel.bin
# Create a hypervisor image link to /lib/firmware/rvm-xxx.bin
sudo mkdir -p /lib/firmware
sudo ln -sf ~/rvm-intel.bin /lib/firmware
sudo ln -sf ~/rvm-amd.bin /lib/firmware

# Clone jailhouse, apply patches and build
git clone https://github.com/siemens/jailhouse.git
Expand Down
6 changes: 5 additions & 1 deletion scripts/guest/test_hypercall.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
#include <stdio.h>
#include <stdlib.h>

#define HYPERCALL "vmcall"
#ifdef AMD
#define HYPERCALL "vmmcall"
#else
#define HYPERCALL "vmcall"
#endif

static void in_guest() {
printf("Execute VMCALL OK.\n");
Expand Down
Loading