|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 10/17] PVH xen: introduce vmx_pvh.c and pvh.c
On Fri, 10 May 2013 08:07:59 +0100
"Jan Beulich" <JBeulich@xxxxxxxx> wrote:
> >>> On 10.05.13 at 03:51, Mukesh Rathor <mukesh.rathor@xxxxxxxxxx>
> >>> wrote:
> > On Wed, 01 May 2013 14:52:27 +0100
> > "Jan Beulich" <jbeulich@xxxxxxxx> wrote:
> >
> >> >> > +static int vmxit_io_instr(struct cpu_user_regs *regs)
> >> >> > +{
> >> >> > + int curr_lvl;
> >> >> > + int requested = (regs->rflags >> 12) & 3;
> >> >> > +
> >> >> > + read_vmcs_selectors(regs);
> >> >> > + curr_lvl = regs->cs & 3;
> >> >>
> >> >> Shouldn't you look at SS'es DPL instead?
> >> >
> >> >Ok. It looks like CPL is stored in both CS and SS, so either
> >> >should be ok. But I changed it to ss.
> >>
> >> Your response reads as if you're still looking at the low two bits
> >> of the selector, whereas me using DPL was intended to hint at you
> >> needing to look at the "hidden" portion of the register.
> >
> > Hmm... sorry, still don't understand why I need to use DPL here.
> > Ref'ing the SDM again: Vol1 Basic architecture on IO says:
> >
> > The following instructions can be executed only if the current
> > privilege level (CPL) of the program or task currently executing is
> > less than or equal to the IOPL: IN, INS, OUT, OUTS, CLI ..........
> >
> > It says in Vol 3A in chapter on Protection, that CPL comes
> > from bit 0 and 1 of the CS seg register. Since the RPL relfects the
> > CPL when the program is executing, it seems the above code is
> > correct. Moreover, I don't understand how the desc priv level of
> > stack segement relates to the IO instructions.
>
> This is of specific relevance when including real and VM86 modes in
> the picture: The section "Guest Register State" says "The value of
> the DPL field for SS is always equal to the logical processorâs
> current privilege level (CPL)", with the respective footnote "In
> protected mode, CPL is also associated with the RPL field in the CS
> selector. However, the RPL fields are not meaningful in real-address
> mode or in virtual- 8086 mode".
A PVH is not expected to be in real/v86 mode, but I guess it's not
enforced. I'll change it to look for SS DPL instead.
Mukesh
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |