lkml.org 
[lkml]   [2021]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH] KVM: X86: Also reload the debug registers before kvm_x86->run() when the host is using them
    From
    Date
    On 09/07/21 05:09, Lai Jiangshan wrote:
    > I just noticed that emulation.c fails to emulate with DBn.
    > Is there any problem around it?

    Just what you said, it's not easy and the needs are limited. I
    implemented kvm_vcpu_check_breakpoint because I was interested in using
    hardware breakpoints from gdb, even with unrestricted_guest=0 and
    invalid guest state, but that's it.

    Paolo

    > For code breakpoint, if the instruction didn't cause vm-exit,
    > (for example, the 2nd instruction when kvm emulates instructions
    > back to back) emulation.c fails to emulate with DBn.
    >
    > For code breakpoint, if the instruction just caused vm-exit.
    > It is difficult to analyze this case due to the complex priorities
    > between vectored events and fault-like vm-exit.
    > Anyway, if it is an instruction that vm-exit has priority over #DB,
    > emulation.c fails to emulate with DBn.
    >
    > For data breakpoint, a #DB must be delivered to guest or to VMM (when
    > guest-debug) after the instruction. But emulation.c doesn't do so.
    >
    > And the existence of both of effective DBn (guest debug) and guest DBn
    > complicates the problem when we try to emulate them.

    \
     
     \ /
      Last update: 2021-07-09 11:49    [W:5.110 / U:0.232 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site