[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 2/2] hw/cxl: Multi-Region CXL Type-3 Devices (Volatile and
From: |
Jonathan Cameron |
Subject: |
Re: [PATCH v4 2/2] hw/cxl: Multi-Region CXL Type-3 Devices (Volatile and Persistent) |
Date: |
Mon, 13 Mar 2023 16:04:41 +0000 |
...
> > + if (vmr) {
> > + if (*dpa_offset < int128_get64(vmr->size)) {
> > + *as = &ct3d->hostvmem_as;
> > + } else {
> > + *as = &ct3d->hostpmem_as;
> > + *dpa_offset -= vmr->size;
>
> You can't do math on vmr->size, it's Int128.
> And generally please do not poke at mr->size use APIs.
>
> Which one will depend ...
Good spot. In this case they are all sub 64 bit so
simple memory_region_size() is appropriate I think.
I'll add a precursor patch converting existing
int128_get64(mr->size) users in this file over to that.
Thanks,
Jonathan