[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Crash when writing to x86 hardware debug registers



Hi All,
I am running a userland debugger in Windows 10 HVM on Xen 4.16 on an Intel chip. I noticed when I set a hardware breakpoint (which writes to the DR0 register), Windows 10 crashes. This crash reproduces both with and without viridian enabled in the DomU cfg file.

(XEN) Xen version 4.16.1 (neil@) (gcc (Debian 10.2.1-6) 10.2.1 20210110) debug=n Tue Apr 19 11:20:04 EDT 2022
(XEN) d13v0 VIRIDIAN CRASH: 1e ffffffffc0000096 fffff8007f85562c 0 0

This output from xl dmesg shows that I am not running a debug hypervisor, and that theres a viridian crash. I've gotten the following stop codes in the BSOD from Windows: KMODE EXCEPTION NOT HANDLED, SYSTEM_SERVICE EXCEPTION.

I see this code in xen/xen/arch/x86/msr.c inside guest_wrmsr():
    case MSR_AMD64_DR0_ADDRESS_MASK:
    case MSR_AMD64_DR1_ADDRESS_MASK ... MSR_AMD64_DR3_ADDRESS_MASK:
        if ( !cp->extd.dbext )
            goto gp_fault;

I was assuming AMD64 refers to a 64 bit CPU rather than an AMD CPU, and this is one of the few references I found to DR0, and I saw a deliberate fault raised if dbext is not set. However I'm told that dbext is unrelated, set by default and does not need to be set at hypervisor compile time.

Any ideas why I'm getting this crash?

Thanks in Advance,
Neil

--
Twitter: @neilsikka

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.