lkml.org 
[lkml]   [2014]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/4] KVM: x86: use new CS.RPL as CPL during task switch
Il 15/05/2014 18:51, Paolo Bonzini ha scritto:
> During task switch, all of CS.DPL, CS.RPL, SS.DPL must match (in addition
> to all the other requirements) and will be the new CPL. So far this
> worked by carefully setting the CS selector and flag before doing the

s/flag/EFLAGS/

> task switch; however, this will not work once we get the CPL from SS.DPL:
> setting SS itself would fail if the task switch changes the privilege
> level.

More precisely, before patch 4 in this series setting CS.selector would
already change the CPL. After it, you actually have to set the full
segment descriptor cache to change the CPL, so we cannot use
ctxt->ops->cpl(ctxt) to retrieve the CPL during a task switch. The
check that fails without this patch is that SS.DPL must be == CPL, and
the failure happens because ctxt->ops->cpl(ctxt) is the *old* SS.DPL.

Paolo

> Temporarily assume that the CPL comes from CS.RPL during task switch
> to a protected-mode task. This is the same approach used in QEMU's
> emulation code, which (until version 2.0) manually tracks the CPL.



\
 
 \ /
  Last update: 2014-05-17 01:01    [W:0.082 / U:23.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site