[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 37/65] mem/cxl_type3: Fix overlapping region validation error
From: |
Michael S. Tsirkin |
Subject: |
[PULL 37/65] mem/cxl_type3: Fix overlapping region validation error |
Date: |
Mon, 4 Nov 2024 16:08:01 -0500 |
From: Yao Xingtao <yaoxt.fnst@fujitsu.com>
When injecting a new poisoned region through qmp_cxl_inject_poison(),
the newly injected region should not overlap with existing poisoned
regions.
The current validation method does not consider the following
overlapping region:
┌───┬───────┬───┐
│a │ b(a) │a │
└───┴───────┴───┘
(a is a newly added region, b is an existing region, and b is a
subregion of a)
Fixes: 9547754f40ee ("hw/cxl: QMP based poison injection support")
Signed-off-by: Yao Xingtao <yaoxt.fnst@fujitsu.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20241014121902.2146424-4-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/mem/cxl_type3.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c
index 44d491d8f6..16c60b9b0d 100644
--- a/hw/mem/cxl_type3.c
+++ b/hw/mem/cxl_type3.c
@@ -1381,9 +1381,7 @@ void qmp_cxl_inject_poison(const char *path, uint64_t
start, uint64_t length,
ct3d = CXL_TYPE3(obj);
QLIST_FOREACH(p, &ct3d->poison_list, node) {
- if (((start >= p->start) && (start < p->start + p->length)) ||
- ((start + length > p->start) &&
- (start + length <= p->start + p->length))) {
+ if ((start < p->start + p->length) && (start + length > p->start)) {
error_setg(errp,
"Overlap with existing poisoned region not supported");
return;
--
MST
- [PULL 28/65] amd_iommu: Rename variable mmio to mr_mmio, (continued)
- [PULL 34/65] virtio/vhost-user: fix qemu abort when hotunplug vhost-user-net device, Michael S. Tsirkin, 2024/11/04
- [PULL 33/65] virtio-pci: fix memory_region_find for VirtIOPCIRegion's MR, Michael S. Tsirkin, 2024/11/04
- [PULL 35/65] hw/cxl: Fix uint32 overflow cxl-mailbox-utils.c, Michael S. Tsirkin, 2024/11/04
- [PULL 37/65] mem/cxl_type3: Fix overlapping region validation error,
Michael S. Tsirkin <=
- [PULL 38/65] hw/mem/cxl_type3: Fix More flag setting for dynamic capacity event records, Michael S. Tsirkin, 2024/11/04
- [PULL 39/65] hw/cxl/cxl-mailbox-utils: Fix for device DDR5 ECS control feature tables, Michael S. Tsirkin, 2024/11/04
- [PULL 40/65] hw/cxl: Fix indent of structure member, Michael S. Tsirkin, 2024/11/04
- [PULL 36/65] hw/cxl: Fix background completion percentage calculation, Michael S. Tsirkin, 2024/11/04
- [PULL 41/65] hw/pci-bridge: Make pxb_dev_realize_common() return if it succeeded, Michael S. Tsirkin, 2024/11/04
- [PULL 42/65] vhost-user: fix shared object return values, Michael S. Tsirkin, 2024/11/04
- [PULL 44/65] pcie: enable Extended tag field support, Michael S. Tsirkin, 2024/11/04
- [PULL 45/65] cxl/cxl-mailbox-utils: Fix size check for cmd_firmware_update_get_info, Michael S. Tsirkin, 2024/11/04
- [PULL 46/65] hw/cxl/cxl-mailbox-util: Fix output buffer index update when retrieving DC extents, Michael S. Tsirkin, 2024/11/04
- [PULL 47/65] hw/cxl: Check size of input data to dynamic capacity mailbox commands, Michael S. Tsirkin, 2024/11/04