[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v15 17/21] x86/VPMU: Handle PMU interrupts for PV guests




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 <jbeulich@xxxxxxxx>

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.