From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cam Macdonell Subject: Re: What happens on an INT80 instruction Date: Mon, 01 Oct 2007 17:23:55 -0600 Message-ID: <4701818B.4040108@cs.ualberta.ca> References: <47004DDE.1060603@codemonkey.ws> <47015E42.4000403@cs.ualberta.ca> <4701614B.8090107@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Anthony Liguori , kvm-devel Return-path: In-Reply-To: <4701614B.8090107-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Anthony Liguori wrote: > Cam Macdonell wrote: >> Anthony Liguori wrote: >>> Cameron Macdonell wrote: >>>> Hi, >>>> >>>> I'm trying to understand guest virtualization at the lower levels. >>>> I have a somewhat basic question: How does KVM virtualize an >>>> int80 instruction from a guest? A pointer to an answer is just as >>>> good as an answer itself. >>>> >>> >>> The same thing happens as it does on normal hardware. >>> >>> The way VT/SVM works (at a high level), is that certain instructions >>> and events check a special area called the VMCS/VMCB to determine >>> whether the event should generate a vmexit which is really just a >>> special type of trap. >>> >> >> Thanks Anthony. Does an int80 from an application in the guest always >> cause a vmexit (in kvm's case at least)? > > No, an int80 would never generate a trap in KVM. The only way to make > it generate a trap is for an int80 to trigger some other event that > would generate a trap. This is what I meant by taking over the guest's > IDT such that you could change the int80 handler to do a hypercall. > > I presume you're looking into doing a guest IDS right? > Actually, I looking into doing a PhD dissertation :) I'm just trying to get a better working understanding of how kvm (and other VMMs) handle instructions like int80 that should trap into the OS, but of course in a VM need to trap into the guest OS (which is running at user-level) and not the host OS. Do traps by a guest app to the guest OS involve the VMM at all? Pardon my ignorance, what is IDS? Thanks, Cam ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/