Jonathan Cameron wrote: > Current implementation is very simple so many of the corner > cases do not exist (e.g. fragmenting larger poison list entries) > > Reviewed-by: Fan Ni <fan...@samsung.com>
Minor nit below. Otherwise looks good. Reviewed-by: Ira Weiny <ira.we...@intel.com> > diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c > index ab600735eb..84022d7ae3 100644 > --- a/hw/mem/cxl_type3.c > +++ b/hw/mem/cxl_type3.c > @@ -947,6 +947,42 @@ static void set_lsa(CXLType3Dev *ct3d, const void *buf, > uint64_t size, > */ > } > > +static bool set_cacheline(CXLType3Dev *ct3d, uint64_t dpa_offset, uint8_t > *data) > +{ > + MemoryRegion *vmr = NULL, *pmr = NULL; > + AddressSpace *as; > + > + if (ct3d->hostvmem) { > + vmr = host_memory_backend_get_memory(ct3d->hostvmem); > + } > + if (ct3d->hostpmem) { > + pmr = host_memory_backend_get_memory(ct3d->hostpmem); > + } > + > + if (!vmr && !pmr) { > + return false; > + } > + > + if (dpa_offset + 64 > ct3d->cxl_dstate.mem_size) { NIT: s/64/CXL_CACHE_LINE_SIZE/ Ira