26b1d1fd | 05-Oct-2018 |
David Hildenbrand <david@redhat.com> |
memory-device: use memory device terminology in error messages
While we rephrased most error messages, we missed these.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Igor M
memory-device: use memory device terminology in error messages
While we rephrased most error messages, we missed these.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20181005092024.14344-6-david@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
show more ...
|
fd3416f5 | 05-Oct-2018 |
David Hildenbrand <david@redhat.com> |
pc-dimm: pass PCDIMMDevice to pc_dimm_.*plug
We're plugging/unplugging a PCDIMMDevice, so directly pass this type instead of a more generic DeviceState.
Reviewed-by: David Gibson <david@gibson.drop
pc-dimm: pass PCDIMMDevice to pc_dimm_.*plug
We're plugging/unplugging a PCDIMMDevice, so directly pass this type instead of a more generic DeviceState.
Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20181005092024.14344-5-david@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
show more ...
|
f99d84b1 | 05-Oct-2018 |
David Hildenbrand <david@redhat.com> |
memory-device: improve "range conflicts" error message
Handle id==NULL better and indicate that we are dealing with memory devices.
Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <
memory-device: improve "range conflicts" error message
Handle id==NULL better and indicate that we are dealing with memory devices.
Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20181005092024.14344-4-david@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
show more ...
|
ac1b3375 | 05-Oct-2018 |
David Hildenbrand <david@redhat.com> |
memory-device: fix error message when hinted address is too small
The "at" should actually be a "before". if (new_addr < address_space_start) -> "can't add memory ... before... $address_spa
memory-device: fix error message when hinted address is too small
The "at" should actually be a "before". if (new_addr < address_space_start) -> "can't add memory ... before... $address_space_start"
So it looks similar to the other check } else if ((new_addr + size) > address_space_end) -> "can't add memory ... beyond..."
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20181005092024.14344-3-david@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
show more ...
|
b0e62443 | 01-Aug-2018 |
David Hildenbrand <david@redhat.com> |
pc-dimm: assign and verify the "addr" property during pre_plug
We can assign and verify the address before realizing and trying to plug. reading/writing the address property should never fail for DI
pc-dimm: assign and verify the "addr" property during pre_plug
We can assign and verify the address before realizing and trying to plug. reading/writing the address property should never fail for DIMMs, so let's reduce error handling a bit by using &error_abort. Getting access to the memory region now might however fail. So forward errors from get_memory_region() properly.
As all memory devices should use the alignment of the underlying memory region for guest physical address asignment, do detection of the alignment in pc_dimm_pre_plug(), but allow pc.c to overwrite the alignment for compatibility handling.
Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180801133444.11269-5-david@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
f0b7bca6 | 19-Jun-2018 |
David Hildenbrand <david@redhat.com> |
pc-dimm: get_memory_region() will not fail after realize
Let's try to reduce error handling a bit. In the plug/unplug case, the device was realized and therefore we can assume that getting access to
pc-dimm: get_memory_region() will not fail after realize
Let's try to reduce error handling a bit. In the plug/unplug case, the device was realized and therefore we can assume that getting access to the memory region will not fail.
For get_vmstate_memory_region() this is already handled that way. Document both cases.
Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180619134141.29478-13-david@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
a4659a8e | 19-Jun-2018 |
David Hildenbrand <david@redhat.com> |
nvdimm: make get_memory_region() perform checks and initialization
We might get a call to get_memory_region() before the device has been realized. We should return a consistent value, as the return
nvdimm: make get_memory_region() perform checks and initialization
We might get a call to get_memory_region() before the device has been realized. We should return a consistent value, as the return value will e.g. later on be used in the pre_plug handler.
To avoid duplicating too much code, factor the initialization and checks out into a helper function.
Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180619134141.29478-12-david@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
eb7fd4d0 | 19-Jun-2018 |
David Hildenbrand <david@redhat.com> |
nvdimm: convert nvdimm_mr into a pointer
This way we can easily check if the region has already been inititalized without having to rely on the size of an uninitialized region being 0.
Free the reg
nvdimm: convert nvdimm_mr into a pointer
This way we can easily check if the region has already been inititalized without having to rely on the size of an uninitialized region being 0.
Free the region in nvdimm_finalize() and not in unrealize() as we will allow to create the region before realization in following patches.
Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180619134141.29478-11-david@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
5d10a0e1 | 19-Jun-2018 |
David Hildenbrand <david@redhat.com> |
nvdimm: convert "unarmed" into a static property
We don't allow to modify it after realization. So we can simply turn it into a static property.
Reviewed-by: David Gibson <david@gibson.dropbear.id.
nvdimm: convert "unarmed" into a static property
We don't allow to modify it after realization. So we can simply turn it into a static property.
Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180619134141.29478-10-david@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
a57d1911 | 19-Jun-2018 |
David Hildenbrand <david@redhat.com> |
pc-dimm: merge get_(vmstate_)memory_region()
Importantly, get_vmstate_memory_region() should also fail with a proper error if called before the device is realized. For a PCDIMM, both functions are t
pc-dimm: merge get_(vmstate_)memory_region()
Importantly, get_vmstate_memory_region() should also fail with a proper error if called before the device is realized. For a PCDIMM, both functions are to return the same thing, so share the implementation.
All current users are called after the device has been realized, so we can expect the calls to succeed.
Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180619134141.29478-9-david@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
7943e97b | 19-Jun-2018 |
David Hildenbrand <david@redhat.com> |
hostmem: drop error variable from host_memory_backend_get_memory()
Unused, so let's remove it.
Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Igor Mammedov <imammedo@redhat.co
hostmem: drop error variable from host_memory_backend_get_memory()
Unused, so let's remove it.
Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180619134141.29478-8-david@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
4ab56d04 | 19-Jun-2018 |
David Hildenbrand <david@redhat.com> |
nvdimm: no need to overwrite get_vmstate_memory_region()
Our parent class (PC_DIMM) provides exactly the same function.
Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Igor Mam
nvdimm: no need to overwrite get_vmstate_memory_region()
Our parent class (PC_DIMM) provides exactly the same function.
Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180619134141.29478-7-david@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
9995c759 | 19-Jun-2018 |
David Hildenbrand <david@redhat.com> |
pc-dimm: remove pc_dimm_get_free_slot() from header
Not used outside of pc-dimm.c and there shouldn't be other users. If other devices (e.g. memory devices) ever have to also use slots, then we will
pc-dimm: remove pc_dimm_get_free_slot() from header
Not used outside of pc-dimm.c and there shouldn't be other users. If other devices (e.g. memory devices) ever have to also use slots, then we will have to factor this out.
Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180619134141.29478-5-david@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
284878ee | 19-Jun-2018 |
David Hildenbrand <david@redhat.com> |
pc-dimm: rename pc_dimm_memory_* to pc_dimm_*
Let's rename it to make it look more consistent.
Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.a
pc-dimm: rename pc_dimm_memory_* to pc_dimm_*
Let's rename it to make it look more consistent.
Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180619134141.29478-4-david@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
18d11dc9 | 23-Apr-2018 |
David Hildenbrand <david@redhat.com> |
pc-dimm: move actual plug/unplug of a memory region to MemoryDevice
Registering the memory region for migration has do be done by the owner. There could be cases, where we don't want to migrate the
pc-dimm: move actual plug/unplug of a memory region to MemoryDevice
Registering the memory region for migration has do be done by the owner. There could be cases, where we don't want to migrate the memory.
Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180423165126.15441-8-david@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
show more ...
|
1b6d6af2 | 23-Apr-2018 |
David Hildenbrand <david@redhat.com> |
pc-dimm: factor out capacity and slot checks into MemoryDevice
Move the checks into memory_device_get_free_addr(). This will check before doing any calculations if we have KVM/vhost slots left and i
pc-dimm: factor out capacity and slot checks into MemoryDevice
Move the checks into memory_device_get_free_addr(). This will check before doing any calculations if we have KVM/vhost slots left and if the total region size would be exceeded.
Of course, while at it, make it independent of pc-dimm code.
Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180423165126.15441-7-david@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
show more ...
|
bb0831bd | 23-Apr-2018 |
David Hildenbrand <david@redhat.com> |
pc-dimm: factor out address search into MemoryDevice code
This mainly moves code, but does a handfull of optimizations: - We pass the machine instead of the address space properties - We check the h
pc-dimm: factor out address search into MemoryDevice code
This mainly moves code, but does a handfull of optimizations: - We pass the machine instead of the address space properties - We check the hinted address directly and handle fragmented memory better - We make the search independent of pc-dimm
Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180423165126.15441-6-david@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
show more ...
|
bd6c3e4a | 23-Apr-2018 |
David Hildenbrand <david@redhat.com> |
pc-dimm: pass in the machine and to the MemoryHotplugState
We use the machine internally either way, so let's just pass it in then.
Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <
pc-dimm: pass in the machine and to the MemoryHotplugState
We use the machine internally either way, so let's just pass it in then.
Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180423165126.15441-5-david@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
show more ...
|