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

Re: [Xen-devel] [PATCH v1] hvm/svm: Implement Debug events



On 03/19/2018 04:48 PM, Tamas K Lengyel wrote:
> On Mon, Mar 19, 2018 at 8:07 AM, Alexandru Isaila
> <aisaila@xxxxxxxxxxxxxxx> wrote:
>> At this moment the Debug events for the AMD architecture are not
>> forwarded to the monitor layer.
>>
>> This patch adds the Debug event to the common capabilities, adds
>> the VMEXIT_ICEBP then forwards the event to the monitor layer.
>>
>> Chapter 2: SVM Processor and Platform Extensions: "Note: A vector 1
>> exception generated by the single byte INT1
>> instruction (also known as ICEBP) does not trigger the #DB
>> intercept. Software should use the dedicated ICEBP
>> intercept to intercept ICEBP"
>>
>> Signed-off-by: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>
>> ---
>>  xen/arch/x86/hvm/svm/svm.c    | 41 +++++++++++++++++++++++++++++------------
>>  xen/arch/x86/hvm/svm/vmcb.c   |  2 +-
>>  xen/include/asm-x86/monitor.h |  4 ++--
>>  3 files changed, 32 insertions(+), 15 deletions(-)
>>
>> diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
>> index c34f5b5..aa1feaa 100644
>> --- a/xen/arch/x86/hvm/svm/svm.c
>> +++ b/xen/arch/x86/hvm/svm/svm.c
>> @@ -1109,7 +1109,8 @@ static void noreturn svm_do_resume(struct vcpu *v)
>>  {
>>      struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
>>      bool debug_state = (v->domain->debugger_attached ||
>> -                        
>> v->domain->arch.monitor.software_breakpoint_enabled);
>> +                        v->domain->arch.monitor.software_breakpoint_enabled 
>> ||
>> +                        v->domain->arch.monitor.debug_exception_enabled);
> 
> I'm not sure this should be bundled under "debug_exception", on Intel
> this event type usually gets you things like singlestepping. To me
> ICEBP sounds like it would better fit under "software_breakpoint".
> Thoughts?
I also found it a bit curious that ICEBP is under the DEBUG vmexit with
VMX/Intel, but that's how it currently goes (you can see this easily by
running the swint-emulation XTF test). Xen-access will get this as a
debug (not breakpoint) event.

So if we move this, we'd need to also move it on VMX, for consistency.


Thanks,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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