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

Re: [Xen-devel] [PATCH v2 6/7] x86/hvm: Add SMAP support to HVM guest



>>> On 24.04.14 at 10:19, <feng.wu@xxxxxxxxx> wrote:
>> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
>> >>> On 23.04.14 at 16:37, <feng.wu@xxxxxxxxx> wrote:
>> > +        smap = hvm_smap_enabled(v) &&
>> > +               !(!ring_3(regs) && (regs->eflags & X86_EFLAGS_AC));
>> 
>> ring_3() isn't supposed to be used for HVM guests. Please use proper
>> HVM methods here.
> 
> To get the guest CS, I should use the following code path, right?
> hvm_get_segment_register() --> vmx_get_segment_register()
> 
> I don't find any HVM methods, so can I just use ((regs->cs & 3) < 3) here?

I'm confused - you found the method, but you say you didn't?
hvm_get_segment_register() is the correct one (just that you
need to do this on SS rather than CS, and on the DPL field rather
than the selector's RPL - there are a number of existing cases you
could use as reference; just grep for comparisons of
attr.fields.dpl with 3).

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®.