Len Brown [Mon, 8 Nov 2004 22:08:42 +0000 (17:08 -0500)]
[ACPI] acpi_pci_irq_enable() now returns 0 on success.
This bubbles all the way up to pci_enable_device().
This allows IRQ0 to be used as a legal PCI device IRQ.
The ES7000 uses an interrupt source override to assign pin20 to IRQ0.
Then platform_rename_gsi assigns pin0 a high-numbered IRQ -- available
for PCI devices. But IRQ0 needs to be a legal PCI IRQ in the lookup code
to make it as far as the re-name code.
Signed-off-by: Natalie Protasevich <Natalie.Protasevich@UNISYS.com> Signed-off-by: Len Brown <len.brown@intel.com>
Implemented support for FADT revision 2. This was an
interim table (between ACPI 1.0 and ACPI 2.0) that adds
support for the FADT reset register.
Implemented optional support to allow uninitialized LocalX
and ArgX variables in a control method. The variables
are initialized to an Integer object with a value
of zero. This support is enabled by setting the
acpi_gbl_enable_interpreter_slack flag to TRUE,
which is default unless booted with "acpi=strict".
Implemented support for Integer objects for the SizeOf
operator. Either 4 or 8 is returned, depending on the
current integer size (32-bit or 64-bit, depending on the
parent table revision).
Fixed a problem in the implementation of the SizeOf and
ObjectType operators where the operand was resolved to
a value too early, causing incorrect return values for
some objects.
Fixed some possible memory leaks during exceptional conditions.
Len Brown [Mon, 1 Nov 2004 21:53:13 +0000 (16:53 -0500)]
[ACPI] Remove default PNPACPI driver binding to legacy ACPI devices.
This conflicted with PNP-aware and ACPI-aware drivers,
and required that its exclude-list carry vendor-specific
driver names, which we can't possibly maintain.
Signed-off-by: David Shaohua Li <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Len Brown [Wed, 27 Oct 2004 22:42:56 +0000 (18:42 -0400)]
[ACPI] create ACPI-based PNP driver.
With this driver, legacy device drivers (floppy ACPI driver,
COM ACPI driver, and ACPI motherboard driver) which
directly use ACPI can be removed, since now we have unified PNP
interface for legacy ACPI enumerated devices.
Originally by Matthieu Castet Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Len Brown [Wed, 27 Oct 2004 21:07:53 +0000 (17:07 -0400)]
[ACPI] C1 fixes when processor driver is loaded
honor "halt=" cmdline parameter
use monitor/mwait when available
http://bugzilla.kernel.org/show_bug.cgi?id=2280
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Note: ACPI CA is currently undergoing an in-depth and
complete formal evaluation to test/verify the following
areas. Other suggestions are welcome. This will result in
an increase in the frequency of releases and the number
of bug fixes in the next few months.
- Functional tests for all ASL/AML operators
- All implicit/explicit type conversions
- Bit fields and operation regions
- 64-bit math support and 32-bit-only "truncated" math support
- Exceptional conditions, both compiler and interpreter
- Dynamic object deletion and memory leaks
- ACPI 3.0 support when implemented
- External interfaces to the ACPI subsystem
Fixed two alignment issues on 64-bit platforms -
within debug statements in acpi_ev_gpe_detect and
acpi_ev_create_gpe_block. Removed references to the
Address field within the non-aligned ACPI generic address
structure.
Fixed a problem in the Increment and Decrement operators
where incorrect operand resolution could result in the
inadvertent modification of the original integer when the
integer is passed into another method as an argument and
the arg is then incremented/decremented.
Fixed a problem in the FromBCD operator where the upper
32-bits of a 64-bit BCD number were truncated during
conversion.
Fixed a problem in the ToDecimal operator where the length
of the resulting string could be set incorrectly too long
if the input operand was a Buffer object.
Fixed a problem in the Logical operators (LLess,
etc.) where a NULL byte (0) within a buffer would
prematurely terminate a compare between buffer objects.
Added a check for string overflow (>200 characters as per
the ACPI specification) during the Concatenate operator
with two string operands.
Signed-off-by: Len Brown <len.brown@intel.com>
Implemented support for the ACPI 3.0 Timer operator. This
ASL function implements a 64-bit timer with 100 nanosecond
granularity.
Defined a new OSL interface, acpi_os_get_timer. This
interface is used to implement the ACPI 3.0 Timer
operator. This allows the host OS to implement the timer
with the best clock available. Also, it keeps the core
subsystem out of the clock handling business, since the
host OS (usually) performs this function.
Fixed an alignment issue on 64-bit platforms. The
hw_low_level_read/write() functions use a 64-bit address
which is part of the packed ACPI Generic Address
Structure. Since the structure is non-aligned, the
alignment macros are now used to extract the address to
a local variable before use.
Fixed a problem where the ToInteger operator assumed all
input strings were hexadecimal. The operator now handles
both decimal strings and hex strings (prefixed with "0x").
Fixed a problem where the string length in the string
object created as a result of the internal ConvertToString
procedure could be incorrect. This potentially affected
all implicit conversions and also the ToDecimalString and
ToHexString operators.
Fixed two problems in the ToString operator. If the
length parameter was zero, an incorrect string object was
created and the value of the input length parameter was
inadvertently changed from zero to Ones.
Fixed a problem where the optional ResourceSource string
in the ExtendedIRQ resource macro was ignored.
Simplified the interfaces to the internal division
functions, reducing code size and complexity.
Signed-off-by: Len Brown <len.brown@intel.com>
Added a new OSL interface, acpi_os_get_timer. This
interface implements a 64-bit monotonic timer in 100
nanosecond units.
Implemented support for the ACPI 3.0 Timer operator.
This 64-bit timer utilizes the timer provided by the
acpi_os_get_timer interface.
Signed-off-by: Len Brown <len.brown@intel.com>
Fixed a problem with the implementation of the LNot()
operator where "Ones" was not returned for the TRUE
case. Changed the code to return Ones instead of (!Arg)
which was usually 1. This change affects iASL constant
folding for this operator also.
Fixed a problem in acpi_ut_initialize_buffer where an
existing buffer was not initialized properly -- Now zero
the entire buffer in this case where the buffer already
exists.
Changed the interface to acpi_os_sleep from (UINT32
Seconds, UINT32 Milliseconds) to simply (ACPI_INTEGER
Milliseconds). This simplifies all related code
considerably. This requires changes/updates to all OS
interface layers (OSLs.)
Implemented a new external interface,
acpi_install_exception_handler, to allow a system exception
handler to be installed. This handler is invoked upon
any run-time exception that occurs during control method
execution.
Added support for the DSDT in acpi_tb_find_table. This
allows the DataTableRegion() operator to access the local
copy of the DSDT.
Signed-off-by: Len Brown <len.brown@intel.com>
Implemented support for implicit object conversion in
the non-numeric logical operators (LEqual, LGreater,
LGreaterEqual, LLess, LLessEqual, and LNotEqual.) Any
combination of Integers/Strings/Buffers may now be used;
the second operand is implicitly converted on the fly to
match the type of the first operand. For example:
LEqual (Source1, Source2)
Source1 and Source2 must each evaluate to an integer, a
string, or a buffer. The data type of Source1 dictates the
required type of Source2. Source2 is implicitly converted
if necessary to match the type of Source1.
Updated and corrected the behavior of the string
conversion support. The rules concerning conversion of
buffers to strings (according to the ACPI specification)
are as follows:
ToDecimalString - explicit byte-wise conversion of buffer
to string of decimal values (0-255) separated by commas.
ToHexString - explicit byte-wise conversion of buffer to
string of hex values (0-FF) separated by commas.
ToString - explicit byte-wise conversion of buffer to
string. Byte-by-byte copy with no transform except NULL
terminated. Any other implicit buffer-to-string conversion
byte-wise conversion of buffer to string of hex values
(0-FF) separated by spaces.
Fixed a problem in acpi_ns_get_pathname_length where the
returned length was one byte too short in the case of a
node in the root scope. This could cause a fault during
debug output.
Len Brown [Mon, 18 Oct 2004 12:28:17 +0000 (08:28 -0400)]
[ACPI] add module parameters: processor.c2=[0,1] processor.c3=[0,1]
to disable/enable C2 or C3
blacklist entries for R40e and Medion 41700
http://bugme.osdl.org/show_bug.cgi?id=3549
Oliver Neukum [Mon, 18 Oct 2004 01:22:09 +0000 (18:22 -0700)]
[PATCH] security issue in firmware system
The firmware loader has a security issue. Firmware on some devices can
write to all memory through DMA. Therefore the ability to feed firmware
to the kernel is equivalent to writing to /dev/kmem. CAP_SYS_RAWIO is
needed to protect itself.
[ Editors note: the firmware file is 0644, and owned by root, so this
"security issue" is really only an issue for people who use
capabilities explicitly, rather than the regular Unix permissions.
This patch makes it do the same checks we do for /dev/mem etc. ]
Signed-Off-By: Oliver Neukum <oliver@neukum.name> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Nathan Lynch [Sun, 17 Oct 2004 02:21:08 +0000 (19:21 -0700)]
[PATCH] ppc64: fix smp_startup_cpu for cpu hotplug
This change is needed in order to allow cpus to be onlined after
boot. This used to work but the declaration of
pseries_secondary_smp_init in this file was changed in Ben's big
cleanup patch a while back, so the cpu would start at a bad address.
Nick Piggin [Sun, 17 Oct 2004 02:20:56 +0000 (19:20 -0700)]
[PATCH] kswapd lockup fix
Fix some bugs in the kswapd logic which can cause kswapd lockups.
The balance_pgdat() logic is supposed to cause kswapd to loop across all zones
in the node until each zone either
a) has enough pages free or
b) is deemed to be in an "all pages unreclaimable" state.
In the latter case, we just give the zone a light scan on each balance_pgdat()
scan and wait for the zone to come back to life again.
But the zone->all_unreclaimable logic is broken - if the zone has no pages on
the LRU at all, we perform no scanning of that zone (of course). So the
zone->pages_scanned is not incremented and the expression
if (zone->pages_scanned > zone->present_pages * 2)
zone->all_unreclaimable = 1;
so if the zone has no LRU pages it will still enter the all_unreclaimable
state.
Another problem is that if the zone has no LRU pages we will tell
shrink_slab() that we scanned zero LRU pages. This causes shrink_slab() to
scan zero slab objects, which is obviously wrong. So change shrink_slab() to
perform a decent chunk of slab scanning in this situation.
And put a cond_resched() into the balance_pgdat() outer loop. Probably
unnecessary, but that's what Jeff had in place when he confirmed that this
patch fixed the lockup :(
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Pavel Machek [Sun, 17 Oct 2004 02:20:42 +0000 (19:20 -0700)]
[PATCH] swsusp: fix x86-64 - do not use memory in copy loop
In assembly code, there are some problems with "nosave" section (linker was
doing something stupid, like duplicating the section). We attempted to fix
it, but fix was worse then first problem. This fixes is for good: We no
longer use any memory in the copy loop. (Plus it fixes indentation and
uses meaningful labels.)
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
As Milton noticed, Anton actually broke the logic if the memory isn't
aligned in the first place. Sorry about this mess for such a little
piece of code. This _really_ fixes is it all
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Anton Blanchard [Sat, 16 Oct 2004 08:03:14 +0000 (01:03 -0700)]
[PATCH] ppc64: fix some issues with mem_reserve
I found a couple of issues with reserve_mem:
- If we try and mem_reserve something of zero length, everything
reserved after it would get ignored. This is because early_reserve_mem
sees a zero length as a terminator.
- The code rounded the top down instead of up.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Nowadays, it's possible to build CONFIG_PPC_PMAC without CONFIG_PPC_PSERIES,
in which case, eeh will not be included in the build (and the eeh checks are
turned into no-ops). However, we then "lose" the iomap functions. This patch
moves them to a separate file.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andrew Morton [Sat, 16 Oct 2004 08:02:35 +0000 (01:02 -0700)]
[PATCH] ext3 direct io assert fix
Fix bug identified by Badari Pulavarty <pbadari@us.ibm.com>
Local variable `handle' will become stale if ext3_direct_io_get_blocks()
closes off the current transaction and starts a new one. This causes a BUG in
journal_stop().
So reacquire the handle from *current after performing the I/O.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
John Rose [Fri, 15 Oct 2004 05:11:26 +0000 (22:11 -0700)]
[PATCH] PCI Hotplug: rpaphp safe list traversal
Hoping you will accept this fix. The bug can cause a crash upon hotplug
remove. The bug involves unsafe traversal of a list while deleting list
members. The fix uses list_for_each_safe() rather than
list_for_each(). Also threw in an initialization to get rid of a
compiler warning.
Signed-off-by: John Rose <johnrose@austin.ibm.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Linus Torvalds [Thu, 14 Oct 2004 04:03:12 +0000 (21:03 -0700)]
Take the whole PCI bus range into account when scanning PCI bridges.
A bridge that has been set up by firmware to cover multiple PCI
buses but doesn't actually have anything connected behind some of
them caused us to use the incorrect maxmimum bus number span when
scanning the bridge chip.
Problem reported by Tim Saunders, with Russell King suggesting
the fix.
Linus Torvalds [Thu, 14 Oct 2004 04:00:06 +0000 (21:00 -0700)]
Fix threaded user page write memory ordering
Make sure we order the writes to a newly created page
with the page table update that potentially exposes the
page to another CPU.
This is a no-op on any architecture where getting the
page table spinlock will already do the ordering (notably
x86), but other architectures can care.
Add a memory barrier to the assembly checksum code - the code was copied
straight from the i386 one, and the patch resyncs the code with the
original. I'll check if the original code can be included directly (i.e.
"#include") after 2.6.9.
Without this patch, every 2.6 UML release corrupts the checksum of every
UDP fragmented packet with size >= MTU (verified by various people, we all
agree on this issue; nobody reported "Works fine here"). The corrupted
packets are not accepted, thus blocking any kind of communication with
large-sized UDP packets.
In fact, I've even dissected the UML -> host traffic before and after this
patch with Ethereal - and it always reported an incorrect checksum for
fragmented UDP packets before and always correct after applying the patch.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] uml: use always a separate io thread for UBD
Currently, ubd=sync is different from replacing ubd#= with ubd#s=. This is
against Principle of Least Surprise, so remove this difference.
Also the current ubd=sync behaviour is completely useless: it is to make sure
that when the kernel has synched its I/O to the virtual disk, the host does
not invalidate this with his caching; this causes ReiserFS corruption.
But since actually we call end_request() only after the io_thread has done its
work, we never lie to the block layer. Using O_SYNC as we do when replacing
ubd#= with ubd#s= is enough.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
From: BlaisorBlade <blaisorblade_spam@yahoo.it>, Chris Wright <chrisw@osdl.org>
Avoid deadlocking onto the request lock in the UBD driver, i.e. don't lock
the queue spinlock when called from the request function.
In detail:
Rename ubd_finish() to __ubd_finish() and remove ubd_io_lock from it. Add
wrapper, ubd_finish(), which grabs lock before calling __ubd_finish(). Update
do_ubd_request to use the lock free __ubd_finish() to avoid deadlock. Also,
apparently prepare_request is called with ubd_io_lock held, so remove locks
there.
Signed-off-by: Chris Wright <chrisw@osdl.org> Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Makes the UML build system work well even under parallel make (tested, so far,
even with -j50). Please notice that it must be updated for every makefile
change. Or better, every makefile change must use correct dependencies (and
they are easy to miss).
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Uml-specific patch (which requires a mainline hook, mailed separately).
This patch avoid the linking kludge which leaves kbuild link vmlinux and then
link it with libc inside linux. This kludge has the big problem of making
kallsyms break, since the kallsyms pass is done on a completely
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] uml: no extraversion in arch/um/Makefile for mainline
Extraversion in arch/um/Makefile is not needed in mainline, but just for
separate patches; also, they should set it in the main Makefile, not elsewhere
(Jeff Garzik has just complained). Also remove the dependency from version.h
on arch/um/Makefile: it was added because arch/um/Makefile could change the
kernel version number.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This forces make to use bash rather than whatever /bin/sh is linked to.
Without this, since there are some bash extensions used in the build and when
/bin/sh isn't bash, then the build fails without a clear error message.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] uml: Set cflags before including arch Makefile
If arch/$(ARCH)/Makefile is included before adding -O2 (and the rest) to
CFLAGS, I must duplicate the addition of it to USER_CFLAGS for UML. So let's
fix this. Also, the below code is useless, since if CONFIG_DEBUG_INFO is y,
then CONFIG_FRAME_POINTER is always y.
Add some updates for API changes in 2.6.8 which were not included in the
original UML patch; these fixes were detected by some warnings, so I probably
missed some more ones.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
James Morris [Wed, 13 Oct 2004 14:28:10 +0000 (07:28 -0700)]
[PATCH] SELinux: fix bugs in mprotect hook
The patch below by Roland McGrath fixes two bugs in the implementation of
the selinux_file_mprotect hook:
It calls selinux_file_mmap, which has two problems. First, the stacked
security module will get both mmap and mprotect callbacks for an
mprotect call, which is wrong. Secondly, the vm_flags value contains
VM_* bits, and these do not match the MAP_* bits of the same name or
function, so it passes bogus flags and causes every mprotect to be
treated as if MAP_SHARED were in use.
The patch shares the common code while not having one function call the
other, and fixes these two bugs.
Signed-off-by: James Morris <jmorris@redhat.com> Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This fixes a bug in SELinux to retain the ptracer SID (if any) across fork.
Otherwise, SELinux will always deny attempts by traced children to exec
domain-changing programs even if the policy would have allowed the tracer
to trace the new domains as well.
Signed-off-by: Stephen Smalley <sds@epoch.ncsc.mil> Signed-off-by: James Morris <jmorris@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Tim Schmielau [Wed, 13 Oct 2004 14:27:49 +0000 (07:27 -0700)]
[PATCH] Fix reporting of process start times
Derive process start times from the posix_clock_monotonic notion of uptime
instead of "jiffies", consistent with the earlier change to /proc/uptime
itself.
(http://linus.bkbits.net:8080/linux-2.5/cset@3ef4851dGg0fxX58R9Zv8SIq9fzNmQ?na%0Av=index.html|src/.|src/fs|src/fs/proc|related/fs/proc/proc_misc.c)
Process start times are reported to userspace in units of 1/USER_HZ since
boot, thus applications as procps need the value of "uptime" to convert
them into absolute time.
Currently "uptime" is derived from an ntp-corrected time base, but process
start time is derived from the free-running "jiffies" counter. This
results in inaccurate, drifting process start times as seen by the user,
even if the exported number stays constant, because the users notion of
"jiffies" changes in time.
It's John Stultz's patch anyways, which I only messed up a bit, but since
people started trading signed-off lines on lkml:
Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>