-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Sat, Jan 06, 2018 at 03:20:36PM -0000, 'awokd' via qubes-devel wrote:
> Trying to debug an HVM PCI pass-through crash coming from:
> 
> https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/x86/hvm/svm/svm.c;h=8edc846a2ed4aec6a5711d272adbb10aaa741c27;hb=5e4598106ed02ae4b43abcb29889969eb12867b7
> 1536     /* Everything else is an error. */
> 1537     mfn = __get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, 0, NULL, 0);
> 1538     gdprintk(XENLOG_ERR,
> 1539          "SVM violation gpa %#"PRIpaddr", mfn %#lx, type %i\n",
> 1540          gpa, mfn_x(mfn), p2mt);
> 1541     domain_crash(v->domain);
> 
> Which results in:
> 
> (XEN) domain_crash called from svm.c:1541
> (XEN) Domain 10 (vcpu#0) crashed on cpu#2:
> (XEN) ------[ Xen-4.8.2  x86_64  debug=n   Not tainted ]------
> (XEN) CPU:    2
> (XEN) RIP:    0010:[<ffffffff97405f4e>]
> (XEN) RFLAGS: 0000000000000296   CONTEXT: hvm guest (d10v0)
> (XEN) rax: 0000000000000000   rbx: ffff97c946eb95c0   rcx: 0000000000000005
> (XEN) rdx: 0000000000000040   rsi: ffffaf5580700040   rdi: 0000000000000000
> (XEN) rbp: ffffaf55806cb8f8   rsp: ffffaf55806cb8c8   r8:  0000000000000000
> (XEN) r9:  00000000ffffff90   r10: 000000000000003f   r11: 0000000000000000
> (XEN) r12: 0000000000000000   r13: ffffffffc04fb7d0   r14: 0000000000000100
> (XEN) r15: ffff97c946eb4028   cr0: 0000000080050033   cr4: 00000000000406f0
> (XEN) cr3: 0000000012e30000   cr2: 0000000000000000
> (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0018   cs: 0010
> 
> Here's where I get lost. Can't find the output from that gdprintk
> anywhere, with both loglvl=all and guest_loglvl=all. I think I want to
> either change it to a printk and/or enable Xen debugging, which means a
> recompile. 

Yes, gdprintk is noop in non-debug build.

> What is the most newbish/straight-forward way to do that? Looks
> like Qubes-builder compiles Xen in
> chroot-fc25/home/user/rpmbuild/BUILD/xen-4.8.2. I can find and edit svm.c,
> but can't figure out where I should enable Xen debugging and what to do
> next.

You need to chroot into chroot-fc25 and switch to 'user' to compile it.
There you have all build dependencies installed. You can enable debug
using menuconfig.  So, the easiest way to get Xen debug build is:

    sudo chroot chroot-fc25 su -c 'make -C rpmbuild/BUILD/xen-4.8.2/xen 
menuconfig' - user
    sudo chroot chroot-fc25 su -c 'make -C rpmbuild/BUILD/xen-4.8.2/xen' - user

Then get compiled Xen binary from
chroot-fc25/home/user/rpmbuild/BUILD/xen-4.8.2/xen/xen.{gz,efi}

- -- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAlpRBd8ACgkQ24/THMrX
1yzVvwgAiBE+Gb+OGfgJtZDvDMh1HjLm4srQozp7yXLlcMeTDK/9Ev0wLHnqNoHT
prZFVfPjNZOguQRBEG0kLPWat/pqRJmnDpgnfkElJMpmBO6teooLVfbwF/pENohM
/ZRJ/v+ew/Wz7bL79FKErAYBOigL4QKw7syF4TlgBcdYFqHtohWaogvkoSuUxZUJ
BaenqIOf7bzU1mGcY8rtJxHhv6bkeL8dXbowALTs630z2gSljk5JOJIY7oB7aCaX
Z/n97RFxuvmHO1exRQEGMj4EGAmouFJNrHy5S/Lwm0zeQhBTV3UESGSgdDQg3pDR
AGPzTdHYN9/a0BsExoSEb1OKLx3haw==
=bkIu
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-devel/20180106172239.GW2653%40mail-itl.
For more options, visit https://groups.google.com/d/optout.

Reply via email to