On Fri, Dec 01, 2017 at 02:45:57PM +0900, Masatake YAMATO wrote:
> * kvm.c (kvm_ioctl): Handle KVM_SET_SREGS and KVM_GET_SREGES.
> (kvm_ioctl_decode_sregs): New function.
> (kvm_ioctl_decode_regs_dtable): New function.
> (kvm_ioctl_decode_regs_segment): New function.
> 
> Signed-off-by: Masatake YAMATO <yam...@redhat.com>
> ---
>  kvm.c | 82 
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 82 insertions(+)
> 
> diff --git a/kvm.c b/kvm.c
> index 69a8c97a..b0eb1377 100644
> --- a/kvm.c
> +++ b/kvm.c
> @@ -121,6 +121,85 @@ kvm_ioctl_decode_regs(struct tcb *const tcp, const 
> unsigned int code, const kern
>  #endif
>  }
>  
> +#ifdef X86_64
> +static void
> +kvm_ioctl_decode_regs_segment(const char *prefix, struct kvm_segment 
> *segment)
> +{
> +     tprints(prefix);
> +     PRINT_FIELD_X("={", *segment, base);
> +     PRINT_FIELD_U(", ", *segment, limit);
> +     PRINT_FIELD_U(", ", *segment, selector);
> +     PRINT_FIELD_U(", ", *segment, type);
> +     PRINT_FIELD_U(", ", *segment, present);
> +     PRINT_FIELD_U(", ", *segment, dpl);
> +     PRINT_FIELD_U(", ", *segment, db);
> +     PRINT_FIELD_U(", ", *segment, s);
> +     PRINT_FIELD_U(", ", *segment, l);
> +     PRINT_FIELD_U(", ", *segment, g);
> +     PRINT_FIELD_U(", ", *segment, avl);
> +     tprints("}");
> +}
> +
> +static void
> +kvm_ioctl_decode_regs_dtable(const char *prefix, struct kvm_dtable *dtable)
> +{
> +     tprints(prefix);
> +     PRINT_FIELD_X("={", *dtable, base);
> +     PRINT_FIELD_U(", ", *dtable, limit);
> +     tprints("}");
> +}
> +#endif
> +
> +static int
> +kvm_ioctl_decode_sregs(struct tcb *const tcp, const unsigned int code, const 
> kernel_ulong_t arg)
> +{
> +     struct kvm_sregs sregs;
> +
> +#ifdef X86_64

The same reasoning as in case of struct kvm_regs applies here as well.


-- 
ldv

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to