1. 12 11月, 2007 1 次提交
    • R
      virtio: Force use of power-of-two for descriptor ring sizes · 42b36cc0
      Rusty Russell 提交于
      The virtio descriptor rings of size N-1 were nicely set up to be
      aligned to an N-byte boundary.  But as Anthony Liguori points out, the
      free-running indices used by virtio require that the sizes be a power
      of 2, otherwise we get problems on wrap (demonstrated with lguest).
      
      So we replace the clever "2^n-1" scheme with a simple "align to page
      boundary" scheme: this means that all virtio rings take at least two
      pages, but it's safer than guessing cache alignment.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      42b36cc0
  2. 25 10月, 2007 1 次提交
  3. 23 10月, 2007 1 次提交
    • R
      Lguest support for Virtio · 19f1537b
      Rusty Russell 提交于
      This makes lguest able to use the virtio devices.
      
      We change the device descriptor page from a simple array to a variable
      length "type, config_len, status, config data..." format, and
      implement virtio_config_ops to read from that config data.
      
      We use the virtio ring implementation for an efficient Guest <-> Host
      virtqueue mechanism, and the new LHCALL_NOTIFY hypercall to kick the
      host when it changes.
      
      We also use LHCALL_NOTIFY on kernel addresses for very very early
      console output.  We could have another hypercall, but this hack works
      quite well.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      19f1537b