* [Qemu-devel] [PATCH] kvm: x86: Fix DPL write back of segment registers
@ 2010-12-27 14:56 Jan Kiszka
2010-12-27 15:36 ` [Qemu-devel] " Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2010-12-27 14:56 UTC (permalink / raw)
To: Avi Kivity, Marcelo Tosatti; +Cc: qemu-devel, kvm
[-- Attachment #1: Type: text/plain, Size: 945 bytes --]
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>
---
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 218812a..b3d7c54 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.1
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Qemu-devel] Re: [PATCH] kvm: x86: Fix DPL write back of segment registers
2010-12-27 14:56 [Qemu-devel] [PATCH] kvm: x86: Fix DPL write back of segment registers Jan Kiszka
@ 2010-12-27 15:36 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2010-12-27 15:36 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Marcelo Tosatti, qemu-devel, kvm
On 12/27/2010 04:56 PM, Jan Kiszka wrote:
> 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.
>
Applied to uq/master; thanks.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-27 15:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-27 14:56 [Qemu-devel] [PATCH] kvm: x86: Fix DPL write back of segment registers Jan Kiszka
2010-12-27 15:36 ` [Qemu-devel] " Avi Kivity
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).