On 11/25/2014 09:28 AM, Jan Beulich wrote:

+            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)?

You mean how *software* (e.g. Linux kernel) treats it? If yes, then for 32-bit user_mode() checks for (CS == 3) and for 64-bit it's !!(CS & 3).

Maybe you should surface CPL instead of a
boolean flag?

Am I not already doing it by passing SS and CS to the guest?

-boris


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

Reply via email to