Linux CXL
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Dan Williams <dan.j.williams@intel.com>,
	<alison.schofield@intel.com>, Davidlohr Bueso <dave@stgolabs.net>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	Dave Jiang <dave.jiang@intel.com>,
	"Vishal Verma" <vishal.l.verma@intel.com>,
	Ira Weiny <ira.weiny@intel.com>
Cc: <linux-cxl@vger.kernel.org>
Subject: RE: [PATCH 1/2] cxl/acpi: Fix XOR 3-6-12 way host bridge look-up calculation
Date: Thu, 29 Feb 2024 14:35:12 -0800	[thread overview]
Message-ID: <65e106a0e45f8_1138c729462@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <65e0d0b7bd91f_1138c72943c@dwillia2-xfh.jf.intel.com.notmuch>

Dan Williams wrote:
> alison.schofield@ wrote:
> > From: Alison Schofield <alison.schofield@intel.com>
> > 
> > The XOR host bridge look-up function is broken in its application
> > of the modulo calculation for interleaves that are multiples of 3.
> > 
> > The failure appears like this:
> > [] cxl_core:cxl_region_attach_position:1433: cxl region4: mem0:decoder8.1 invalid target position for decoder3.2
> > 
> > Replace the broken modulo calc with the same modulo calc as used
> > for Modulo Math. This is per CXL spec definition but was overlooked
> > in the original over-complicated implementation.
> > 
> > With the simple modulo calculation, the jump to a helper function
> > becomes needless and the work is now presented in a straight line.
> > 
> > Display the interleave_arithmetic in the dev_dbg() of successfully
> > setup root decoders to make debug lookup easier.
> > 
> > Fixes: f9db85bfec0d ("cxl/acpi: Support CXL XOR Interleave Math (CXIMS)")
> > Signed-off-by: Alison Schofield <alison.schofield@intel.com>
[..]
> > -	/* Entry (n) is 0 for no interleave (iw == 1) */
> > -	if (iw != 1)
> > -		n = cxl_xor_calc_n(hpa, cximsd, iw, ig);
> > +	if (iw == 6 || iw == 12)
> > +		n |= pos % iw;
> 
> Can you help me map this back to Table-9-22?
> 
> Shouldn't this be:
> 
> 	n |= (pos % iw) << (iw / 3);

Wait, no:

 	n |= (pos % iw) * (iw / 3);

...to match:

 6:   + 2* HPA[51:9+HBIG] MOD 3

 12:  + 4* HPA[51:10+HBIG] MOD 3

  reply	other threads:[~2024-02-29 22:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14  7:13 [PATCH 0/2] XOR 3-6-12 HB Interleave Calc Repair alison.schofield
2024-02-14  7:13 ` [PATCH 1/2] cxl/acpi: Fix XOR 3-6-12 way host bridge look-up calculation alison.schofield
2024-02-29 18:45   ` Dan Williams
2024-02-29 22:35     ` Dan Williams [this message]
2024-03-07  4:40       ` Alison Schofield
2024-02-14  7:13 ` [PATCH 2/2] cxl/test: Replace an illegal CFMWS definition with a useful x3 CFMWS alison.schofield
2024-02-29 18:59   ` Dan Williams

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=65e106a0e45f8_1138c729462@dwillia2-xfh.jf.intel.com.notmuch \
    --to=dan.j.williams@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=vishal.l.verma@intel.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