hw/cxl, hw/machine, hw/i386: Misc minor fixes / cleanup
cover hw/cxl, hw/machine, hw/i386: Misc minor fixes / cleanup
Three more or less less unrelated fixes for recently added CXL code.
Jonathan Cameron (3):
hw/machine: Clear out left over CXL related pointer from move of state
handling to machines.
hw/i386/pc: Always place CXL Memory Regions after device_memory hw/cxl: Fix size of constant in interleave granularity function.
hw/i386/pc.c | 6 ++---- include/hw/boards.h | 1 - include/hw/cxl/cxl_component.h | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-)
Signature · 1 line
2.32.0
PATCH 1/3 hw/machine: Clear out left over CXL related pointer from move of state handling to machines.
This got left behind in the move of the CXL setup code from core files to the machines that support it.
--- include/hw/boards.h | 1 - 1 file changed, 1 deletion(-)
include/hw/boards.h +0 -1
@@ -360,7 +360,6 @@ struct MachineState {CpuTopology smp;struct NVDIMMState *nvdimms_state;struct NumaState *numa_state; -CXLFixedMemoryWindowOptionsList *cfmws_list; };#define DEFINE_MACHINE (namestr, machine_initfn) \
Signature · 1 line
2.32.0
PATCH 2/3 hw/i386/pc: Always place CXL Memory Regions after device_memory
In reply to Jonathan Cameron viaPreviously broken_reserved_end was taken into account, but Igor Mammedov identified that this could lead to a clash between potential RAM being mapped in the region and CXL usage. Hence always add the size of the device_memory memory region. This only affects the case where the broken_reserved_end flag was set.
--- hw/i386/pc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
hw/i386/pc.c +2 -4
@@ -922,10 +922,8 @@ void pc_memory_init(PCMachineState *pcms,hwaddr cxl_size = MiB;if (pcmc->has_reserved_memory && machine->device_memory->base) { - cxl_base = machine->device_memory->base; -if (!pcmc->broken_reserved_end) { - cxl_base +=memory_region_size (&machine->device_memory->mr); - } + cxl_base = machine->device_memory->base + +memory_region_size (&machine->device_memory->mr); }else if (pcms->sgx_epc.size !=0 ) { cxl_base =sgx_epc_above_4g_end (&pcms->sgx_epc); }else {
Signature · 1 line
2.32.0
PATCH 3/3 hw/cxl: Fix size of constant in interleave granularity function.
In reply to Jonathan Cameron viaWhilst the interleave granularity is always small enough that this isn't a real problem (much less than 4GiB) let's change the constant to ULL to fix the coverity warning.
--- include/hw/cxl/cxl_component.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/cxl/cxl_component.h +1 -1
@@ -215,7 +215,7 @@ uint8_t cxl_interleave_granularity_enc(uint64_t gran, Error **errp);static inline hwaddr cxl_decode_ig (int ig) { -return 1 << (ig +8 ); +return 1ULL << (ig +8 ); }CXLComponentState *cxl_get_hb_cstate (PCIHostState *hb);
Signature · 1 line
2.32.0
Quoted 8 lines · On Fri, 1 Jul 2022 14:22:57 +0100 Jonathan Cameron via <[email protected]>…
Three more or less less unrelated fixes for recently added CXL code.
Jonathan Cameron (3):
hw/machine: Clear out left over CXL related pointer from move of state
handling to machines.
hw/i386/pc: Always place CXL Memory Regions afterdevice_memoryhw/cxl: Fix size of constant in interleave granularity function.
Quoted 5 lines
hw/i386/pc.c | 6 ++---- include/hw/boards.h | 1 - include/hw/cxl/cxl_component.h | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-)
For whole series:
Quoted 8 lines · Jonathan Cameron
Three more or less less unrelated fixes for recently added CXL code.
Jonathan Cameron (3):
hw/machine: Clear out left over CXL related pointer from move of state
handling to machines.
hw/i386/pc: Always place CXL Memory Regions afterdevice_memoryhw/cxl: Fix size of constant in interleave granularity function.
Hi -- did this patch series get lost somewhere? I was going through old Coverity issues, and noticed the fix in patch 3 is still not upstream.
thanks
-- PMM