Re: Software breakpoint in kvmppc guest debug

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

 



On 09.11.2010, at 18:00, Hollis Blanchard wrote:

> On 11/09/2010 08:50 AM, Alexander Graf wrote:
>> On 09.11.2010, at 17:36, Scott Wood wrote:
>>> >  On Tue, 9 Nov 2010 13:14:47 +0100
>>> >  Alexander Graf<agraf@xxxxxxx>  wrote:
>>>> >>  On 09.11.2010, at 04:40, Liu Yu-B13201 wrote:
>>>>> >>>  Software breakpoint is a instruction which should make guest exit.
>>>>> >>>  We replace guest code with software breakpoint instruction so that we can stop at anywhere we want.
>>>>> >>>  >>>  In my previous guest debug patches for e500, I used instruction (sc 64) as software breakpoint.
>>>>> >>>  Seem this was not good, since (sc 64) maybe defined in future.
>>>> >>  >>  That's always the case with overloading instructions :).
>>>> >>  
>>>>> >>>  also this instruction has uncertain effective on E.HV platform such as e500mc.
>>>> >>  >>  Not sure if the hardware or other hypervisors break the spec, but according to 2.06 page 908 only LEV=0 and LEV=1 are defined.
>>> >  >  Does it say whether undefined values trap?  Maybe it only looks at the
>>> >  low bit of LEV, or checks != 0, etc.
>> It doesn't mentioned undefined values. It only mentions LEV=0 and LEV=1. But I don't like the idea of hard overloading a specific LEV value either way :). I'd rather use an undefined instruction for it.
> Who's to say that undefined instruction will remain undefined in the future? It amounts to the same problem.

Oh sorry if that sounded as if I wanted to see an undefined instruction being used. I was trying to make the point that using an undefined instruction is very bad and thus should not happen. So using sc 64 sounds about as bad to me.

Now, if we can get away with not using an undefined instruction (be it sc 64 or trap) I don't know. I'm not even sure we can get away with trap. Basically, WARN_ON should also trigger a trap, so you'd end up in gdb for that when having a breakpoint defined.

We should really include Jan in the discussion. He's the debug framework expert in qemu and kvm and maybe has some ideas and plans on where to drive the whole thing.

> Although in other ways the ISA benefits from a great deal of foresight, as far as I remember this particular issue isn't addressed.

:(


Alex

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux