]> git.proxmox.com Git - mirror_qemu.git/commit - hw/i386/pc.c
pc-dimm: assign and verify the "addr" property during pre_plug
authorDavid Hildenbrand <david@redhat.com>
Wed, 1 Aug 2018 13:34:44 +0000 (15:34 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Aug 2018 16:46:25 +0000 (18:46 +0200)
commitb0e624435b6ab395a07fad92abe7f89b5c7a6f47
tree601f75a22a4d5141fe94e77e9a8269123d856528
parent57f0b73cf80281cfe4d4186564ccaf4141d39f0f
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>
hw/i386/pc.c
hw/mem/pc-dimm.c
hw/ppc/spapr.c
include/hw/mem/pc-dimm.h