From: Toshi Kani <toshi.kani@hpe.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: "Moore, Robert" <robert.moore@intel.com>,
"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
"Zheng, Lv" <lv.zheng@intel.com>,
"elliott@hpe.com" <elliott@hpe.com>,
"linux-nvdimm@lists.01.org" <linux-nvdimm@ml01.01.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devel@acpica.org" <devel@acpica.org>
Subject: Re: [PATCH v2 1/3] ACPI/NFIT: Update Control Region Structure to comply ACPI 6.1
Date: Tue, 01 Mar 2016 12:18:53 -0700 [thread overview]
Message-ID: <1456859933.15454.83.camel@hpe.com> (raw)
In-Reply-To: <CAPcyv4hS44abMCs1sxdLW0YgMjP33Td0LbEWhXi9jqJ_ARU7CA@mail.gmail.com>
On Tue, 2016-03-01 at 10:14 -0800, Dan Williams wrote:
> On Tue, Mar 1, 2016 at 9:36 AM, Toshi Kani <toshi.kani@hpe.com> wrote:
> > On Tue, 2016-03-01 at 16:03 +0000, Moore, Robert wrote:
> > > We have a bunch of macros in include/acmacros.h -- like this:
> > >
> > > ACPI_MOVE_16_TO_16(d, s)
> >
> > There is a problem in using the ACPICA byte-swap macros. ACPI is
> > little-
> > endian arch, so the macros are set to perform byte-swappings when the
> > CPU
> > arch is big-endian. This case, however, is the other way around. The
> > fields in question are defined & stored as arrays of bytes. If you
> > treat
> > them as multi-bytes numeric values, then you need to byte-swap them
> > when
> > the CPU arch is little-endian because arrays of bytes have the same
> > addressing as big-endian.
> >
> > Another issue is that it is not clear who needs to perform the byte-
> > swapping among ACPICA and drivers. If ACPICA, drivers must agree that
> > these fields are always treated as multi-bytes numeric values despite
> > of
> > the spec. If drivers, we need to make sure that only a single driver
> > performs this byte-swapping one time as ACPI tables are global
> > structures.
> >
> > I think it is much clearer to define the structure according to the
> > ACPI
> > spec.
>
> I think the "ACPI tables are little-endian" assumption is pervasive
> throughout the implementation.
>
> Toshi, it seems all we need is conversions like:
>
> - sprintf(buf, "%#x\n", dcr->vendor_id);
> + sprintf(buf, "%#x\n", le16_to_cpu(dcr->vendor_id));
>
> ...for the values exported to userspace through sysfs, but otherwise
> leave the base table definitions as is. Will this suffice?
Yes, I am OK to go with this option to get it done.
We still need to add new fields into the structure. Is it OK to make this
change? If not, we will need to have a local structure to define the new
fields...
Thanks,
-Toshi
next prev parent reply other threads:[~2016-03-01 18:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-22 21:55 [PATCH v2 0/3] ACPI 6.1 update for NFIT Control Region Structure Toshi Kani
2016-02-22 21:55 ` [PATCH v2 1/3] ACPI/NFIT: Update Control Region Structure to comply ACPI 6.1 Toshi Kani
2016-03-01 15:13 ` Moore, Robert
2016-03-01 16:38 ` Toshi Kani
2016-03-01 16:03 ` Moore, Robert
2016-03-01 17:36 ` Toshi Kani
2016-03-01 17:37 ` Moore, Robert
2016-03-01 17:41 ` Moore, Robert
2016-03-01 19:10 ` Toshi Kani
2016-03-01 18:14 ` Dan Williams
2016-03-01 19:18 ` Toshi Kani [this message]
2016-03-01 19:53 ` Toshi Kani
2016-02-22 21:55 ` [PATCH v2 2/3] ACPI/NFIT: Add NVDIMM ID "id" under sysfs Toshi Kani
2016-02-22 21:55 ` [PATCH v2 3/3] nfit_test: Update SPD ID init handlings Toshi Kani
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=1456859933.15454.83.camel@hpe.com \
--to=toshi.kani@hpe.com \
--cc=dan.j.williams@intel.com \
--cc=devel@acpica.org \
--cc=elliott@hpe.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@ml01.01.org \
--cc=lv.zheng@intel.com \
--cc=rjw@rjwysocki.net \
--cc=robert.moore@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