From: Jean Delvare <jdelvare@suse.de>
To: Thomas Renninger <trenn@suse.de>
Cc: "Moore, Robert" <robert.moore@intel.com>,
"Lin, Ming M" <ming.m.lin@intel.com>, Len Brown <lenb@kernel.org>,
"Zhao, Yakui" <yakui.zhao@intel.com>,
linux-acpi <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH] ACPICA: Revert "ACPICA: Remove obsolete acpi_os_validate_address interface"
Date: Thu, 2 Jul 2009 10:30:58 +0200 [thread overview]
Message-ID: <200907021030.58401.jdelvare@suse.de> (raw)
In-Reply-To: <200907012319.53021.trenn@suse.de>
Le mercredi 01 juillet 2009, Thomas Renninger a écrit :
> On Wednesday 01 July 2009 05:29:57 pm Moore, Robert wrote:
> > >-----Original Message-----
> > >From: Thomas Renninger [mailto:trenn@suse.de]
> > >Ouch, I thought OperationRegions must be declared in global namespace.
> > >I agree, we have a memleak and this looks rather sever.
>
> An idea for a quick fix which may be suitable for stable kernels (without
> checking acpica code..):
> Is it easily possible to check whether the Opregion is declared in global
> namespace or inside a method at the place where acpi_os_validate_address is called
> from acpica?
> In the latter case it should not be called and we avoid the memleak and
> could still detect most i2c/smbus/hwmon devices conflicts.
Can't you just walk the list before you add an entry, and if the
entry is already present, do not add it again?
> > >Grmpfl, that makes the resource conflict checking even more ugly.
> > >Thanks for spotting this,
> > >
> > > Thomas
> >
> > OperationRegions/Fields can be dynamically created/deleted in two ways:
> > 1) Control method execution
> > 2) Dynamic ACPI table load/unload (for example, hotplug)
> >
> > So, in order to track this, the resource list must also be dynamic, with
> > the ability to add and delete entries.
> >
> > It begins to sound like the resource list is becoming a "mini-namespace"
> > that consists of only ACPI field objects. Might it not be more efficient to
> > simply query the existing ACPI namespace when you need to? A walk_namespace
> > for field objects would give you the same information as the resource list,
> > and it is automatically guaranteed to be current.
> >
> > However, the may be some more fundamental issues. I have not looked at
> > exactly how the resource list is used, but since the list is dynamic, if
> > the worry concerns address collisions between a driver and the AML
> > interpreter, it may not be enough to simply check for this at the time the
> > driver is loaded. You would really need to check before *every* I/O or
> > memory access. Which does not sound feasible.
This is indeed not feasible, the cost would be much too high. Not to
mention it would still be racy by design.
Please remember that Thomas' code was meant to solve real-world
problems which had been there for long and nobody else was able to
solve so far. It wasn't meant to be bullet-proof, it was not perfect,
but it did help in practice.
> > I guess that I would like to understand the exact issue(s) that are behind
> > the creation of the resource list in the first place. AFAIK, any AML code
> > that reads/writes to operation regions usually assumes exclusive access to
> > these regions. The ACPI Global Lock is used when exclusive access cannot be
> > assumed.
I could change the affected native drivers to take the ACPI Global
Lock if needed. But what guarantees that the ACPI code which accesses
the device in question is taking the ACPI Global Lock too? It can
only work if everybody plays the game. My understanding was that most
ACPI implementation did not take the ACPI Global Lock when accessing
the devices and thus this approach wouldn't work in practice. Was I
wrong?
--
Jean Delvare
Suse L3
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-07-02 8:30 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-01 2:29 [PATCH] ACPICA: Revert "ACPICA: Remove obsolete acpi_os_validate_address interface" Lin Ming
2009-07-01 8:56 ` Thomas Renninger
2009-07-01 9:23 ` Lin Ming
2009-07-01 9:35 ` Thomas Renninger
2009-07-01 15:29 ` Moore, Robert
2009-07-01 21:19 ` Thomas Renninger
2009-07-01 22:07 ` Moore, Robert
2009-07-02 8:20 ` Jean Delvare
2009-07-02 8:30 ` Jean Delvare [this message]
2009-07-02 2:03 ` Len Brown
2009-07-02 6:27 ` Lin Ming
2009-07-02 6:42 ` Moore, Robert
2009-07-02 10:15 ` Thomas Renninger
2009-07-02 10:12 ` Thomas Renninger
2009-07-03 1:30 ` Lin Ming
2009-07-13 15:36 ` Thomas Renninger
2009-07-14 2:28 ` Lin Ming
2009-07-17 15:02 ` Thomas Renninger
2009-07-02 10:22 ` Thomas Renninger
2009-07-02 15:49 ` Moore, Robert
2009-07-04 1:29 ` Robert Hancock
2009-08-30 13:43 ` Jean Delvare
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=200907021030.58401.jdelvare@suse.de \
--to=jdelvare@suse.de \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=ming.m.lin@intel.com \
--cc=robert.moore@intel.com \
--cc=trenn@suse.de \
--cc=yakui.zhao@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.