hw/mem/cxl_type3: Add DPA range validation for accesses to DC regions
authorFan Ni <fan.ni@samsung.com>
Thu, 23 May 2024 17:44:52 +0000 (10:44 -0700)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 1 Jul 2024 21:16:04 +0000 (17:16 -0400)
commite4180db4e63b904183374c6e7ec07f66aa0decde
treeec906cae5e61c977e43f6840af434d6ea2555c40
parentd0b9b28a5b9f1e3d22b508f4f05d903a4b443e38
hw/mem/cxl_type3: Add DPA range validation for accesses to DC regions

All DPA ranges in the DC regions are invalid to access until an extent
covering the range has been successfully accepted by the host. A bitmap
is added to each region to record whether a DC block in the region has
been backed by a DC extent. Each bit in the bitmap represents a DC block.
When a DC extent is accepted, all the bits representing the blocks in the
extent are set, which will be cleared when the extent is released.

Tested-by: Svetly Todorov <svetly.todorov@memverge.com>
Reviewed-by: Gregory Price <gregory.price@memverge.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Fan Ni <fan.ni@samsung.com>
Message-Id: <20240523174651.1089554-13-nifan.cxl@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/cxl/cxl-mailbox-utils.c
hw/mem/cxl_type3.c
include/hw/cxl/cxl_device.h