All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Andrea Arcangeli <aarcange@redhat.com>
Cc: Anthony Liguori <anthony@codemonkey.ws>,
	Gerd Hoffmann <kraxel@redhat.com>,
	qemu-devel@nongnu.org, kvm@vger.kernel.org, chrisw@redhat.com
Subject: Re: [PATCH 2 of 5] add can_dma/post_dma for direct IO
Date: Sun, 14 Dec 2008 21:59:29 +0200	[thread overview]
Message-ID: <494565A1.6030306@redhat.com> (raw)
In-Reply-To: <20081214171558.GH30537@random.random>

Andrea Arcangeli wrote:
> On Sun, Dec 14, 2008 at 07:01:38PM +0200, Avi Kivity wrote:
>   
>> Actually, with Xen, RAM may be unmapped due do Xen limitations when qemu 
>> runs on dom0 mode.  But I think map/unmap makes sense even disregarding 
>>     
>
> I realize xen 32bit has issues... Qemu/KVM 32bit also has the same
> issues but there's no point in 2009 (that's when this stuff could go
> productive) in trying to run guests with >2G of ram on a 32bit
> host. The issues emerges (I guess with xen too) in trying to run those
> obsolete hardware configurations. Even the atom and extremely low
> power athlon have 64bit capability, and on embedded that runs a real
> 32bit cpu I can't see how somebody would want to run a >2G guest.
>   

kvm and Xen actually have different issues for 32-bit.  For kvm, 
supporting >2G on 32-bits is possible but messy and pointless, so we 
chose not to do it.  For Xen, this is a critical performance issue as 
64-bit userspace in pv guests is quite slow.  So dom0 runs as a 32-bit guest

Newer Xen shouldn't have this problem though; it runs qemu in kernel 
mode in a dedicated 64-bit domain.

>> Xen:  if we add memory hotunplug, we need to make sure we don't unplug 
>> memory that has pending dma operations on it.  map/unmap gives us the 
>> opportunity to refcount memory slots.
>>     
>
> So memory hotunplug here is considered differently than the real
> memory hotplug emulation that simulates removing dimm on the
> hardware. This is just the xen trick to handle >4G guest on a 32bit
> address space? Well that's just the thing I'm not interested to
> support. When 64bit wasn't mainstream it made some sense, these days
> it's good enough if we can boot any guest OS (including 64bit ones) on
> a 32bit build, but trying to run guests OS with >2G of ram doesn't
> look useful.
>   

Leaving Xen aside, memory hotunplug requires that we tell the memory 
when it's used and when it isn't.

>> We can't get all dma to stop during hotunplug, since net rx operations are 
>> long-running (infinite if there is no activity on the link).
>>
>> IMO, we do want map/unmap, but this would be just a rename of can_dma and 
>> friends, and wouldn't have at this time any additional functionality.  
>> Bouncing has to happen where we have the ability to schedule the actual 
>> operation, and that's clearly not map/unmap.
>>     
>
> It would be a bit more than a rename, also keep in mind that in the
> longer term as said we need to build the iovec in the exec.c path,
> it's not enough to return a void *, I like to support a not 1:1 flat
> space to avoid wasting host virtual address space with guest memory
> holes. But that's about it, guest memory has to be always mapped, just
> not with a 1:1 mapping, and surely not with a per-page array that
> translates each page physical address to a host virtual address, but
> with ranges. So this map thing that returns a 'void *' won't be there
> for long even if I rename.
>   

If it returns an iovec, still that doesn't change how it works.  I like 
the symmetry of map()/unmap() and the lock/unlock semantics (like 
kmap_atomic/kunmap_atomic and a myriad other get/put pairs).

[There's actually a language that supports this idiom, but that's a 
different flamewar]

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.


  reply	other threads:[~2008-12-14 19:59 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-12 18:16 [PATCH 0 of 5] dma api v3 Andrea Arcangeli
2008-12-12 18:16 ` [PATCH 1 of 5] fix cpu_physical_memory len Andrea Arcangeli
2008-12-12 19:06   ` Anthony Liguori
2008-12-12 19:26     ` Andrea Arcangeli
2008-12-12 18:16 ` [PATCH 2 of 5] add can_dma/post_dma for direct IO Andrea Arcangeli
2008-12-12 19:00   ` [Qemu-devel] " Blue Swirl
2008-12-12 19:18     ` Anthony Liguori
2008-12-12 20:05       ` Blue Swirl
2008-12-12 20:10         ` Anthony Liguori
2008-12-12 19:15   ` Anthony Liguori
2008-12-12 19:37     ` Andrea Arcangeli
2008-12-12 20:09       ` Anthony Liguori
2008-12-12 20:25       ` Gerd Hoffmann
2008-12-12 19:39     ` Anthony Liguori
2008-12-13  9:22       ` [Qemu-devel] " Avi Kivity
2008-12-13 16:45         ` Anthony Liguori
2008-12-13 19:48           ` Avi Kivity
2008-12-13 21:07             ` Anthony Liguori
2008-12-14  6:03               ` Avi Kivity
2008-12-14 19:10                 ` Anthony Liguori
2008-12-14 19:49                   ` Avi Kivity
2008-12-14 23:08                     ` Anthony Liguori
2008-12-15  0:57                       ` Paul Brook
2008-12-15  2:09                         ` Anthony Liguori
2008-12-15  6:23                           ` Avi Kivity
2008-12-15 18:35                       ` Blue Swirl
2008-12-15 22:06                         ` Anthony Liguori
2008-12-16  9:41                           ` Avi Kivity
2008-12-16 16:55                             ` Blue Swirl
2008-12-16 17:09                               ` Avi Kivity
2008-12-16 17:48                                 ` Anthony Liguori
2008-12-16 18:11                                   ` Blue Swirl
2008-12-16 15:57                           ` Blue Swirl
2008-12-16 16:29                             ` Paul Brook
2008-12-16 16:35                               ` Blue Swirl
2008-12-14 17:30       ` Jamie Lokier
2008-12-13 14:39     ` Andrea Arcangeli
2008-12-13 16:46       ` Anthony Liguori
2008-12-13 16:53         ` Andrea Arcangeli
2008-12-13 21:11           ` Anthony Liguori
2008-12-14 16:47             ` Andrea Arcangeli
2008-12-14 17:01               ` Avi Kivity
2008-12-14 17:15                 ` Andrea Arcangeli
2008-12-14 19:59                   ` Avi Kivity [this message]
2008-12-22 16:44                     ` [Qemu-devel] " Ian Jackson
2008-12-22 19:44                       ` Avi Kivity
2008-12-23  0:03                         ` Thiemo Seufer
2008-12-23  1:02                           ` Andrea Arcangeli
2008-12-23 17:31                           ` Avi Kivity
2008-12-22 19:46                       ` Avi Kivity
2009-01-05 10:27                         ` Gerd Hoffmann
2008-12-13 22:47     ` Anthony Liguori
2008-12-14  6:07       ` Avi Kivity
2008-12-12 18:16 ` [PATCH 3 of 5] rename dma.c to isa_dma.c Andrea Arcangeli
2008-12-12 18:16 ` [PATCH 4 of 5] dma api Andrea Arcangeli
2008-12-12 18:55   ` [Qemu-devel] " Blue Swirl
2008-12-12 18:16 ` [PATCH 5 of 5] bdrv_aio_readv/writev Andrea Arcangeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=494565A1.6030306@redhat.com \
    --to=avi@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=chrisw@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.