Skip to content

Instantly share code, notes, and snippets.

@djbw
Created July 7, 2018 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djbw/144dc5ddaf5e935ad58bd66a702a5ea8 to your computer and use it in GitHub Desktop.
Save djbw/144dc5ddaf5e935ad58bd66a702a5ea8 to your computer and use it in GitHub Desktop.
#!/bin/bash -x
#qemu=qemu-kvm
qemu=$HOME/git/qemu/build/x86_64-softmmu/qemu-system-x86_64
kernel=/var/lib/libvirt/images/kernels/bzImage
initrd=$HOME/initramfs-nfs-4.17.img
mem=$HOME/mem
label_size=$((128*1024))
mem_size=$((31 << 30))
IMAGE=$HOME/ahci.img
kvm=(
$qemu
-enable-kvm
-cpu kvm64
-kernel $kernel
-initrd $initrd
-m 16G,slots=4,maxmem=512G
-machine pc-i440fx-2.4,accel=kvm,usb=off,vmport=off,nvdimm
-cpu SandyBridge
-smp 40
-netdev tap,id=hostnet0,ifname=tap0,script=no,downscript=no
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:b7:a1:ad,bus=pci.0,addr=0x7
-object memory-backend-file,id=mem1,share,mem-path=${mem}1,size=$((mem_size+label_size))
-device nvdimm,memdev=mem1,id=nv1,label-size=${label_size}
-object memory-backend-file,id=mem2,share,mem-path=${mem}2,size=$((mem_size+label_size))
-device nvdimm,memdev=mem2,id=nv2,label-size=${label_size}
-numa node
-numa node
-device ahci,id=sata0,bus=pci.0,addr=0x8
-drive file=$IMAGE,if=none,id=drive-sata0-0-0,format=raw
-device ide-hd,bus=sata0.0,drive=drive-sata0-0-0,id=sata0-0-0
-boot order=nc
-no-reboot
-watchdog i6300esb
-rtc base=localtime
-serial stdio
-display none
-monitor null
)
append=(
root=/dev/nfs
ip=dhcp
earlyprintk=ttyS0,115200
console=ttyS0,115200
console=tty0
ignore_loglevel
sysrq_always_enabled
selinux=0
#oops=panic
#panic=5
#nmi_watchdog=panic
#hung_task_panic=1
#softlockup_panic=1
ftrace_dump_on_oops
#ahci_remap.dyndbg
#memmap=4G!0x1fc000000
memmap=4G!8G
#memmap=4G!0x210000000
#memmap=12G!4G
#nokaslr
#memmap=0xFC000000!8G
#devres.log=1
#libnvdimm.dyndbg="+fp"
#nfit_test.dyndbg
#nfit.dyndbg
nd_pmem.dyndbg
#nd_btt.dyndbg
#modprobe.blacklist=nd_pmem
dax.dyndbg="+fp"
libnvdimm.dyndbg=\"func nvdimm_bus_probe +fp\"
#nd_pmem.probe_delay=30
#dax_pmem.dyndbg="+fp"
#device_dax.dyndbg="+fp"
slub_debug=FZP
#dyndbg="file fs/dax.c +p"
dyndbg=\"func split_mem_range +fp\"
dyndbg=\"func devm_memremap_pages +p\"
dyndbg=\"func memmap_sync +p\"
dyndbg=\"func memmap_init_async +p\"
dyndbg=\"func arch_add_memory +p\"
printk.devkmsg=on
#systemd.log_level=debug
#systemd.log_target=console
rw
)
"${kvm[@]}" --append "${append[*]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment