From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "Williams, Dan J" <dan.j.williams@intel.com>,
"linda.knippers@hpe.com" <linda.knippers@hpe.com>
Cc: "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
"toshi.kani@hpe.com" <toshi.kani@hpe.com>,
"jmoyer@redhat.com" <jmoyer@redhat.com>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"elliott@hpe.com" <elliott@hpe.com>,
"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH 1/3] nfit: Account for table size length variation
Date: Mon, 23 Nov 2015 23:21:24 +0000 [thread overview]
Message-ID: <1448320884.27481.2.camel@intel.com> (raw)
In-Reply-To: <e65332cc9dbb7eff02f739aa5ba357d4097b4e6a.1448045168.git.linda.knippers@hpe.com>
On Fri, 2015-11-20 at 19:05 -0500, Linda Knippers wrote:
> The size of NFIT tables don't necessarily match the size of the
> data structures that we use for them. For example, the NVDIMM
> Control Region Structure table is shorter for a device with
> no block control windows than for a device with block control windows.
> Other tables, such as Flush Hint Address Structure and the Interleave
> Structure are variable length by definition.
>
> Account for the size difference when comparing table entries by
> using the actual table size from the table header if it's less
> than the structure size.
>
Agreed about the variable length tables - Flush Hint and Interleave. But
for the others, this makes it possible for a buggy bios implementation
to have a *really* small table - one that doesn't even have enough
fields to work - to pass the add_tables stage where it might have failed
previously.
I feel there may be need for an ACPI clarification for this specifying
whether if certain fields are irrelevant, they can be excluded entirely.
For example, the DCR wording is:
Number of Block Control Windows must match the
corresponding number of Block Data Windows. Fields that
follow this field are valid only if the number of Block Control
Windows is non-zero.
This leads me to believe that those fields should be 'present' but
ignored in the case of zero block windows.
If we make add_tables process only header.length and accept the
shortened table, there is nothing to tell future code that the structure
that piece of memory is casted to is a truncated one.
Thoughts?
-Vishal
next prev parent reply other threads:[~2015-11-23 23:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-21 0:05 [PATCH 0/3] fix NVDIMM hotplug changes Linda Knippers
2015-11-21 0:05 ` [PATCH 1/3] nfit: Account for table size length variation Linda Knippers
2015-11-23 23:21 ` Verma, Vishal L [this message]
2015-11-24 16:24 ` Linda Knippers
2015-11-24 16:31 ` Dan Williams
2015-11-24 17:47 ` Verma, Vishal L
2015-11-21 0:05 ` [PATCH 2/3] nfit: Fix the check for a successful NFIT merge Linda Knippers
2015-11-21 0:05 ` [PATCH 3/3] nfit: Adjust for different _FIT and NFIT headers Linda Knippers
2015-11-23 23:26 ` Verma, Vishal L
2015-11-24 16:31 ` Linda Knippers
2015-11-24 17:52 ` Verma, Vishal L
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=1448320884.27481.2.camel@intel.com \
--to=vishal.l.verma@intel.com \
--cc=dan.j.williams@intel.com \
--cc=elliott@hpe.com \
--cc=jmoyer@redhat.com \
--cc=linda.knippers@hpe.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-nvdimm@lists.01.org \
--cc=rafael.j.wysocki@intel.com \
--cc=toshi.kani@hpe.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