From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: jan.kiszka@siemens.com, kvm@vger.kernel.org, gleb@kernel.org,
avi.kivity@gmail.com
Subject: Re: [PATCH v2 1/4] KVM: x86: use new CS.RPL as CPL during task switch
Date: Sat, 17 May 2014 00:19:52 +0200 [thread overview]
Message-ID: <53768F08.1090008@redhat.com> (raw)
In-Reply-To: <1400172691-27030-2-git-send-email-pbonzini@redhat.com>
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.
next prev parent reply other threads:[~2014-05-16 22:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-15 16:51 [PATCH v2 0/4] KVM: x86: get CPL from SS.DPL Paolo Bonzini
2014-05-15 16:51 ` [PATCH v2 1/4] KVM: x86: use new CS.RPL as CPL during task switch Paolo Bonzini
2014-05-16 22:19 ` Paolo Bonzini [this message]
2014-05-26 16:55 ` Marcelo Tosatti
2014-05-15 16:51 ` [PATCH v2 2/4] KVM: x86: drop set_rflags callback Paolo Bonzini
2014-05-15 16:51 ` [PATCH v2 3/4] KVM: x86: check CS.DPL against RPL during task switch Paolo Bonzini
2014-05-26 17:01 ` Marcelo Tosatti
2014-05-15 16:51 ` [PATCH v2 4/4] KVM: x86: get CPL from SS.DPL Paolo Bonzini
2014-05-26 16:10 ` Marcelo Tosatti
[not found] <CALeycy9ZW5cwByGfdnkrm6r30Zy18aAKt3-T6fMJUMUNuHd80g@mail.gmail.com>
2014-05-26 5:09 ` [PATCH v2 1/4] KVM: x86: use new CS.RPL as CPL during task switch Wei Huang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53768F08.1090008@redhat.com \
--to=pbonzini@redhat.com \
--cc=avi.kivity@gmail.com \
--cc=gleb@kernel.org \
--cc=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox