From b0e624435b6ab395a07fad92abe7f89b5c7a6f47 Mon Sep 17 00:00:00 2001 From: David Hildenbrand Date: Wed, 1 Aug 2018 15:34:44 +0200 Subject: 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 Reviewed-by: Igor Mammedov Acked-by: David Gibson Signed-off-by: David Hildenbrand Message-Id: <20180801133444.11269-5-david@redhat.com> Signed-off-by: Paolo Bonzini --- include/hw/mem/pc-dimm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/hw') diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h index 7b120416d1..b382eb4303 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -79,8 +79,8 @@ typedef struct PCDIMMDeviceClass { Error **errp); } PCDIMMDeviceClass; -void pc_dimm_pre_plug(DeviceState *dev, MachineState *machine, Error **errp); -void pc_dimm_plug(DeviceState *dev, MachineState *machine, uint64_t align, - Error **errp); +void pc_dimm_pre_plug(DeviceState *dev, MachineState *machine, + const uint64_t *legacy_align, Error **errp); +void pc_dimm_plug(DeviceState *dev, MachineState *machine, Error **errp); void pc_dimm_unplug(DeviceState *dev, MachineState *machine); #endif -- cgit v1.2.3