From: Marcelo Tosatti <mtosatti@redhat.com>
To: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Cc: avi@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH v2] KVM: fix load_guest_segment_descriptor() to return X86EMUL_*
Date: Tue, 2 Feb 2010 13:42:02 -0200 [thread overview]
Message-ID: <20100202154202.GA6156@amt.cnet> (raw)
In-Reply-To: <4B681F5F.4090702@oss.ntt.co.jp>
On Tue, Feb 02, 2010 at 09:49:35PM +0900, Takuya Yoshikawa wrote:
> A bit more explanation,
>
> Takuya Yoshikawa wrote:
> >This patch fixes load_guest_segment_descriptor() to return
> >X86EMUL_PROPAGATE_FAULT when it tries to access the descriptor
> >table beyond the limit of it: suggested by Marcelo.
> >
> >I have checked current callers of this helper function,
> > - kvm_load_segment_descriptor()
> > - kvm_task_switch()
> >and confirmed that this patch will change nothing in the
> >upper layers if we do not change the handling of this
> >return value from load_guest_segment_descriptor().
> >
> >Next step: Although fixing the kvm_task_switch() to handle the
> >propagated faults properly seems difficult, and maybe not worth
> >it because TSS is not used commonly these days, we can fix
> >kvm_load_segment_descriptor(). By doing so, the injected #GP
> >becomes possible to be handled by the guest. The only problem
> >for this is how to differentiate this fault from the page faults
> >generated by kvm_read_guest_virt(). We may have to split this
> >function to achive this goal.
> >
>
> My concern is we may have to inject different types of
> faults/exceptions depending on callers when kvm_read_guest_virt()
> returns X86EMUL_PROPAGATE_FAULT. Actually if always injecting
> page faults in the load_guest_segment_descriptor() right after
> kvm_read_guest_virt() is OK, we do not have any problems.
>
> Personally I think we'd better to inject page faults for
> kvm_load_segment_descriptor().
>
> Is it right?
Yes, if kvm_read_guest_virt fails, inject page fault.
Applied patch, thanks.
prev parent reply other threads:[~2010-02-02 16:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-01 13:11 [PATCH v2] KVM: fix load_guest_segment_descriptor() to return X86EMUL_* Takuya Yoshikawa
2010-02-02 12:49 ` Takuya Yoshikawa
2010-02-02 15:42 ` Marcelo Tosatti [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=20100202154202.GA6156@amt.cnet \
--to=mtosatti@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=yoshikawa.takuya@oss.ntt.co.jp \
/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