[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 72/78] hw/i386/cxl: ensure maxram is greater than ram size for
|
From: |
Michael S. Tsirkin |
|
Subject: |
[PULL v2 72/78] hw/i386/cxl: ensure maxram is greater than ram size for calculating cxl range |
|
Date: |
Thu, 19 Oct 2023 14:24:23 -0400 |
From: Ani Sinha <anisinha@redhat.com>
pc_get_device_memory_range() finds the device memory size by calculating the
difference between maxram and ram sizes. This calculation makes sense only when
maxram is greater than the ram size. Make sure we check for that before calling
pc_get_device_memory_range().
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Message-Id: <20231011105335.42296-1-anisinha@redhat.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/i386/pc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 6293f57a0c..dbaefa7617 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -781,10 +781,12 @@ static void pc_get_device_memory_range(PCMachineState
*pcms,
static uint64_t pc_get_cxl_range_start(PCMachineState *pcms)
{
PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
+ MachineState *ms = MACHINE(pcms);
hwaddr cxl_base;
ram_addr_t size;
- if (pcmc->has_reserved_memory) {
+ if (pcmc->has_reserved_memory &&
+ (ms->ram_size < ms->maxram_size)) {
pc_get_device_memory_range(pcms, &cxl_base, &size);
cxl_base += size;
} else {
--
MST
- [PULL v2 71/78] vhost-user: fix lost reconnect, (continued)
- [PULL v2 71/78] vhost-user: fix lost reconnect, Michael S. Tsirkin, 2023/10/19
- [PULL v2 69/78] vhost-user-scsi: support reconnect to backend, Michael S. Tsirkin, 2023/10/19
- [PULL v2 73/78] tests/acpi: Allow update of DSDT.cxl, Michael S. Tsirkin, 2023/10/19
- [PULL v2 39/78] hw/i386/pc_piix: Allow for setting properties before realizing PIIX3 south bridge, Michael S. Tsirkin, 2023/10/19
- [PULL v2 35/78] hw/i386/acpi-build: Remove build-time assertion on PIIX/ICH9 reset registers being identical, Michael S. Tsirkin, 2023/10/19
- [PULL v2 78/78] intel-iommu: Report interrupt remapping faults, fix return value, Michael S. Tsirkin, 2023/10/19
- [PULL v2 47/78] hw/i386/pc: Wire RTC ISA IRQs in south bridges, Michael S. Tsirkin, 2023/10/19
- [PULL v2 57/78] hw/isa/piix: Allow for optional PIC creation in PIIX3, Michael S. Tsirkin, 2023/10/19
- [PULL v2 61/78] hw/isa/piix: Reuse PIIX3 base class' realize method in PIIX4, Michael S. Tsirkin, 2023/10/19
- [PULL v2 58/78] hw/isa/piix: Allow for optional PIT creation in PIIX3, Michael S. Tsirkin, 2023/10/19
- [PULL v2 72/78] hw/i386/cxl: ensure maxram is greater than ram size for calculating cxl range,
Michael S. Tsirkin <=
- [PULL v2 70/78] vhost-user-scsi: start vhost when guest kicks, Michael S. Tsirkin, 2023/10/19
- [PULL v2 18/78] tests: bios-tables-test: Prepare the ACPI table change for smbios type4 thread count test, Michael S. Tsirkin, 2023/10/19
- [PULL v2 29/78] vhost-user: allow "vhost_set_vring" to wait for a reply, Michael S. Tsirkin, 2023/10/19
- [PULL v2 24/78] vhost-user: strip superfluous whitespace, Michael S. Tsirkin, 2023/10/19
- [PULL v2 64/78] hw/isa/piix: Resolve duplicate code regarding PCI interrupt wiring, Michael S. Tsirkin, 2023/10/19
- [PULL v2 68/78] vhost: move and rename the conn retry times, Michael S. Tsirkin, 2023/10/19
- [PULL v2 55/78] hw/isa/piix4: Reuse struct PIIXState from PIIX3, Michael S. Tsirkin, 2023/10/19
- [PULL v2 66/78] hw/i386/pc_piix: Make PIIX4 south bridge usable in PC machine, Michael S. Tsirkin, 2023/10/19
- [PULL v2 67/78] vhost-user-common: send get_inflight_fd once, Michael S. Tsirkin, 2023/10/19
- [PULL v2 75/78] tests/acpi: Update DSDT.cxl with QTG DSM, Michael S. Tsirkin, 2023/10/19