diff --git a/scripts/guest/jailhouse.patch b/scripts/guest/jailhouse.patch index af1b2ff..dafb6d3 100644 --- a/scripts/guest/jailhouse.patch +++ b/scripts/guest/jailhouse.patch @@ -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') diff --git a/scripts/guest/setup.sh b/scripts/guest/setup.sh index f92cd49..a35fa38 100755 --- a/scripts/guest/setup.sh +++ b/scripts/guest/setup.sh @@ -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 diff --git a/scripts/guest/test_hypercall.c b/scripts/guest/test_hypercall.c index ceeec15..b9f91e1 100644 --- a/scripts/guest/test_hypercall.c +++ b/scripts/guest/test_hypercall.c @@ -2,7 +2,11 @@ #include #include -#define HYPERCALL "vmcall" +#ifdef AMD + #define HYPERCALL "vmmcall" +#else + #define HYPERCALL "vmcall" +#endif static void in_guest() { printf("Execute VMCALL OK.\n");