Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: johnny <johnny.li@montage-tech.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	"Alison Schofield" <alison.schofield@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Dave Jiang <dave.jiang@intel.com>, <linux-kernel@vger.kernel.org>,
	<linux-pci@vger.kernel.org>, <linux-acpi@vger.kernel.org>,
	<linux-cxl@vger.kernel.org>
Subject: Re: [PATCH V4 2/9] cxl/mem: Read, trace, and clear events on driver load
Date: Wed, 4 Jan 2023 15:53:13 -0800	[thread overview]
Message-ID: <Y7YRaYk1Qx3d2Bgt@iweiny-desk3> (raw)
In-Reply-To: <20221218155553.000043e5@Huawei.com>

On Sun, Dec 18, 2022 at 03:55:53PM +0000, Jonathan Cameron wrote:
> On Sun, 18 Dec 2022 08:25:34 +0800
> johnny <johnny.li@montage-tech.com> wrote:
> 

[snip]

> > >   
> > > > > +	}
> > > > > +
> > > > > +	mbox_cmd = (struct cxl_mbox_cmd) {
> > > > > +		.opcode = CXL_MBOX_OP_CLEAR_EVENT_RECORD,
> > > > > +		.payload_in = &payload,
> > > > > +		.size_in = pl_size,  
> > > > 
> > > > This payload size should be whatever we need to store the records,
> > > > not the max size possible.  Particularly as that size is currently
> > > > bigger than the mailbox might be.  
> > > 
> > > But the above check and set ensures that does not happen.
> > >   
> > > > 
> > > > It shouldn't fail (I think) simply because a later version of the spec might
> > > > add more to this message and things should still work, but definitely not
> > > > good practice to tell the hardware this is much longer than it actually is.  
> > > 
> > > I don't follow.
> > > 
> > > The full payload is going to be sent even if we are just clearing 1 record
> > > which is inefficient but it should never overflow the hardware because it is
> > > limited by the check above.
> > > 
> > > So why would this be a problem?
> > >   
> > 
> > per spec3.0, Event Record Handles field is "A list of Event Record Handles the 
> > host has consumed and the device shall now remove from its internal Event Log 
> > store.". Extra unused handle list does not folow above description. And also 
> > spec mentions "All event record handles shall be nonzero value. A value of 0 
> > shall be treated by the device as an invalid handle.". So if there is value 0 
> > in extra unused handles, device shall return invalid handle error code
> 
> I don't think we call into that particular corner as the number of event
> record handles is set correctly.  Otherwise I agree this isn't following the
> spec - though I think key here is that it won't be broken against CXL 3.0 devices
> (with that rather roundabout argument that a CXL 3.0 devices should handle later
> spec messages as those should be backwards compatible) but it might be broken
> against CXL 3.0+ ones that interpret the 0s at the end as having meaning.

I'm respining this to add the pci_set_master() anyway.  So I'm going to change
this as well.  I really don't see how hardware would go off anything but the
number of records to process the handles I could see some overly strict
firmware wanting to validate the size being exactly equal to the number
specified rather than just less than (which is what I would anticipate an issue
with).

Dan has agreed to land the movement of the trace point definition to
drivers/cxl patch I need to cxl/next.  After that I will rebase and send out.

Ira

> 
> Thanks,
> 
> Jonathan
> 

  reply	other threads:[~2023-01-04 23:53 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-12  7:06 [PATCH V4 0/9] CXL: Process event logs ira.weiny
2022-12-12  7:06 ` [PATCH V4 1/9] PCI/CXL: Export native CXL error reporting control ira.weiny
2022-12-13 19:12   ` Dan Williams
2022-12-16 14:09   ` Jonathan Cameron
2023-01-05  3:16   ` Ira Weiny
2023-01-05 16:56   ` Bjorn Helgaas
2022-12-12  7:06 ` [PATCH V4 2/9] cxl/mem: Read, trace, and clear events on driver load ira.weiny
2022-12-13  6:49   ` johnny
2022-12-13 18:56     ` Ira Weiny
2022-12-16 15:39   ` Jonathan Cameron
2022-12-16 21:54     ` Ira Weiny
2022-12-17 16:38       ` Jonathan Cameron
2022-12-18  0:21         ` Ira Weiny
2022-12-18 15:52           ` Jonathan Cameron
2022-12-18  0:25       ` johnny
2022-12-18 15:55         ` Jonathan Cameron
2023-01-04 23:53           ` Ira Weiny [this message]
2022-12-12  7:06 ` [PATCH V4 3/9] cxl/mem: Wire up event interrupts ira.weiny
2022-12-13 20:15   ` Dan Williams
2022-12-16 14:24   ` Jonathan Cameron
2022-12-16 18:42     ` Jonathan Cameron
2022-12-16 21:28       ` Ira Weiny
2022-12-17 16:40         ` Jonathan Cameron
2022-12-16 18:21   ` Jonathan Cameron
2022-12-16 21:33     ` Ira Weiny
2022-12-17 16:43       ` Jonathan Cameron
2022-12-12  7:06 ` [PATCH V4 4/9] cxl/mem: Trace General Media Event Record ira.weiny
2022-12-12  7:06 ` [PATCH V4 5/9] cxl/mem: Trace DRAM " ira.weiny
2022-12-12  7:06 ` [PATCH V4 6/9] cxl/mem: Trace Memory Module " ira.weiny
2022-12-12  7:06 ` [PATCH V4 7/9] cxl/test: Add generic mock events ira.weiny
2022-12-12  7:06 ` [PATCH V4 8/9] cxl/test: Add specific events ira.weiny
2022-12-12  7:06 ` [PATCH V4 9/9] cxl/test: Simulate event log overflow ira.weiny
2022-12-16 12:25 ` [PATCH V4 0/9] CXL: Process event logs Jonathan Cameron
2022-12-16 17:01   ` Dan Williams
2022-12-16 18:15     ` Ira Weiny
2022-12-16 18:39     ` Jonathan Cameron

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=Y7YRaYk1Qx3d2Bgt@iweiny-desk3 \
    --to=ira.weiny@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=bhelgaas@google.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=johnny.li@montage-tech.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@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