Re: [Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-26 Thread Pankaj Gupta
> > > > > > >> + > > > > > > >> +memory_region_add_subregion(&hpms->mr, addr - hpms->base, > > > > > > >> mr); > > > > > > > missing vmstate registration? > > > > > > > > > > > > Missed this one: To be called by the caller. Important because e.g. > > > > > > for > > > > > > virtio-pmem we don

Re: [Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-25 Thread Igor Mammedov
On Wed, 25 Apr 2018 09:56:49 -0400 (EDT) Pankaj Gupta wrote: > > > > > > > > > > > >> + > > > > > >> +memory_region_add_subregion(&hpms->mr, addr - hpms->base, > > > > > >> mr); > > > > > > missing vmstate registration? > > > > > > > > > > Missed this one: To be called by the cal

Re: [Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-25 Thread Pankaj Gupta
> > > > > > > > > >> + > > > > >> +memory_region_add_subregion(&hpms->mr, addr - hpms->base, mr); > > > > > missing vmstate registration? > > > > > > > > Missed this one: To be called by the caller. Important because e.g. for > > > > virtio-pmem we don't want this (I assume :) ). > > > i

Re: [Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-25 Thread Igor Mammedov
On Wed, 25 Apr 2018 01:45:12 -0400 (EDT) Pankaj Gupta wrote: > > > > > > > > > >> +/* we will need a new memory slot for kvm and vhost */ > > > >> +if (kvm_enabled() && !kvm_has_free_slot(machine)) { > > > >> +error_setg(errp, "hypervisor has no free memory slots left"); >

Re: [Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-24 Thread Pankaj Gupta
> > > > > > >> +/* we will need a new memory slot for kvm and vhost */ > > >> +if (kvm_enabled() && !kvm_has_free_slot(machine)) { > > >> +error_setg(errp, "hypervisor has no free memory slots left"); > > >> +return; > > >> +} > > >> +if (!vhost_has_free_slot())

Re: [Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-24 Thread David Hildenbrand
On 24.04.2018 16:44, Igor Mammedov wrote: > On Tue, 24 Apr 2018 15:41:23 +0200 > David Hildenbrand wrote: > >> On 24.04.2018 15:31, Igor Mammedov wrote: >>> On Mon, 23 Apr 2018 14:52:37 +0200 >>> David Hildenbrand wrote: >>> > >> +/* we will need a new memory slot for kvm and

Re: [Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-24 Thread Igor Mammedov
On Tue, 24 Apr 2018 15:41:23 +0200 David Hildenbrand wrote: > On 24.04.2018 15:31, Igor Mammedov wrote: > > On Mon, 23 Apr 2018 14:52:37 +0200 > > David Hildenbrand wrote: > > > >>> > +/* we will need a new memory slot for kvm and vhost */ > +if (kvm_enabled() && !kvm_h

Re: [Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-24 Thread Igor Mammedov
On Tue, 24 Apr 2018 15:39:30 +0200 David Hildenbrand wrote: > On 24.04.2018 15:28, Igor Mammedov wrote: > > On Mon, 23 Apr 2018 14:44:34 +0200 > > David Hildenbrand wrote: > > > >> On 23.04.2018 14:19, Igor Mammedov wrote: > >>> On Fri, 20 Apr 2018 14:34:56 +0200 > >>> David Hildenbrand wr

Re: [Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-24 Thread David Hildenbrand
On 24.04.2018 15:31, Igor Mammedov wrote: > On Mon, 23 Apr 2018 14:52:37 +0200 > David Hildenbrand wrote: > >>> +/* we will need a new memory slot for kvm and vhost */ +if (kvm_enabled() && !kvm_has_free_slot(machine)) { +error_setg(errp, "hypervisor has no free

Re: [Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-24 Thread David Hildenbrand
On 24.04.2018 15:28, Igor Mammedov wrote: > On Mon, 23 Apr 2018 14:44:34 +0200 > David Hildenbrand wrote: > >> On 23.04.2018 14:19, Igor Mammedov wrote: >>> On Fri, 20 Apr 2018 14:34:56 +0200 >>> David Hildenbrand wrote: > considering v4 queued, I'm dropping mostly nor relevant points at this po

Re: [Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-24 Thread Igor Mammedov
On Mon, 23 Apr 2018 14:52:37 +0200 David Hildenbrand wrote: > > > >> +/* we will need a new memory slot for kvm and vhost */ > >> +if (kvm_enabled() && !kvm_has_free_slot(machine)) { > >> +error_setg(errp, "hypervisor has no free memory slots left"); > >> +return; > >>

Re: [Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-24 Thread Igor Mammedov
On Mon, 23 Apr 2018 14:44:34 +0200 David Hildenbrand wrote: > On 23.04.2018 14:19, Igor Mammedov wrote: > > On Fri, 20 Apr 2018 14:34:56 +0200 > > David Hildenbrand wrote: considering v4 queued, I'm dropping mostly nor relevant points at this point. wrt, virtio I'll elaborate more in reply to Pa

Re: [Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-23 Thread David Hildenbrand
On 23.04.2018 14:19, Igor Mammedov wrote: > On Fri, 20 Apr 2018 14:34:56 +0200 > David Hildenbrand wrote: > >> To be able to reuse MemoryDevice logic from other devices besides >> pc-dimm, factor the relevant stuff out into the MemoryDevice code. >> >> As we don't care about slots for memory devi

Re: [Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-23 Thread David Hildenbrand
> >> +/* we will need a new memory slot for kvm and vhost */ >> +if (kvm_enabled() && !kvm_has_free_slot(machine)) { >> +error_setg(errp, "hypervisor has no free memory slots left"); >> +return; >> +} >> +if (!vhost_has_free_slot()) { >> +error_setg(errp, "

Re: [Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-23 Thread David Hildenbrand
On 23.04.2018 14:19, Igor Mammedov wrote: > On Fri, 20 Apr 2018 14:34:56 +0200 > David Hildenbrand wrote: > >> To be able to reuse MemoryDevice logic from other devices besides >> pc-dimm, factor the relevant stuff out into the MemoryDevice code. >> >> As we don't care about slots for memory devi

Re: [Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-23 Thread Igor Mammedov
On Fri, 20 Apr 2018 14:34:56 +0200 David Hildenbrand wrote: > To be able to reuse MemoryDevice logic from other devices besides > pc-dimm, factor the relevant stuff out into the MemoryDevice code. > > As we don't care about slots for memory devices that are not pc-dimm, > don't factor that part

[Qemu-devel] [PATCH v3 3/3] pc-dimm: factor out address space logic into MemoryDevice code

2018-04-20 Thread David Hildenbrand
To be able to reuse MemoryDevice logic from other devices besides pc-dimm, factor the relevant stuff out into the MemoryDevice code. As we don't care about slots for memory devices that are not pc-dimm, don't factor that part out. Most of this patch just moves checks and logic around. While at it