[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 70/86] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e8
From: |
Michael S. Tsirkin |
Subject: |
[PULL 70/86] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios |
Date: |
Mon, 31 Oct 2022 08:54:01 -0400 |
From: Gregory Price <gourry.memverge@gmail.com>
Early-boot e820 records will be inserted by the bios/efi/early boot
software and be reported to the kernel via insert_resource. Later, when
CXL drivers iterate through the regions again, they will insert another
resource and make the RESERVED memory area a child.
This RESERVED memory area causes the memory region to become unusable,
and as a result attempting to create memory regions with
`cxl create-region ...`
Will fail due to the RESERVED area intersecting with the CXL window.
During boot the following traceback is observed:
0xffffffff81101650 in insert_resource_expand_to_fit ()
0xffffffff83d964c5 in e820__reserve_resources_late ()
0xffffffff83e03210 in pcibios_resource_survey ()
0xffffffff83e04f4a in pcibios_init ()
Which produces a call to reserve the CFMWS area:
(gdb) p *new
$54 = {start = 0x290000000, end = 0x2cfffffff, name = "Reserved",
flags = 0x200, desc = 0x7, parent = 0x0, sibling = 0x0,
child = 0x0}
Later the Kernel parses ACPI tables and reserves the exact same area as
the CXL Fixed Memory Window:
0xffffffff811016a4 in insert_resource_conflict ()
insert_resource ()
0xffffffff81a81389 in cxl_parse_cfmws ()
0xffffffff818c4a81 in call_handler ()
acpi_parse_entries_array ()
(gdb) p/x *new
$59 = {start = 0x290000000, end = 0x2cfffffff, name = "CXL Window 0",
flags = 0x200, desc = 0x0, parent = 0x0, sibling = 0x0,
child = 0x0}
This produces the following output in /proc/iomem:
590000000-68fffffff : CXL Window 0
590000000-68fffffff : Reserved
This reserved area causes `get_free_mem_region()` to fail due to a check
against `__region_intersects()`. Due to this reserved area, the
intersect check will only ever return REGION_INTERSECTS, which causes
`cxl create-region` to always fail.
Signed-off-by: Gregory Price <gregory.price@memverge.com>
Message-Id: <20221026205912.8579-1-gregory.price@memverge.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/i386/pc.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 3e86083db3..a3dda50912 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1062,7 +1062,6 @@ void pc_memory_init(PCMachineState *pcms,
hwaddr cxl_size = MiB;
cxl_base = pc_get_cxl_range_start(pcms);
- e820_add_entry(cxl_base, cxl_size, E820_RESERVED);
memory_region_init(mr, OBJECT(machine), "cxl_host_reg", cxl_size);
memory_region_add_subregion(system_memory, cxl_base, mr);
cxl_resv_end = cxl_base + cxl_size;
@@ -1078,7 +1077,6 @@ void pc_memory_init(PCMachineState *pcms,
memory_region_init_io(&fw->mr, OBJECT(machine), &cfmws_ops, fw,
"cxl-fixed-memory-region", fw->size);
memory_region_add_subregion(system_memory, fw->base, &fw->mr);
- e820_add_entry(fw->base, fw->size, E820_RESERVED);
cxl_fmw_base += fw->size;
cxl_resv_end = cxl_fmw_base;
}
--
MST
- [PULL 59/86] acpi: add get_dev_aml_func() helper, (continued)
- [PULL 59/86] acpi: add get_dev_aml_func() helper, Michael S. Tsirkin, 2022/10/31
- [PULL 60/86] acpi: enumerate SMB bridge automatically along with other PCI devices, Michael S. Tsirkin, 2022/10/31
- [PULL 61/86] tests: acpi: update expected blobs, Michael S. Tsirkin, 2022/10/31
- [PULL 62/86] tests: acpi: pc/q35 whitelist DSDT before \_GPE cleanup, Michael S. Tsirkin, 2022/10/31
- [PULL 63/86] acpi: pc/35: sanitize _GPE declaration order, Michael S. Tsirkin, 2022/10/31
- [PULL 65/86] hw/acpi/erst.c: Fix memory handling issues, Michael S. Tsirkin, 2022/10/31
- [PULL 64/86] tests: acpi: update expected blobs, Michael S. Tsirkin, 2022/10/31
- [PULL 66/86] MAINTAINERS: Add qapi/virtio.json to section "virtio", Michael S. Tsirkin, 2022/10/31
- [PULL 67/86] qpci_device_enable: Allow for command bits hardwired to 0, Michael S. Tsirkin, 2022/10/31
- [PULL 68/86] hw/ide/piix: Ignore writes of hardwired PCI command register bits, Michael S. Tsirkin, 2022/10/31
- [PULL 70/86] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios,
Michael S. Tsirkin <=
- [PULL 69/86] msix: Assert that specified vector is in range, Michael S. Tsirkin, 2022/10/31
- [PULL 72/86] hw/i386/acpi-build: Resolve redundant attribute, Michael S. Tsirkin, 2022/10/31
- [PULL 71/86] hw/i386/acpi-build: Remove unused struct, Michael S. Tsirkin, 2022/10/31
- [PULL 75/86] tests: acpi: add and whitelist *.hmat-noinitiator expected blobs, Michael S. Tsirkin, 2022/10/31
- [PULL 73/86] hw/i386/acpi-build: Resolve north rather than south bridges, Michael S. Tsirkin, 2022/10/31
- [PULL 74/86] hmat acpi: Don't require initiator value in -numa, Michael S. Tsirkin, 2022/10/31
- [PULL 76/86] tests: acpi: q35: add test for hmat nodes without initiators, Michael S. Tsirkin, 2022/10/31
- [PULL 77/86] tests: acpi: q35: update expected blobs *.hmat-noinitiators expected HMAT:, Michael S. Tsirkin, 2022/10/31
- [PULL 78/86] tests: Add HMAT AArch64/virt empty table files, Michael S. Tsirkin, 2022/10/31
- [PULL 79/86] hw/arm/virt: Enable HMAT on arm virt machine, Michael S. Tsirkin, 2022/10/31