qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	qemu-devel@nongnu.org, kvm@vger.kernel.org,
	Avi Kivity <avi@redhat.com>
Subject: [Qemu-devel] [PATCH 09/31] kvm: x86: Fix DPL write back of segment registers
Date: Mon, 24 Jan 2011 07:02:18 -0200	[thread overview]
Message-ID: <acaa75507b34f7b588924a09c76c6848d209e08c.1295859760.git.mtosatti@redhat.com> (raw)
In-Reply-To: <cover.1295859760.git.mtosatti@redhat.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

The DPL is stored in the flags and not in the selector. In fact, the RPL
may differ from the DPL at some point in time, and so we were corrupting
the guest state so far.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
---
 target-i386/kvm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 9a4bf98..ee7bdf8 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -602,7 +602,7 @@ static void set_seg(struct kvm_segment *lhs, const SegmentCache *rhs)
     lhs->limit = rhs->limit;
     lhs->type = (flags >> DESC_TYPE_SHIFT) & 15;
     lhs->present = (flags & DESC_P_MASK) != 0;
-    lhs->dpl = rhs->selector & 3;
+    lhs->dpl = (flags >> DESC_DPL_SHIFT) & 3;
     lhs->db = (flags >> DESC_B_SHIFT) & 1;
     lhs->s = (flags & DESC_S_MASK) != 0;
     lhs->l = (flags >> DESC_L_SHIFT) & 1;
-- 
1.7.2.3

  parent reply	other threads:[~2011-01-24  9:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-24  9:02 [Qemu-devel] [PATCH 00/31] [PULL] qemu-kvm.git uq/master queue Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 01/31] kvm: Enable user space NMI injection for kvm guest Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 02/31] kvm: convert kvm_ioctl(KVM_CHECK_EXTENSION) to kvm_check_extension() Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 03/31] Clean up cpu_inject_x86_mce() Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 04/31] Add "broadcast" option for mce command Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 05/31] Add function for checking mca broadcast of CPU Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 06/31] kvm: introduce kvm_mce_in_progress Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 07/31] kvm: kvm_mce_inj_* subroutines for templated error injections Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 08/31] kvm: introduce kvm_inject_x86_mce_on Marcelo Tosatti
2011-01-24  9:02 ` Marcelo Tosatti [this message]
2011-01-24  9:02 ` [Qemu-devel] [PATCH 10/31] kvm: x86: Remove obsolete SS.RPL/DPL aligment Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 11/31] kvm: x86: Prevent sign extension of DR7 in guest debugging mode Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 12/31] kvm: x86: Fix a few coding style violations Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 13/31] kvm: Fix " Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 14/31] kvm: x86: Swallow KVM_EXIT_SET_TPR Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 15/31] kvm: Stop on all fatal exit reasons Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 16/31] kvm: Improve reporting of fatal errors Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 17/31] x86: Optionally dump code bytes on cpu_dump_state Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 18/31] kvm: x86: Align kvm_arch_put_registers code with comment Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 19/31] kvm: x86: Prepare kvm_get_mp_state for in-kernel irqchip Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 20/31] kvm: x86: Remove redundant mp_state initialization Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 21/31] kvm: x86: Fix xcr0 reset mismerge Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 22/31] kvm: x86: Refactor msr_star/hsave_pa setup and checks Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 23/31] kvm: x86: Reset paravirtual MSRs Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 24/31] kvm: x86: Fix !CONFIG_KVM_PARA build Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 25/31] kvm: Drop smp_cpus argument from init functions Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 26/31] kvm: Consolidate must-have capability checks Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 27/31] kvm: x86: Rework identity map and TSS setup for larger BIOS sizes Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 28/31] kvm: Flush coalesced mmio buffer on IO window exits Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 29/31] kvm: Do not use qemu_fair_mutex Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 30/31] kvm: x86: Implicitly clear nmi_injected/pending on reset Marcelo Tosatti
2011-01-24  9:02 ` [Qemu-devel] [PATCH 31/31] kvm: x86: Only read/write MSR_KVM_ASYNC_PF_EN if supported Marcelo Tosatti
2011-02-17 20:00 ` [Qemu-devel] [PATCH 00/31] [PULL] qemu-kvm.git uq/master queue Anthony Liguori

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=acaa75507b34f7b588924a09c76c6848d209e08c.1295859760.git.mtosatti@redhat.com \
    --to=mtosatti@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).