lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200704151857.03115.bjorn.helgaas@hp.com>
Date:	Sun, 15 Apr 2007 18:57:02 -0600
From:	Bjorn Helgaas <bjorn.helgaas@...com>
To:	"Luca Tettamanti" <kronos.it@...il.com>
Cc:	"Jean Delvare" <khali@...ux-fr.org>, "Pavel Machek" <pavel@....cz>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	lm-sensors@...sensors.org, linux-acpi@...r.kernel.org,
	"Chuck Ebbert" <cebbert@...hat.com>
Subject: Re: [lm-sensors] Could the k8temp driver be interfering with ACPI?

On Sunday 15 April 2007 14:59, Luca Tettamanti wrote:
> On 4/15/07, Bjorn Helgaas <bjorn.helgaas@...com> wrote:
> > But I missed the details, such as the specific devices in question,
> > which ports they use, how they are described in ACPI, which AML
> > methods use those ports, and which non-ACPI drivers also use them.
> 
> The original report was about the temperature sensors of K8 cpus. It
> happens that ACPI reads the sensors while the linux driver is using it
> and gets garbage (and shut down the system). The problem is more
> generic though, and applies to all hardware monitoring chips for which
> a driver exists.

Yes, I saw that much, but that's not enough detail to craft a good
solution.

In the case of k8temp, the driver claims PCI devices with a certain
vendor and device ID.  PCI devices are mostly outside the scope of
ACPI.  There's a standard enumeration protocol, and a driver should
be able to claim any device it recognizes without fear of conflict.

I claim that an AML method that accesses a PCI device is
defective because the AML can't know whether a native driver
has claimed the device.

Sometimes the firmware can hide PCI devices so the OS
enumeration doesn't find them.  In that case, AML might
be able to safely use the PCI device, but the native
driver wouldn't be able to claim the device, so there
would be no conflict.  (Linux sometimes uses quirks to
"unhide" things like this, which could lead to a conflict
of our own making.)

I suspect that other sensor drivers may just probe for devices
at "known" addresses hard-coded in the driver.  This is a
problem because the ACPI model is that the OS learns about
all built-in devices via the ACPI namespace.  If it isn't
in the namespace, it shouldn't exist as far as the OS is
concerned.

So we could easily have the situation where ACPI uses a
sensor and does not expose it to the OS in the namespace.
In that case, the firmware expectation is that the OS
won't touch the device.  If the OS pokes around at the
magic addresses and happens to trip over the device, we
just made ourselves a problem.

> > It also sounds like the non-ACPI drivers provide much more
> > functionality than ACPI exposes.  I'd like to understand this,
> > too, because an  obvious way to solve the problem would be to
> > drop the non-ACPI drivers.
> 
> Problem is that ACPI may access the sensors anyway (e.g. via SMM).

If ACPI accesses sensors but there is no native driver, there
should be no conflict.

> > Is this extra functionality available
> > on Windows?  If so, do we know whether Windows uses non-ACPI drivers
> > or whether they have some smarter way to use ACPI?
> 
> Usually ACPI exposes 1 or 2 temperature readings (CPU and
> motherboard), while the hw driver can also provide fans and voltages
> measurements.
> 
> Vendors usually provides a monitoring utility for Win that also
> exposes these information. It's not known whether there's a way to
> avoid conflicting accesses between ACPI and the raw driver; it's
> possible that it's vendor-specific and not documented.

I'd be surprised if Windows provided interfaces to coordinate
between two drivers.  My impression is that they really want
to have a single owner for a piece of hardware.  It would be
interesting to figure out how these monitoring utilities work.
Maybe the monitor and the AML both go through an embedded
controller driver and coordinate that way?

Bjorn
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ