-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (27 loc) · 940 Bytes
/
Copy pathMakefile
File metadata and controls
32 lines (27 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
QEMU_SRC ?= work/qemu
QEMU_SRC_ABS := $(abspath $(QEMU_SRC))
QEMU ?= $(QEMU_SRC_ABS)/build/qemu-system-x86_64
BZIMAGE ?= $(QEMU_SRC_ABS)/hw/buildroot/output/images/bzImage
ROOTFS ?= $(QEMU_SRC_ABS)/hw/buildroot/output/images/rootfs.ext2
QEMU_ABS := $(abspath $(QEMU))
BZIMAGE_ABS := $(abspath $(BZIMAGE))
ROOTFS_ABS := $(abspath $(ROOTFS))
CC ?= gcc
REPO_ROOT := $(CURDIR)
.PHONY: build prepare reproduce clean
build:
$(CC) -O2 -Wall -Wextra -std=gnu11 \
-o poc/poc_cxl_vm_escape \
poc/poc_cxl_vm_escape.c
prepare:
cd $(QEMU_SRC_ABS) && \
ROOTFS=$(ROOTFS_ABS) CC=$(CC) \
$(REPO_ROOT)/poc/prepare_buildroot_rootfs.sh
reproduce:
cd $(QEMU_SRC_ABS) && \
QEMU=$(QEMU_ABS) BZIMAGE=$(BZIMAGE_ABS) ROOTFS=$(ROOTFS_ABS) \
$(REPO_ROOT)/poc/run_reproducer.sh
clean:
rm -f poc/poc_cxl_vm_escape
rm -f artifacts/minimal_poc_session.log artifacts/qemu_stderr.log
rm -f artifacts/host_ls_expected.txt artifacts/escaped_host_ls.txt