From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Fan Ni <fan.ni@samsung.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"Michael Tsirkin" <mst@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
"linuxarm@huawei.com" <linuxarm@huawei.com>
Subject: Re: [PATCH v3 4/4] hw/cxl: Support 4 HDM decoders at all levels of topology
Date: Wed, 13 Sep 2023 10:03:38 +0100 [thread overview]
Message-ID: <20230913100338.000006c2@Huawei.com> (raw)
In-Reply-To: <20230912180844.GD319114@bgt-140510-bm03>
On Tue, 12 Sep 2023 18:08:44 +0000
Fan Ni <fan.ni@samsung.com> wrote:
> On Mon, Sep 11, 2023 at 12:43:13PM +0100, Jonathan Cameron wrote:
>
> > Support these decoders in CXL host bridges (pxb-cxl), CXL Switch USP
> > and CXL Type 3 end points.
> >
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > ---
>
> One comment inline, other than that, looks good to me.
I think we are fine, but also possible I'm missing something :)
> >
> > /* 8.2.5.13 - CXL Extended Security Capability Structure (Root complex only) */
> > #define EXTSEC_ENTRY_MAX 256
> > diff --git a/hw/cxl/cxl-component-utils.c b/hw/cxl/cxl-component-utils.c
> > index aa011a8f34..3ecdad4a5e 100644
> > --- a/hw/cxl/cxl-component-utils.c
> > +++ b/hw/cxl/cxl-component-utils.c
> > @@ -90,6 +90,9 @@ static void dumb_hdm_handler(CXLComponentState *cxl_cstate, hwaddr offset,
> >
> > switch (offset) {
> > case A_CXL_HDM_DECODER0_CTRL:
> > + case A_CXL_HDM_DECODER1_CTRL:
> > + case A_CXL_HDM_DECODER2_CTRL:
> > + case A_CXL_HDM_DECODER3_CTRL:
> > should_commit = FIELD_EX32(value, CXL_HDM_DECODER0_CTRL, COMMIT);
> > should_uncommit = !should_commit;
>
> So for the commit/uncommit flag, we always check decoder 0 control
> register? Or i read it wrong? I thought the commit bit is per control register
> thing?
This is in the write handler and the value passed in that we are looking at is
for whichever of the _CTRL registers is being written.
I could have coded this as separate entries for each register as
FIELD_EX32(value, CXL_HDM_DECODER[X]_CTRL, COMMIT)
but as this only figures out the field offset and mask, it is the same for X=0,1,2,3
Jonathan
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Fan Ni <fan.ni@samsung.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"Michael Tsirkin" <mst@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
"linuxarm@huawei.com" <linuxarm@huawei.com>
Subject: Re: [PATCH v3 4/4] hw/cxl: Support 4 HDM decoders at all levels of topology
Date: Wed, 13 Sep 2023 10:03:38 +0100 [thread overview]
Message-ID: <20230913100338.000006c2@Huawei.com> (raw)
In-Reply-To: <20230912180844.GD319114@bgt-140510-bm03>
On Tue, 12 Sep 2023 18:08:44 +0000
Fan Ni <fan.ni@samsung.com> wrote:
> On Mon, Sep 11, 2023 at 12:43:13PM +0100, Jonathan Cameron wrote:
>
> > Support these decoders in CXL host bridges (pxb-cxl), CXL Switch USP
> > and CXL Type 3 end points.
> >
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > ---
>
> One comment inline, other than that, looks good to me.
I think we are fine, but also possible I'm missing something :)
> >
> > /* 8.2.5.13 - CXL Extended Security Capability Structure (Root complex only) */
> > #define EXTSEC_ENTRY_MAX 256
> > diff --git a/hw/cxl/cxl-component-utils.c b/hw/cxl/cxl-component-utils.c
> > index aa011a8f34..3ecdad4a5e 100644
> > --- a/hw/cxl/cxl-component-utils.c
> > +++ b/hw/cxl/cxl-component-utils.c
> > @@ -90,6 +90,9 @@ static void dumb_hdm_handler(CXLComponentState *cxl_cstate, hwaddr offset,
> >
> > switch (offset) {
> > case A_CXL_HDM_DECODER0_CTRL:
> > + case A_CXL_HDM_DECODER1_CTRL:
> > + case A_CXL_HDM_DECODER2_CTRL:
> > + case A_CXL_HDM_DECODER3_CTRL:
> > should_commit = FIELD_EX32(value, CXL_HDM_DECODER0_CTRL, COMMIT);
> > should_uncommit = !should_commit;
>
> So for the commit/uncommit flag, we always check decoder 0 control
> register? Or i read it wrong? I thought the commit bit is per control register
> thing?
This is in the write handler and the value passed in that we are looking at is
for whichever of the _CTRL registers is being written.
I could have coded this as separate entries for each register as
FIELD_EX32(value, CXL_HDM_DECODER[X]_CTRL, COMMIT)
but as this only figures out the field offset and mask, it is the same for X=0,1,2,3
Jonathan
next prev parent reply other threads:[~2023-09-13 9:03 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 11:43 [PATCH v3 0/4] hw/cxl: Support emulating 4 HDM decoders throughout topology Jonathan Cameron
2023-09-11 11:43 ` Jonathan Cameron via
2023-09-11 11:43 ` [PATCH v3 1/4] hw/cxl: Push cxl_decoder_count_enc() and cxl_decode_ig() into .c Jonathan Cameron
2023-09-11 11:43 ` Jonathan Cameron via
2023-09-12 16:14 ` Fan Ni
2023-09-11 11:43 ` [PATCH v3 2/4] hw/cxl: Add utility functions decoder interleave ways and target count Jonathan Cameron
2023-09-11 11:43 ` Jonathan Cameron via
2023-09-12 17:20 ` Fan Ni
2023-09-13 8:58 ` Jonathan Cameron
2023-09-13 8:58 ` Jonathan Cameron via
2023-09-11 11:43 ` [PATCH v3 3/4] hw/cxl: Fix and use same calculation for HDM decoder block size everywhere Jonathan Cameron
2023-09-11 11:43 ` Jonathan Cameron via
2023-09-12 17:43 ` Fan Ni
2023-09-13 6:53 ` Philippe Mathieu-Daudé
2023-09-13 9:01 ` Jonathan Cameron
2023-09-13 9:01 ` Jonathan Cameron via
2023-09-11 11:43 ` [PATCH v3 4/4] hw/cxl: Support 4 HDM decoders at all levels of topology Jonathan Cameron
2023-09-11 11:43 ` Jonathan Cameron via
2023-09-12 18:08 ` Fan Ni
2023-09-13 9:03 ` Jonathan Cameron [this message]
2023-09-13 9:03 ` Jonathan Cameron via
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=20230913100338.000006c2@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=fan.ni@samsung.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mst@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/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.