All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Mark Ryden <markryde@gmail.com>
Cc: Ian Brown <ianbrn@gmail.com>,
	Xen Mailing List <xen-devel@lists.xensource.com>
Subject: Re: Paravirtualization of the "HLT" instruction (for example) on x386
Date: Sat, 28 Jan 2006 16:06:50 -0600	[thread overview]
Message-ID: <43DBEAFA.3010704@us.ibm.com> (raw)
In-Reply-To: <dac45060601280741t676078edta6d9f0cda351a8e6@mail.gmail.com>

Mark Ryden wrote:

>>Furthermore, some instructions *have* to be paravirtualised because
>>they do not trap
>>    
>>
>
>So all the instances of such instructions which don't trap and are
>problemtaic in some sense , under the linux-xen0 and linux-xenU, are 
>replaced ?  Did I get it right ?
>  
>
Yes, a very thorough explaination of this all is available here:

http://www.cs.nps.navy.mil/people/faculty/irvine/publications/2000/VMM-usenix00-0611.pdf

Regards,

Anthony Liguori

>Mark
>
>
>
>On 1/24/06, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote:
>  
>
>>On 24 Jan 2006, at 11:27, Ian Brown wrote:
>>
>>    
>>
>>>I know that CLTS and WBINVD instructions, for example , should cause
>>>#GP(0) if run from CPL which is not 0; but grepping for an asm
>>>instruction
>>>which calls CLTS or WBINVD under the sparse tree gives no results.
>>>
>>>Can you give one example for such an instruction which cause a trap
>>>to the hypervisor when run in a guest OS and where in the code it
>>>causes
>>>such a trap ?
>>>
>>>(As far as I understand,if we try to issue a privilege instruction from
>>>CPL1 we should get a #GP(0) and reach the general protection
>>>handler in sparse/arch/xen/i386/kernel/traps.c ,
>>>do_general_protection().
>>>
>>>But I had looked at do_general_protection() in
>>>sparse/arch/xen/i386/kernel/traps.c
>>>and could not find there a mechanism which will trap to the
>>>hypervisor;maybe
>>>I had totally missed the point?)
>>>      
>>>
>>The main entry point for GPFs is in the hypervisor at
>>do_general_protection() in xen/arch/x86/traps.c. For certain privileged
>>instructions we perform emulation (see emulate_privileged_op() in the
>>same Xen source file). We emulate both CLTS and WBINVD for example.
>>GPFs that are not handled by Xen are indeed then passed to the guest
>>and will end up in the function you mentioned in your email.
>>
>>However, we also have paravirtualised versions of both those
>>instructions (for example, CLTS is equivalent to the hypercall
>>fpu_taskswitch(0)).
>>
>>Furthermore, some instructions *have* to be paravirtualised because
>>they do not trap (for example, POPF where the restored EFLAGS has a
>>different Interrupt-Enable flag value from current EFLAGS).
>>
>>  -- Keir
>>
>>
>>_______________________________________________
>>Xen-devel mailing list
>>Xen-devel@lists.xensource.com
>>http://lists.xensource.com/xen-devel
>>
>>    
>>
>
>_______________________________________________
>Xen-devel mailing list
>Xen-devel@lists.xensource.com
>http://lists.xensource.com/xen-devel
>
>  
>

  reply	other threads:[~2006-01-28 22:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-12  9:27 Paravirtualization of the "HLT" instruction (for example) on x386 Ian Brown
2006-01-12 10:36 ` Keir Fraser
2006-01-12 10:39   ` Ian Brown
2006-01-12 10:58     ` Keir Fraser
2006-01-24 11:27   ` Ian Brown
2006-01-24 11:39     ` Keir Fraser
2006-01-24 12:24       ` Ian Brown
2006-01-24 13:30         ` Keir Fraser
2006-01-28 15:41       ` Mark Ryden
2006-01-28 22:06         ` Anthony Liguori [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-01-24 13:34 Paravirtualization of the "HLT" instruction ( for " Petersson, Mats

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=43DBEAFA.3010704@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=ianbrn@gmail.com \
    --cc=markryde@gmail.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.