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

Re: [Xen-devel] [PATCH v3 2/4] hvm/svm: Enable Breakpoint events



On Lu, 2018-02-12 at 15:54 +0000, Andrew Cooper wrote:
> On 12/02/18 15:08, Alexandru Isaila wrote:
> >
> > @@ -2619,14 +2634,31 @@ void svm_vmexit_handler(struct
> > cpu_user_regs *regs)
> >          break;
> >
> >      case VMEXIT_EXCEPTION_BP:
> > -        if ( !v->domain->debugger_attached )
> > -            goto unexpected_exit_type;
> > -        /* AMD Vol2, 15.11: INT3, INTO, BOUND intercepts do not
> > update RIP. */
> > -        if ( (inst_len = __get_instruction_length(v, INSTR_INT3))
> > == 0 )
> > +        inst_len = __get_instruction_length(v, INSTR_INT3);
> There are multiple ways of ending up with this vmexit, and INT3 is
> not
> the only way.
>
> The old code was somewhat broken (but only in the case that a
> debugger
> was attached), but now with  this introspection hook active,
> executing
> `0xcd 0x03` will end up crashing the domain because of a length
> mismatch
> looking for 0xcc.
>
> You need to inspect EXITINTINFO to work out what went on here, and
> distinguish INT3 from INT $3.
>
> Can I suggest that you run this unit test
> http://xenbits.xen.org/docs/xtf/test-swint-emulation.html under debug
> introspection an check that you get all expected events?  Every time
> we
> touch this code, we seem to break it :(
>
> ~Andrew
>
Hi Andrew,

I've executed the test-swint-emulation and the domain did not crash.
The result is right here:
(d1) --- Xen Test Framework ---
(d1) Environment: HVM 64bit (Long mode 4 levels)
(d1) Software interrupt emulation
(d1) FEP support not detected - some tests will be skipped
(d1) Test cpl0: all perms ok
(d1)   Testing int3
(d1)   Testing int $3
(d1)   Testing icebp
(d1)   Testing int $1
(d1)   Testing into
(d1) Test cpl0: p=0
(d1)   Testing int3
(d1)   Testing int $3
(d1)   Testing icebp
(d1)   Testing int $1
(d1)   Testing into
(d1) Test cpl3: all perms ok
(d1)   Testing int3
(d1)   Testing int $3
(d1)   Testing icebp
(d1)   Testing int $1
(d1)   Testing into
(d1) Test cpl3: p=0
(d1)   Testing int3
(d1)   Testing int $3
(d1)   Testing icebp
(d1)   Testing int $1
(d1)   Testing into
(d1) Test cpl3: dpl=0
(d1)   Testing int3
(d1)   Testing int $3
(d1)   Testing icebp
(d1)   Testing int $1
(d1)   Testing into
(d1) Test result: SKIP


If you think we need to be safe, I can add a test like if (
exitintinfo.type !=  INSTR_INT3) break;

~Alex

________________________
This email was scanned by Bitdefender
_______________________________________________
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®.