From: Keir Fraser Subject: Re: Paravirtualization of the "HLT" instruction (for example) on x386 Date: Thu, 12 Jan 2006 10:58:26 +0000 Message-ID: References: <60c562438f7299b8b178aa9b70cd6997@cl.cam.ac.uk> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Brown Cc: Xen Mailing List List-Id: xen-devel@lists.xenproject.org On 12 Jan 2006, at 10:39, Ian Brown wrote: > 1) Can you please give a pointer to where in code (xen 3.0) such > privileged > instruction is replaced > with a trap to the hypervisor ? (I have some assumption where it is > done > but I am really not sure at all) xen_idle() in arch/xen/i386/process.c. Uses the SCHEDOP_block hypercall, which is a fairly direct replacement for HLT. > 2) Regarding HLT - what happens if a guest OS issue "HLT" ? > I assume that without intervention in Xen code, issuing HLT from a > guest domain can stop not only the guest domain, but also the > hypervisor (and in fact the machine). > is there somewhere in code special treatment to "HLT"? HLT is only executable in ring 0. If the guest tries to execute it then it will receive a general protection fault. -- Keir