This bug report is a follow-up to the thread "Domu windows 2012 crash" on the xen-users list. In there we found out that it is possible to set a value for shadow_memory that is lower than a safe minimum value.
This became apparent after XSA-304, which caused using more of this type of memory. Having a hardcoded line like shadow_memory = 8 results in random crashes of the guest, with the following errors in xl dmesg of the host: (XEN) Failed to shatter gfn 105245: -12 (XEN) d75v1 EPT violation 0x19c (--x/rw-) gpa 0x00000105245760 mfn 0x285245 type 0 (XEN) d75v1 Walking EPT tables for GFN 105245: (XEN) d75v1 epte 9c000004105f9007 (XEN) d75v1 epte 9c000002800000f3 (XEN) d75v1 --- GLA 0x7ff98b40d760 (XEN) domain_crash called from vmx.c:3497 (XEN) Domain 75 (vcpu#1) crashed on cpu#4: (XEN) ----[ Xen-4.11.4-pre x86_64 debug=n Not tainted ]---- (XEN) CPU: 4 (XEN) RIP: 0033:[<00007ff98b40d760>] (XEN) RFLAGS: 0000000000010216 CONTEXT: hvm guest (d75v1) (XEN) rax: 0000000000001212 rbx: 000000c714d9da58 rcx: 0000023500001590 (XEN) rdx: 000000c700000001 rsi: 000000c714d9da18 rdi: 000000c714d9db20 (XEN) rbp: 000000c714d9d950 rsp: 000000c714d9d918 r8: 0000023500001470 (XEN) r9: 00000235000014f0 r10: 00007ff99c5c0923 r11: 000000c714d9d970 (XEN) r12: 0000000000000000 r13: 000000c714d9d9d0 r14: 000000c714d9da58 (XEN) r15: 0000000000000006 cr0: 0000000080050031 cr4: 0000000000060678 (XEN) cr3: 00000001d9458002 cr2: 00007ff98b6fa048 (XEN) fsb: 0000000000000000 gsb: 000000c714e9e000 gss: ffffcd015dc40000 (XEN) ds: 002b es: 002b fs: 0053 gs: 002b ss: 002b cs: 0033 Why do users have this shadow_memory line in their guest config file? Well, I guess it's simply because there are not many proper examples of how to run Windows under Xen, so whoever is searching ze interwobz for it will end up on a page like... https://www.howtoforge.com/how-to-run-fully-virtualized-guests-hvm-with-xen-3.2-on-debian-lenny-x86_64 ...and then start copy pasting and adjusting until things work. Or... already have such a config for 10+ years and just only adjust things when it breaks after upgrading Xen. Hans van Kranenburg
