Re: [PATCH 12/14] KVM: x86 emulator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



HI!

> Add an x86 instruction emulator for kvm.
> 
> We need an x86 emulator for the following reasons:
> 
> - mmio instructions are intercepted as page faults, with no information about
>   the operation to be performed other than the virtual address
> - real-mode is emulated using the old-fashined vm86 mode, with no special
>   intercepts for the privileged instructions, so we need to emulate mov cr,
>   lgdt, and lidt
> - we plan to cache shadow page tables in the future, so that a guest context
>   switch will not throw away all the mappings we worked so hard to build.  but
>   cachine page tables means write-protecting the guest page tables to keep
>   them in sync, so any writes to the guest page tables need to be emulated
> 
> The emulator was lifted from the Xen hypervisor.
> 
> Signed-off-by: Yaniv Kamay <[email protected]>
> Signed-off-by: Avi Kivity <[email protected]>
> 
> Index: linux-2.6/drivers/kvm/x86_emulate.c
> ===================================================================
> --- /dev/null
> +++ linux-2.6/drivers/kvm/x86_emulate.c
> @@ -0,0 +1,1370 @@
> +/******************************************************************************
> + * x86_emulate.c
> + *
> + * Generic x86 (32-bit and 64-bit) instruction decoder and emulator.
> + *
> + * Copyright (c) 2005 Keir Fraser
> + *
> + * Linux coding style, mod r/m decoder, segment base fixes, real-mode
> + * privieged instructions:
> + *
> + * Copyright (C) 2006 Qumranet
> + *
> + *   Avi Kivity <[email protected]>
> + *   Yaniv Kamay <[email protected]>
> + *
> + * From: xen-unstable 10676:af9809f51f81a3c43f276f00c81a52ef558afda4
> + */

This needs GPL, I'd say.
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux