All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junjie Cao <junjie.cao@intel.com>
To: Shrihari E S <shrihari.s@samsung.com>
Cc: jic23@kernel.org, fan.ni@samsung.com, mst@redhat.com,
	marcel.apfelbaum@gmail.com, dave@stgolabs.net,
	arun.george@samsung.com, dongjoo.seo1@samsung.com,
	s.neeraj@samsung.com, vikash.k5@samsung.com, cpgs@samsung.com,
	gost.dev@samsung.com, linux-cxl@vger.kernel.org,
	linux-pci@vger.kernel.org, qemu-devel@nongnu.org
Subject: Re: [RFC V2 07/10] hw/pci: hw/cxl: Wire SVC initialization into port realize functions.
Date: Sun, 30 Aug 2026 15:22:09 +0800	[thread overview]
Message-ID: <20260830072209.399529-1-junjie.cao@intel.com> (raw)
In-Reply-To: <111374580.41787732282793.JavaMail.epsvc@epcpadp2new>

Hi Shrihari,

On Wed, 26 Aug 2026 11:04:07 +0530, Shrihari E S wrote:
> +    if (p->svc) {
> +        rc = pcie_svc_cap_init(d, CXL_UPSTREAM_PORT_SVC_OFFSET, errp);
> +        if (p->flitmode && rc >= 0) {
> +            usp->uio_capable = true;
> +        }
> +    }

This gate never opens on cxl-upstream: p->flitmode is the PCIEPort
field, but the USP's x-256b-flit property still targets its own
CXLUpstreamPort::flitmode rather than the field patch 1 moved to
PCIEPort, and nothing sets the PCIEPort one there.  Everything else on
the USP (pcie_cap_fill_link_ep_usp(), the DVSEC status,
latch_registers()) reads usp->flitmode, so the port reports flit active
while uio_capable stays false.  I read the HDM Decoder Capability
register back on the patch-10 example topology with
x-svc=on,x-256b-flit=on everywhere: the USP reads 0x00000382 -- UIO
clear, UIO decoder count 0 -- while cxl-rp reads 0x00042312 with UIO
set.  A switch topology, the case the cover letter leads with, can't
advertise UIO through the USP.  What worked for me was dropping the
CXLUpstreamPort copy so both readers take the PCIEPort field: with
that the USP reads 0x00042382 and nothing else in the topology moves.
I'd put it in 1/10, which left CXLUpstreamPort::flitmode behind while
its message says the refactor "allows all the derived ports ... to
use this property".

rpc->svc_offset is only set by gen_pcie_root_port; ioh3420,
pnv-phb-root-port and aspeed.pcie-root-port leave it 0, so

  qemu-system-x86_64 -M q35 -display none -device ioh3420,x-svc=on

aborts:

  ../hw/pci/pcie.c:1140: pcie_add_capability: Assertion `offset >= PCI_CONFIG_SPACE_SIZE' failed.

I'd either give them svc_offsets or fail realize with a proper error
when svc_offset is 0 and x-svc is set.

Neither of those shows up in make check.  A qtest instantiating
ioh3420,x-svc=on would have caught the abort; the USP gate only shows
up in the component BAR, where I read it in the HDM Decoder Capability
register, so a chain walk wouldn't catch that one.  Worth some
coverage for the two new capabilities.

The v1 SVC/AER collision is fixed -- I walked the extended chains
over ECAM: gen pcie-root-port has SVC at 0x150 after AER/ACS, cxl-rp's
four DVSECs moved out to 0x1c4 with SVC taking 0x150, and usp/dsp have
SVC at 0x148 with SN/DVSEC offsets shifted to match.

The DVSEC moves are unconditional, though.  CXL_ROOT_PORT_DVSEC_OFFSET
and the usp/dsp equivalents are compile-time chains through
PCI_SVC_SIZEOF, so x-svc=off changes nothing: on a topology with no
x-svc anywhere I read cxl-rp DVSECs at 0x1c4 (0x150 on the base
branch), usp DSN at 0x1bc (0x148), dsp DVSEC at 0x1bc (0x148).  That's
a config space change on existing CXL machines with no property to gate
it.  Migration won't notice -- none of the CXL devices carries a
VMStateDescription, so their config space never reaches the stream --
but a guest on an unchanged machine type sees the DVSECs move across
QEMU versions, and there's no knob to hang a hw_compat entry on.

Many thanks,
Junjie

  reply	other threads:[~2026-08-30  7:22 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260826052014epcas5p11846c6a40fcec4ec4ba441ceb26e5dcc@epcas5p1.samsung.com>
     [not found] ` <20260826053410.1322176-1-shrihari.s@samsung.com>
2026-08-26  5:34   ` [RFC V2 01/10] hw/pci: Refactor flitmode from PCIESlot to PCIEPort Shrihari E S
2026-08-26  5:34   ` [RFC V2 02/10] hw/pci: Move 'x-256b-flit' property from cxl_root_port to pcie_root_port Shrihari E S
2026-08-30  7:20     ` Junjie Cao
2026-08-26  5:34   ` [RFC V2 03/10] hw/pci: Add SVC capability and UIO properties to PCIe ports Shrihari E S
2026-08-30  7:20     ` Junjie Cao
2026-08-26  5:34   ` [RFC V2 04/10] hw/cxl: Add Streamlined Virtual Channel (SVC) property to CXL ports Shrihari E S
2026-08-26  5:34   ` [RFC V2 05/10] hw/cxl: Wire UIO capability into HDM decoder and DVSEC registers Shrihari E S
2026-08-30  7:21     ` Junjie Cao
2026-09-10  9:37       ` Shrihari E S
2026-08-26  5:34   ` [RFC V2 06/10] hw/pci: Add PCIe Streamlined Virtual Channel (SVC) capability Shrihari E S
2026-08-30  7:21     ` Junjie Cao
2026-09-10  8:40       ` Shrihari E S
2026-08-26  5:34   ` [RFC V2 07/10] hw/pci: hw/cxl: Wire SVC initialization into port realize functions Shrihari E S
2026-08-30  7:22     ` Junjie Cao [this message]
2026-08-26  5:34   ` [RFC V2 08/10] hw/pci: Add PCIe Device3 capability support Shrihari E S
2026-08-30  7:22     ` Junjie Cao
2026-08-26  5:34   ` [RFC V2 09/10] hw/cxl: Wire SVC and Dev3 capability to CXL Type 3 device Shrihari E S
2026-08-30  7:23     ` Junjie Cao
2026-08-26  5:34   ` [RFC V2 10/10] cxl: Add documentation for CXL UIO support Shrihari E S
2026-08-30  7:23     ` Junjie Cao
     [not found] <CGME20260826051958epcas5p3db6cf2ef9115168c5d8dcec7bdb9b8c3@epcas5p3.samsung.com>
2026-08-26  5:34 ` [RFC V2 0/9] hw/pci: hw/cxl: Add UIO support in CXL and PCIe stack Shrihari E S
2026-08-30  7:19   ` Junjie Cao
2026-09-10  8:22     ` Shrihari E S

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260830072209.399529-1-junjie.cao@intel.com \
    --to=junjie.cao@intel.com \
    --cc=arun.george@samsung.com \
    --cc=cpgs@samsung.com \
    --cc=dave@stgolabs.net \
    --cc=dongjoo.seo1@samsung.com \
    --cc=fan.ni@samsung.com \
    --cc=gost.dev@samsung.com \
    --cc=jic23@kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=s.neeraj@samsung.com \
    --cc=shrihari.s@samsung.com \
    --cc=vikash.k5@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.