lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4537BD27.7050509@qumranet.com>
Date:	Thu, 19 Oct 2006 20:00:07 +0200
From:	Avi Kivity <avi@...ranet.com>
To:	Muli Ben-Yehuda <muli@...ibm.com>
CC:	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 0/7] KVM: Kernel-based Virtual Machine

Muli Ben-Yehuda wrote:
> Hi,
>
> Looks pretty interesting! some comments:
>
> - patch 4/7 hasn't made it to the list?
>   

Probably too big.  It's also the ugliest.  I'll split it and resend (not 
through thunderbird though... ate all my tabs!).


> - it would be useful for reviewing this if you could post example code
>   making use of the /dev/kvm interfaces - they seem fairly complex.
>   

Working code is fairly hairy, since it's emulating a PC.  That'll be on 
sourceforge once they approve my new project.

In general one does

  open("/dev/kvm")
  ioctl(KVM_SET_MEMORY_REGION) for main memory
  ioctl(KVM_SET_MEMORY_REGION) for the framebuffer
  ioctl(KVM_CREATE_VCPU) for the obvious reason
  if (debugger)
    ioctl(KVM_DEBUG_GUEST) to singlestep or breakpoint the guest
  while (1) {
     ioctl(KVM_RUN)
     switch (exit reason) {
         handle mmio, I/O etc. might call
            ioctl(KVM_INTERRUPT) to queue an external interrupt
            ioctl(KVM_{GET,SET}_{REGS,SREGS}) to query/modify registers
            ioctl(KVM_GET_DIRTY_LOG) to see which guest memory pages 
have changed
     }

I have some simple test code, I'll clean it up and post it.

> - why do it this way rather than through a virtual machine monitor
>   such as Xen? what do you gain from having the virtual machines
>   encapsulated as Linux processes?
>   

- architectural simplicity: instead of splitting memory management and 
scheduling between Xen and domain 0, use just the Linux memory 
management and scheduler
- use standard tools (top(1), kill(1)) and security model (permissions 
on /dev/kvm)
- much smaller codebase (although paravirtualization is not included (yet))
- no changes to core code
- easy to upgrade an existing system
- easier for drive-by virtualization (modprobe kvm; do-your-stuff; 
ctrl-C; rmmod kvm)
- longer term, better performance since there's no need to switch to 
domain 0 for I/O (instead just switch to user mode of the VM's process)

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ