[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] hyperv/synic: Allocate as ram_device
From: |
Roman Kagan |
Subject: |
Re: [PATCH 2/2] hyperv/synic: Allocate as ram_device |
Date: |
Thu, 9 Jan 2020 13:03:52 +0000 |
On Wed, Jan 08, 2020 at 01:53:53PM +0000, Dr. David Alan Gilbert (git) wrote:
> Mark the synic pages as ram_device so that they won't be visible
> to vhost.
Unless I'm misreading the code this also makes them invisible to
migration.
I need some more reading on the ram_device region behavior to better
understand other potential consequences.
Thanks,
Roman.
> Signed-off-by: Dr. David Alan Gilbert <address@hidden>
> ---
> hw/hyperv/hyperv.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/hw/hyperv/hyperv.c b/hw/hyperv/hyperv.c
> index da8ce82725..4de3ec411d 100644
> --- a/hw/hyperv/hyperv.c
> +++ b/hw/hyperv/hyperv.c
> @@ -95,12 +95,14 @@ static void synic_realize(DeviceState *dev, Error **errp)
> msgp_name = g_strdup_printf("synic-%u-msg-page", vp_index);
> eventp_name = g_strdup_printf("synic-%u-event-page", vp_index);
>
> - memory_region_init_ram(&synic->msg_page_mr, obj, msgp_name,
> - sizeof(*synic->msg_page), &error_abort);
> - memory_region_init_ram(&synic->event_page_mr, obj, eventp_name,
> - sizeof(*synic->event_page), &error_abort);
> - synic->msg_page = memory_region_get_ram_ptr(&synic->msg_page_mr);
> - synic->event_page = memory_region_get_ram_ptr(&synic->event_page_mr);
> + synic->msg_page = qemu_memalign(qemu_real_host_page_size,
> + sizeof(*synic->msg_page));
> + synic->event_page = qemu_memalign(qemu_real_host_page_size,
> + sizeof(*synic->event_page));
> + memory_region_init_ram_device_ptr(&synic->msg_page_mr, obj, msgp_name,
> + sizeof(*synic->msg_page), synic->msg_page);
> + memory_region_init_ram_device_ptr(&synic->event_page_mr, obj,
> eventp_name,
> + sizeof(*synic->event_page), synic->event_page);
>
> g_free(msgp_name);
> g_free(eventp_name);
> --
> 2.24.1
>
>
- Re: [PATCH 2/2] hyperv/synic: Allocate as ram_device, (continued)
- Re: [PATCH 2/2] hyperv/synic: Allocate as ram_device, Michael S. Tsirkin, 2020/01/09
- Re: [PATCH 2/2] hyperv/synic: Allocate as ram_device, Dr. David Alan Gilbert, 2020/01/09
- Re: [PATCH 2/2] hyperv/synic: Allocate as ram_device, Michael S. Tsirkin, 2020/01/09
- Re: [PATCH 2/2] hyperv/synic: Allocate as ram_device, Michael S. Tsirkin, 2020/01/09
- Re: [PATCH 2/2] hyperv/synic: Allocate as ram_device, Dr. David Alan Gilbert, 2020/01/09
- Re: [PATCH 2/2] hyperv/synic: Allocate as ram_device, Paolo Bonzini, 2020/01/09
- Re: [PATCH 2/2] hyperv/synic: Allocate as ram_device, Dr. David Alan Gilbert, 2020/01/09
- Re: [PATCH 2/2] hyperv/synic: Allocate as ram_device, Vitaly Kuznetsov, 2020/01/09
Re: [PATCH 2/2] hyperv/synic: Allocate as ram_device,
Roman Kagan <=
Re: [PATCH 0/2] exclude hyperv synic sections from vhost, Vitaly Kuznetsov, 2020/01/08
Re: [PATCH 0/2] exclude hyperv synic sections from vhost, Jason Wang, 2020/01/08
Re: [PATCH 0/2] exclude hyperv synic sections from vhost, Roman Kagan, 2020/01/09