[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v9 33/45] cxl/cxl-host: Add memops for CFMWS region.
From: |
Jonathan Cameron |
Subject: |
Re: [PATCH v9 33/45] cxl/cxl-host: Add memops for CFMWS region. |
Date: |
Fri, 8 Apr 2022 12:49:01 +0100 |
On Thu, 7 Apr 2022 21:07:06 +0000
Tong Zhang <t.zhang2@samsung.com> wrote:
> On 4/4/22 08:14, Jonathan Cameron wrote:
> > From: Jonathan Cameron <jonathan.cameron@huawei.com>
> >
> >
> > +static MemTxResult cxl_read_cfmws(void *opaque, hwaddr addr, uint64_t
> > *data,
> > + unsigned size, MemTxAttrs attrs)
> > +{
> > + CXLFixedWindow *fw = opaque;
> > + PCIDevice *d;
> > +
> > + d = cxl_cfmws_find_device(fw, addr);
> > + if (d == NULL) {
> > + *data = 0;
>
> I'm looking at this code and comparing it to CXL2.0 spec 8.2.5.12.2 CXL HDM
>
> Decoder Global Control Register (Offset 04h) table. It seems that we should
>
> check POSION_ON_ERR_EN bit, if this bit is set, we return poison, otherwise
>
> should return all 1's data.
Good point. Takes a bit of searching to find the statements on that, but
it should indeed by all 1s not all 0s. I'll fix that up.
>
> Also, from the spec, this bit is implementation specific and hard
> wired(RO) to either 1 or 0,
My temptation is to set that to 0 and not return poison, because the handling
of that in the host is horribly implementation specific.
>
> but for type3 device looks like we are currently allowing it to be
> overwritten in ct3d_reg_write()
>
> function. We probably also need more sanitation in ct3d_reg_write. (Also
> for HDM
>
> range/interleaving settings.)
Absolutely agree. Generally my plan was to tighten up write restrictions
as a follow on series because it tends to require quite a lot of code and
makes it much harder to see the overall flow.
So far I've done most of the PCI config space santization (see the gitlab
tree) but not much yet on the memory mapped register space.
I'll add it to the todo list. If it turns out this particular case is
reasonably clean I might add it within this series.
Jonathan
>
> > + /* Reads to invalid address return poison */
> > + return MEMTX_ERROR;
> > + }
> > +
> > + return cxl_type3_read(d, addr + fw->base, data, size, attrs);
> > +}
> > +
>
> - Tong
>
- [PATCH v9 26/45] hw/cxl/component: Add utils for interleave parameter encoding/decoding, (continued)
- [PATCH v9 26/45] hw/cxl/component: Add utils for interleave parameter encoding/decoding, Jonathan Cameron, 2022/04/04
- [PATCH v9 27/45] hw/cxl/host: Add support for CXL Fixed Memory Windows., Jonathan Cameron, 2022/04/04
- [PATCH v9 28/45] acpi/cxl: Introduce CFMWS structures in CEDT, Jonathan Cameron, 2022/04/04
- [PATCH v9 29/45] hw/pci-host/gpex-acpi: Add support for dsdt construction for pxb-cxl, Jonathan Cameron, 2022/04/04
- [PATCH v9 30/45] pci/pcie_port: Add pci_find_port_by_pn(), Jonathan Cameron, 2022/04/04
- [PATCH v9 31/45] CXL/cxl_component: Add cxl_get_hb_cstate(), Jonathan Cameron, 2022/04/04
- [PATCH v9 32/45] mem/cxl_type3: Add read and write functions for associated hostmem., Jonathan Cameron, 2022/04/04
- [PATCH v9 33/45] cxl/cxl-host: Add memops for CFMWS region., Jonathan Cameron, 2022/04/04
- [PATCH v9 34/45] hw/cxl/component Add a dumb HDM decoder handler, Jonathan Cameron, 2022/04/04
- [PATCH v9 35/45] i386/pc: Enable CXL fixed memory windows, Jonathan Cameron, 2022/04/04
- [PATCH v9 36/45] tests/acpi: q35: Allow addition of a CXL test., Jonathan Cameron, 2022/04/04
- [PATCH v9 37/45] qtests/bios-tables-test: Add a test for CXL emulation., Jonathan Cameron, 2022/04/04
- [PATCH v9 38/45] tests/acpi: Add tables for CXL emulation., Jonathan Cameron, 2022/04/04
- [PATCH v9 39/45] qtest/cxl: Add more complex test cases with CFMWs, Jonathan Cameron, 2022/04/04
- [PATCH v9 40/45] hw/arm/virt: Basic CXL enablement on pci_expander_bridge instances pxb-cxl, Jonathan Cameron, 2022/04/04
- [PATCH v9 41/45] qtest/cxl: Add aarch64 virt test for CXL, Jonathan Cameron, 2022/04/04
- [PATCH v9 42/45] docs/cxl: Add initial Compute eXpress Link (CXL) documentation., Jonathan Cameron, 2022/04/04
- [PATCH v9 43/45] pci-bridge/cxl_upstream: Add a CXL switch upstream port, Jonathan Cameron, 2022/04/04