All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Cam Macdonell <cam@cs.ualberta.ca>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [PATCH RFC] Mark a device as non-migratable
Date: Wed, 16 Jun 2010 07:34:00 -0500	[thread overview]
Message-ID: <4C18C4B8.6060305@codemonkey.ws> (raw)
In-Reply-To: <AANLkTinM3eopY7MXU4X17LGW5z2TbUqyltKt5_O4lprT@mail.gmail.com>

On 06/16/2010 12:05 AM, Cam Macdonell wrote:
> On Tue, Jun 15, 2010 at 4:33 PM, Anthony Liguori<anthony@codemonkey.ws>  wrote:
>    
>> On 06/15/2010 05:26 PM, Cam Macdonell wrote:
>>      
>>> On Tue, Jun 15, 2010 at 10:32 AM, Anthony Liguori<anthony@codemonkey.ws>
>>>   wrote:
>>>
>>>        
>>>> On 06/15/2010 11:16 AM, Cam Macdonell wrote:
>>>>
>>>>          
>>>>> How does this look for marking the device as non-migratable?  It adds a
>>>>> field
>>>>> 'no_migrate' to the SaveStateEntry and tests for it in vmstate_save.
>>>>>   This
>>>>> would
>>>>> replace anything that touches memory.
>>>>>
>>>>> Cam
>>>>>
>>>>> ---
>>>>>   hw/hw.h  |    1 +
>>>>>   savevm.c |   32 +++++++++++++++++++++++++++++---
>>>>>   2 files changed, 30 insertions(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/hw/hw.h b/hw/hw.h
>>>>> index d78d814..7c93f08 100644
>>>>> --- a/hw/hw.h
>>>>> +++ b/hw/hw.h
>>>>> @@ -263,6 +263,7 @@ int register_savevm_live(const char *idstr,
>>>>>                            void *opaque);
>>>>>
>>>>>   void unregister_savevm(const char *idstr, void *opaque);
>>>>> +void mark_no_migrate(const char *idstr, void *opaque);
>>>>>
>>>>>
>>>>>            
>>>> I'm not thrilled with the name but the functionality is spot on.  I lack
>>>> the
>>>> creativity to offer a better name suggestion :-)
>>>>
>>>> Regards,
>>>>
>>>> Anthony Liguori
>>>>
>>>>          
>>> Hmmm, in working on this it seems that the memory (from
>>> qemu_ram_map()) is still attached even when the device is removed
>>> (which causes migration to fail because there is an unexpected
>>> memory).
>>>
>>> Is something like cpu_unregister_physical_memory()/qemu_ram_free() needed?
>>>
>>>        
>> Yes.  You need to unregister any memory that you have registered upon device
>> removal.
>>      
> Is there an established way to achieve this?  I can't seem find
> another device that unregisters memory registered with
> cpu_register_physical_memory().  Is something like
> cpu_unregister_physical_memory() needed?
>    

cpu_register_physical_memory(IO_MEM_UNASSIGNED).

If you look at pci.c, you'll see that it automatically unregisters any 
mapped io regions on remove.

Regards,

Anthony Liguori

> Thanks,
> Cam
>
>    
>> Regards,
>>
>> Anthony Liguori
>>
>>      
>>> Cam
>>>
>>>
>>>        
>>
>>      

  reply	other threads:[~2010-06-16 12:34 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-04 21:45 [PATCH v6 0/6] Inter-VM Shared Memory Device with migration support Cam Macdonell
2010-06-04 21:45 ` [Qemu-devel] " Cam Macdonell
2010-06-04 21:45 ` [PATCH v6 1/6] Device specification for shared memory PCI device Cam Macdonell
2010-06-04 21:45   ` [Qemu-devel] " Cam Macdonell
2010-06-04 21:45   ` [PATCH v6 2/6] Add function to assign ioeventfd to MMIO Cam Macdonell
2010-06-04 21:45     ` [Qemu-devel] " Cam Macdonell
2010-06-04 21:45     ` [PATCH v6 3/6] Change phys_ram_dirty to phys_ram_status Cam Macdonell
2010-06-04 21:45       ` [Qemu-devel] " Cam Macdonell
2010-06-04 21:45       ` [PATCH v6 4/6] Add support for marking memory to not be migrated. On migration, memory is checked for the NO_MIGRATION_FLAG Cam Macdonell
2010-06-04 21:45         ` [Qemu-devel] " Cam Macdonell
2010-06-04 21:45         ` [PATCH v6 5/6] Inter-VM shared memory PCI device Cam Macdonell
2010-06-04 21:45           ` [Qemu-devel] " Cam Macdonell
2010-06-04 21:45           ` [PATCH v6 6/6] the stand-alone shared memory server for inter-VM shared memory Cam Macdonell
2010-06-04 21:45             ` [Qemu-devel] " Cam Macdonell
2010-06-04 21:47             ` [PATCH v6] Shared memory uio_pci driver Cam Macdonell
2010-06-04 21:47               ` [Qemu-devel] " Cam Macdonell
2010-06-14 15:53             ` [Qemu-devel] [PATCH v6 6/6] the stand-alone shared memory server for inter-VM shared memory Anthony Liguori
2010-06-14 22:03               ` Cam Macdonell
2010-06-23 13:12               ` Avi Kivity
2010-06-23 21:54                 ` Anthony Liguori
2010-06-05  9:44           ` [Qemu-devel] [PATCH v6 5/6] Inter-VM shared memory PCI device Blue Swirl
2010-06-06 15:02             ` Avi Kivity
2010-06-07 16:41             ` Cam Macdonell
2010-06-09 20:12               ` Blue Swirl
2010-06-14 15:51         ` [Qemu-devel] [PATCH v6 4/6] Add support for marking memory to not be migrated. On migration, memory is checked for the NO_MIGRATION_FLAG Anthony Liguori
2010-06-14 16:08           ` Cam Macdonell
2010-06-14 16:15             ` Anthony Liguori
2010-06-15 16:16               ` [PATCH RFC] Mark a device as non-migratable Cam Macdonell
2010-06-15 16:16                 ` [Qemu-devel] " Cam Macdonell
2010-06-15 16:32                 ` Anthony Liguori
2010-06-15 16:32                   ` [Qemu-devel] " Anthony Liguori
2010-06-15 17:45                   ` Markus Armbruster
2010-06-15 22:26                   ` Cam Macdonell
2010-06-15 22:26                     ` [Qemu-devel] " Cam Macdonell
2010-06-15 22:33                     ` Anthony Liguori
2010-06-16  5:05                       ` Cam Macdonell
2010-06-16 12:34                         ` Anthony Liguori [this message]
2010-06-17  4:18                           ` Cam Macdonell
2010-06-11 22:03 ` [PATCH v6 0/6] Inter-VM Shared Memory Device with migration support Cam Macdonell
2010-06-11 22:03   ` [Qemu-devel] " Cam Macdonell
2010-06-14 15:54   ` Anthony Liguori
2010-06-14 15:54     ` Anthony Liguori

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=4C18C4B8.6060305@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=cam@cs.ualberta.ca \
    --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.