Il 20/05/2014 04:25, Jidong Xiao ha scritto:
Hi, The structure kvm_segment is defined as follows: struct kvm_segment { __u64 base; __u32 limit; __u16 selector; __u8 type; __u8 present, dpl, db, s, l, g, avl; __u8 unusable; __u8 padding; }; Since the VMX spec defines base is 64 bits, limit is 32bits, selector is 16bits, understandably, __u64, __u32, __u16 is used for them respectively. However, the VMX spec defines that the access rights is 32bits, which includes a 4 bits type, 2 bits dpl, and 1 bit for the present,dpl,db,s,l,g,avl. So why here they are all defined as __u8? It means that, each of them is represented by 8bits? This looks inconsistent with the VMX spec.
This is not a VMX definition, it's part of the ioctl interface between KVM and user-mode programs.
For the conversion code see vmx_get_segment and vmx_set_segment. These should be never called in hot paths, except unfortunately when doing nested virtualization.
Paolo _______________________________________________ Virtualization mailing list Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/virtualization