From: Ben Widawsky <ben.widawsky@intel.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: "Dan Williams" <dan.j.williams@intel.com>,
linux-cxl@vger.kernel.org, "Ira Weiny" <ira.weiny@intel.com>,
"Alison Schofield" <alison.schofield@intel.com>,
linuxarm@huawei.com, "Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH] cxl/regs: Fix size of CXL Capability Header Register
Date: Tue, 1 Feb 2022 10:29:34 -0800 [thread overview]
Message-ID: <20220201182934.jjvavjsf4h7oqngv@intel.com> (raw)
In-Reply-To: <20220201153437.2873-1-Jonathan.Cameron@huawei.com>
On 22-02-01 15:34:37, Jonathan Cameron wrote:
> In CXL 2.0, 8.2.5.1 CXL Capability Header Register: this register
> is given as 32 bits.
>
> 8.2.3 which covers the CXL 2.0 Component registers, including the
> CXL Capability Header Register states that access restrictions
> specified in Section 8.2.2 apply.
>
> 8.2.2 includes:
> * A 32 bit register shall be accessed as a 4 Byte quantity.
> ...
> If these rules are not followed, the behavior is undefined.
>
> Discovered during review of CXL QEMU emulation. Alex Bennée pointed
> out there was a comment saying that 4 byte registers must be read
> with a 4 byte read, but 8 byte reads were being emulated.
>
> https://lore.kernel.org/qemu-devel/87bkzyd3c7.fsf@linaro.org/
>
> Fixing that, led to this code failing. Whilst a given hardware
> implementation 'might' work with an 8 byte read, it should not be relied
> upon. The QEMU emulation v5 will return 0 and log the wrong access width.
>
> The code moved, so one fixes tag for where this will directly apply and
> also a reference to the earlier introduction of the code for backports.
>
> Fixes: 0f06157e0135 ("cxl/core: Move register mapping infrastructure")
> Fixes: 08422378c4ad ("cxl/pci: Add HDM decoder capabilities")
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Alex Bennée <alex.bennee@linaro.org>
oops.
Reviewed-by: Ben Widawsky <ben.widawsky@intel.com>
[snip]
prev parent reply other threads:[~2022-02-01 18:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-01 15:34 [PATCH] cxl/regs: Fix size of CXL Capability Header Register Jonathan Cameron
2022-02-01 18:29 ` Ben Widawsky [this message]
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=20220201182934.jjvavjsf4h7oqngv@intel.com \
--to=ben.widawsky@intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=alex.bennee@linaro.org \
--cc=alison.schofield@intel.com \
--cc=dan.j.williams@intel.com \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linuxarm@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox