From: Avi Kivity <avi@qumranet.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [patch 3/3] KVM: task switch: check for segment base translation failure
Date: Sun, 20 Jul 2008 12:24:35 +0300 [thread overview]
Message-ID: <48830453.5010000@qumranet.com> (raw)
In-Reply-To: <20080719220933.000583030@localhost.localdomain>
Marcelo Tosatti wrote:
> Subject says it all.
>
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
>
> Index: kvm-vmx-checks/arch/x86/kvm/x86.c
> ===================================================================
> --- kvm-vmx-checks.orig/arch/x86/kvm/x86.c
> +++ kvm-vmx-checks/arch/x86/kvm/x86.c
> @@ -3253,6 +3253,8 @@ static int load_guest_segment_descriptor
> return 1;
> }
> gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, dtable.base);
> + if (gpa == UNMAPPED_GVA)
> + return 1;
> gpa += index * 8;
> return kvm_read_guest(vcpu->kvm, gpa, seg_desc, 8);
> }
>
This is wrong; if the descriptor table is long enough, the first page
could be unmapped but the page(s) containing the segment could be mapped
(and nothing guarantees the mapping is contiguous).
We need to translate dtable.base + index * 8.
What we really need is kvm_read_guest_virt() to take care of all of
these things. The emulator callbacks come fairly close.
--
error compiling committee.c: too many arguments to function
prev parent reply other threads:[~2008-07-20 9:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-19 22:08 [patch 0/3] task switch fixes Marcelo Tosatti
2008-07-19 22:08 ` [patch 1/3] KVM: task switch: translate guest segment limit to virt-extension byte granular field Marcelo Tosatti
2008-07-20 9:22 ` Avi Kivity
2008-07-20 16:43 ` Marcelo Tosatti
2008-07-21 8:14 ` Avi Kivity
2008-07-19 22:08 ` [patch 2/3] KVM: task switch: check task busy state Marcelo Tosatti
2008-07-19 22:08 ` [patch 3/3] KVM: task switch: check for segment base translation failure Marcelo Tosatti
2008-07-20 9:24 ` Avi Kivity [this message]
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=48830453.5010000@qumranet.com \
--to=avi@qumranet.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/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