Avi Kivity wrote:
> Jan Kiszka wrote:
>> This adds an arch field to kvm_run.debug, the payload that is returned
>> to user space on KVM_EXIT_DEBUG guest exits. For x86, this field is now
>> supposed to report the precise debug exception (#DB or #BP) and the
>> current state of the debug registers (the latter is not yet
>> implemented).
>>  
>> +struct kvm_debug_exit_arch {
>> +    __u32 exception;
>>   
> 
> Need padding here.
> 
>> +    __u64 dr[8];
>> +};
>> +
>>   
> 
> In general I prefer decoding bitfields into something more usable (see
> for example the segment registers), but in this case, I guess the raw
> registers are better.

IMHO, there is no point in parsing those arch-specific bit field in
kernel space as long as the kernel has nothing to do with them (except
saving and restoring them).

BTW, the upcoming version will look like this:

struct kvm_debug_exit_arch {
        __u32 exception;
        __u32 pad;
        __u64 dr6;
        __u64 dr7;
};

(No need for reporting unused or unmodified registers here.)

> 
> We need to handle branch tracing and last branch recording as well.  It
> doesn't have to be in this patchset, though.

IIRC, both features are fairly vendor specific. Do we have the same
level of support on both AMD and Intel CPUs? Moreover, I doubt that the
debug interface would be the right place for them.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to