From: Fan Ni Date: Thu, 23 May 2024 17:44:54 +0000 (-0700) Subject: hw/mem/cxl_type3: Allow to release extent superset in QMP interface X-Git-Tag: pull-vmclock-20250108~260^2~56 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c51dca04281f9be6eacdad8fc8f9c7ddc87dcf3c;p=users%2Fdwmw2%2Fqemu.git hw/mem/cxl_type3: Allow to release extent superset in QMP interface Before the change, the QMP interface used for add/release DC extents only allows to release an extent whose DPA range is contained by a single accepted extent in the device. With the change, we relax the constraints. As long as the DPA range of the extent is covered by accepted extents, we allow the release. Tested-by: Svetly Todorov Reviewed-by: Gregory Price Reviewed-by: Jonathan Cameron Signed-off-by: Fan Ni Message-Id: <20240523174651.1089554-15-nifan.cxl@gmail.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index 0d18259ec0..5d4a1276be 100644 --- a/hw/mem/cxl_type3.c +++ b/hw/mem/cxl_type3.c @@ -1947,7 +1947,7 @@ static void qmp_cxl_process_dynamic_capacity_prescriptive(const char *path, "cannot release extent with pending DPA range"); return; } - if (!cxl_extents_contains_dpa_range(&dcd->dc.extents, dpa, len)) { + if (!ct3_test_region_block_backed(dcd, dpa, len)) { error_setg(errp, "cannot release extent with non-existing DPA range"); return;