>>> On 17.11.14 at 00:07, <boris.ostrov...@oracle.com> wrote: > + if ( (vpmu_mode & XENPMU_MODE_SELF) ) > + cur_regs = guest_cpu_user_regs(); > + else if ( !guest_mode(regs) && > is_hardware_domain(sampling->domain) ) > + { > + cur_regs = regs; > + domid = DOMID_XEN; > + } > + else > + cur_regs = guest_cpu_user_regs();
Of course it would be nice to do this with a single if/else pair. > + else > + { > + struct segment_register seg; > + > + hvm_get_segment_register(sampled, x86_seg_cs, &seg); > + r->cs = seg.sel; > + hvm_get_segment_register(sampled, x86_seg_ss, &seg); > + r->ss = seg.sel; > + if ( seg.attr.fields.dpl != 0 ) > + *flags |= PMU_SAMPLE_USER; Is that how hardware treats it (CPL != 0 meaning user, rather than CPL == 3)? Maybe you should surface CPL instead of a boolean flag? Anyway, with or without the adjustments (unless you go a 3rd way) Acked-by: Jan Beulich <jbeul...@suse.com> Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel