All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir.fraser@eu.citrix.com>
To: "Xu, Dongxiao" <dongxiao.xu@intel.com>,
	"Cui, Dexuan" <dexuan.cui@intel.com>,
	xen-devel@lists.xensource.com
Subject: Re: [PATCH]Fix the bug of guest os installationfailure and win2k boot failure
Date: Tue, 18 Mar 2008 08:46:03 +0000	[thread overview]
Message-ID: <C40531CB.151D8%keir.fraser@eu.citrix.com> (raw)
In-Reply-To: <FF386CB4AE0E4648B0A96060EC00F36C8AFC87@pdsmsx412.ccr.corp.intel.com>

We're on the same page now, except that I realised there is a TOCTTOU race
introduced by relying on the processor's permission check while re-fetching
the instruction from scratch in the hypervisor. This allows, in theory, a
multi-threaded process to rewrite the I/O-port accessing instruction after
the processor has fetched the instruction, and validated the access, but
before Xen re-fetches the instruction for emulation. Possibly we do not care
too much about this, since the process must already have some
I/O-port-access permissions, but equally I don't expect we fall into the
TSS-bitmap check all that often, it's not that hard to implement, and then
we are definitely safe.

 -- Keir

On 18/3/08 01:49, "Xu, Dongxiao" <dongxiao.xu@intel.com> wrote:

> Hi, Keir, 
>     Now I understand what you mean. read_io, write_io, inject_hw_exception
> callbacks are not defined within the multi.c. So I/O instructions will not be
> emulated by it. Thanks for your comments. And the new patch is attached.
> 
> Best regards,
> -- Dongxiao
> 
> -----Original Message-----
> From: Keir Fraser [mailto:keir.fraser@eu.citrix.com]
> Sent: 2008年3月17日 19:21
> To: Cui, Dexuan; Xu, Dongxiao; xen-devel@lists.xensource.com
> Subject: Re: [Xen-devel] [PATCH]Fix the bug of guest os installationfailure
> and win2k boot failure
> 
> On 17/3/08 11:16, "Cui, Dexuan" <dexuan.cui@intel.com> wrote:
> 
>>> I think you misunderstand. The shadow emulator *never* emulates I/O
>>> port accesses or exception deliveries. Those callback functions are
>>> simply not implemented and are left as NULL.
>> Those callback functions -- what are they? -- do you mean the following?
>> static struct x86_emulate_ops hvm_emulate_ops = {
>>     ....
>>     .read_io       = hvmemul_read_io,
>>     .write_io      = hvmemul_write_io,
>> ...
>> };
> 
> Yes indeed. Also, crucially, .inject_hw_exception. Without that
> x86_emulate() is unable to inject any exception into the guest, and will
> instead return X86EMUL_UNHANDLEABLE.
> 
>  -- Keir
> 
> 

  reply	other threads:[~2008-03-18  8:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-17  8:08 [PATCH]Fix the bug of guest os installation failure and win2k boot failure Xu, Dongxiao
2008-03-17  8:32 ` Keir Fraser
2008-03-17 10:06   ` Xu, Dongxiao
2008-03-17 10:32     ` Keir Fraser
2008-03-17 11:16       ` [PATCH]Fix the bug of guest os installationfailure " Cui, Dexuan
2008-03-17 11:20         ` Keir Fraser
2008-03-18  1:49           ` Xu, Dongxiao
2008-03-18  8:46             ` Keir Fraser [this message]
2008-03-18  9:35               ` Xu, Dongxiao
2008-03-18 10:02                 ` Keir Fraser
2008-03-18 10:31                   ` Xu, Dongxiao
2008-03-18 10:47                     ` Keir Fraser
2008-03-18 16:32                   ` Keir Fraser

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=C40531CB.151D8%keir.fraser@eu.citrix.com \
    --to=keir.fraser@eu.citrix.com \
    --cc=dexuan.cui@intel.com \
    --cc=dongxiao.xu@intel.com \
    --cc=xen-devel@lists.xensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.