]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
16 years agoMerge branch 'cpus4096' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux...
Ingo Molnar [Fri, 13 Mar 2009 04:54:55 +0000 (05:54 +0100)]
Merge branch 'cpus4096' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-x86 into cpus4096

16 years agoMerge commit 'v2.6.29-rc8' into cpus4096
Ingo Molnar [Fri, 13 Mar 2009 04:54:43 +0000 (05:54 +0100)]
Merge commit 'v2.6.29-rc8' into cpus4096

16 years agosoftirq: no need to have SOFTIRQ in softirq name
Steven Rostedt [Fri, 13 Mar 2009 04:43:33 +0000 (00:43 -0400)]
softirq: no need to have SOFTIRQ in softirq name

Impact: clean up

It is redundant to have 'SOFTIRQ' in the softirq names.

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
16 years agox86: fix e820_update_range()
Yinghai Lu [Fri, 13 Mar 2009 04:35:18 +0000 (21:35 -0700)]
x86: fix e820_update_range()

Impact: fix left range size on head

| commit 5c0e6f035df983210e4d22213aed624ced502d3d
|    x86: fix code paths used by update_mptable
|    Impact: fix crashes under Xen due to unrobust e820 code

fixes one e820 bug, but introduces another bug.

Need to update size for left range at first in case it is header.

also add __e820_add_region take more parameter.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: jbeulich@novell.com
LKML-Reference: <49B9E286.502@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agotracing: move binary buffers into per cpu directory
Steven Rostedt [Fri, 13 Mar 2009 04:37:42 +0000 (00:37 -0400)]
tracing: move binary buffers into per cpu directory

The binary_buffers directory in /debugfs/tracing held the files
to read the trace buffers in a binary format. This held one file
per CPU buffer. But we also have a per_cpu directory that holds
a way to read the pretty-print formats.

This patch moves the binary buffers into the per_cpu_directory:

 # ls /debug/tracing/per_cpu/cpu1/
trace  trace_pipe  trace_pipe_raw

The new name is called "trace_pipe_raw". The binary buffers always
acted similar to trace_pipe, except that they produce raw data.

Requested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
16 years agodrm/radeon: r600 ptes are 64-bit, cleanup cleanup function.
Dave Airlie [Thu, 12 Mar 2009 23:35:32 +0000 (09:35 +1000)]
drm/radeon: r600 ptes are 64-bit, cleanup cleanup function.

Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/radeon: don't call irq changes on r600 suspend/resume
Dave Airlie [Tue, 10 Mar 2009 08:36:38 +0000 (18:36 +1000)]
drm/radeon: don't call irq changes on r600 suspend/resume

Until we sort out r600 IRQs don't do this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/radeon: fix r600 writeback across suspend/resume
Dave Airlie [Tue, 10 Mar 2009 08:34:23 +0000 (18:34 +1000)]
drm/radeon: fix r600 writeback across suspend/resume

This update was done in mainline radeon, but not in the r600.

Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/radeon: fix r600 writeback setup.
Dave Airlie [Mon, 9 Mar 2009 05:31:20 +0000 (15:31 +1000)]
drm/radeon: fix r600 writeback setup.

This fixes 2 bugs:
1. the AGP calculation wasn't consistent with the PCI(E) calc for the
RPTR_ADDR registers. This consolidates the writes and fixes it up.

2. The scratch address was being incorrectly calculated, this breaks
it out into a lot more linear steps.

Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm: fix warnings about new mappings in info code.
Dave Airlie [Mon, 9 Mar 2009 02:47:18 +0000 (12:47 +1000)]
drm: fix warnings about new mappings in info code.

This fixes up the warnings in the debugfs code that conflicted
with the mapping fixups.

Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/radeon: NULL noise: drivers/gpu/drm/radeon/radeon_*.c
Hannes Eder [Thu, 5 Mar 2009 19:14:18 +0000 (20:14 +0100)]
drm/radeon: NULL noise: drivers/gpu/drm/radeon/radeon_*.c

Fix this sparse warning:
  drivers/gpu/drm/radeon/r600_cp.c:1811:52: warning: Using plain integer as NULL pointer
  drivers/gpu/drm/radeon/radeon_cp.c:1363:52: warning: Using plain integer as NULL pointer
  drivers/gpu/drm/radeon/radeon_state.c:1983:61: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/radeon: fix r600 pci mapping calls.
Dave Airlie [Mon, 9 Mar 2009 02:17:08 +0000 (12:17 +1000)]
drm/radeon: fix r600 pci mapping calls.

This realigns the r600 pci mapping calls with the ati pcigart ones,
fixing the direction and using the correct interface.

Suggested by Jerome Glisse.

Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/radeon: r6xx/r7xx: fix possible oops in r600_page_table_cleanup()
Alex Deucher [Sat, 7 Mar 2009 23:21:21 +0000 (18:21 -0500)]
drm/radeon: r6xx/r7xx: fix possible oops in r600_page_table_cleanup()

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agoradeon: call the correct idle function, logic got inverted.
Dave Airlie [Mon, 9 Mar 2009 02:12:28 +0000 (12:12 +1000)]
radeon: call the correct idle function, logic got inverted.

This calls the correct idle function for the R600 and previous chips.

Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/radeon: RS600: fix interrupt handling
Alex Deucher [Fri, 6 Mar 2009 16:47:54 +0000 (11:47 -0500)]
drm/radeon: RS600: fix interrupt handling

the checks weren't updated when RS600 support
was added.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
16 years agodrm/r600: fix rptr address along lines of previous fixes to radeon.
Dave Airlie [Thu, 26 Feb 2009 00:15:24 +0000 (10:15 +1000)]
drm/r600: fix rptr address along lines of previous fixes to radeon.

Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/r600: fixup r600 gart table accessor like ati_pcigart.c
Dave Airlie [Thu, 26 Feb 2009 00:14:40 +0000 (10:14 +1000)]
drm/r600: fixup r600 gart table accessor like ati_pcigart.c

This attempts to fixup the r600 GART accessors so they work on other arches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/ati_pcigart: use memset_io to reset the memory
Dave Airlie [Thu, 26 Feb 2009 00:13:47 +0000 (10:13 +1000)]
drm/ati_pcigart: use memset_io to reset the memory

Also don't setup pci_gart if we aren't going to need it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm: add DRM_READ/WRITE64 wrappers around readq/writeq.
Dave Airlie [Thu, 26 Feb 2009 00:12:10 +0000 (10:12 +1000)]
drm: add DRM_READ/WRITE64 wrappers around readq/writeq.

The readq/writeq stuff is from Dave Miller, and he
warns users to be careful about using these. Plans are only
r600 to use it so far.

Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agoradeon: add RS600 pci ids
Alex Deucher [Wed, 25 Feb 2009 22:02:19 +0000 (17:02 -0500)]
radeon: add RS600 pci ids

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agoradeon: add support for rs600 GPUs
Alex Deucher [Wed, 25 Feb 2009 21:57:49 +0000 (16:57 -0500)]
radeon: add support for rs600 GPUs

RS600s are an AMD IGP for Intel CPUs, that look like RS690s from
a lot of perspectives but look like r600s from a memory controller
point of view.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agoradeon: fix r600 AGP support
Alex Deucher [Wed, 25 Feb 2009 20:55:01 +0000 (15:55 -0500)]
radeon: fix r600 AGP support

This fixes the ioremap issues with r600 AGP.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agoradeon: add R6xx/R7xx pci ids
Alex Deucher [Tue, 24 Feb 2009 22:13:42 +0000 (17:13 -0500)]
radeon: add R6xx/R7xx pci ids

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/radeon: add initial support for R6xx/R7xx GPUs
Alex Deucher [Tue, 24 Feb 2009 21:22:29 +0000 (16:22 -0500)]
drm/radeon: add initial support for R6xx/R7xx GPUs

This adds support for 2D/Xv acceleration in the X.org 2D driver,
to the drm. It doesn't yet provide any 3D support hooks.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/radeon: add r6xx/r7xx microcode
Alex Deucher [Tue, 24 Feb 2009 19:28:34 +0000 (14:28 -0500)]
drm/radeon: add r6xx/r7xx microcode

This uses the same microcode system as the current radeon code.

It should be converted to the new microcode loader I suppose,
though really I need a lot more proof of the worth of me maintaining
firmware blobs externally.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/radeon: prep for r6xx/r7xx support
Alex Deucher [Tue, 24 Feb 2009 19:02:13 +0000 (14:02 -0500)]
drm/radeon: prep for r6xx/r7xx support

- add r6xx/r7xx regs and macros
- add r6xx/r7xx chip families
- fix register access for regs with offsets >= 0x10000

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agoi915/drm: Remove two redundant agp_chipset_flushes
Owain G. Ainsworth [Fri, 20 Feb 2009 08:30:19 +0000 (08:30 +0000)]
i915/drm: Remove two redundant agp_chipset_flushes

agp_chipset_flush() is for flushing the intel GMCH write cache via the
IFP, these two uses are for when we're getting the object into the cpu
READ domain, and thus should not be needed. This confused me when I was
getting my head around the code.

With thanks to airlied for helping me check my mental picture of how the
flushes and clflushes are supposed to be used.

Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/i915: Display fence register state in debugfs i915_gem_fence_regs node.
Chris Wilson [Wed, 11 Feb 2009 14:26:38 +0000 (14:26 +0000)]
drm/i915: Display fence register state in debugfs i915_gem_fence_regs node.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/i915: Add information on pinning and fencing to the i915 list debug.
Eric Anholt [Wed, 18 Feb 2009 07:53:41 +0000 (23:53 -0800)]
drm/i915: Add information on pinning and fencing to the i915 list debug.

This was inspired by a patch by Chris Wilson, though none of it applied in any
way due to the debugfs work and I decided to change the formatting of the
new information anyway.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/i915: Consolidate gem object list dumping
Ben Gamari [Wed, 18 Feb 2009 01:08:51 +0000 (20:08 -0500)]
drm/i915: Consolidate gem object list dumping

Here we eliminate a few functions in favor of using a single function
to dump from all of the object lists.

Signed-Off-By: Ben Gamari <bgamari@gmail.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm: Convert proc files to seq_file and introduce debugfs
Ben Gamari [Wed, 18 Feb 2009 01:08:49 +0000 (20:08 -0500)]
drm: Convert proc files to seq_file and introduce debugfs

The old mechanism to formatting proc files is extremely ugly. The
seq_file API was designed specifically for cases like this and greatly
simplifies the process.

Also, most of the files in /proc really don't belong there. This patch
introduces the infrastructure for putting these into debugfs and exposes
all of the proc files in debugfs as well.

This contains the i915 hooks rewrite as well, to make bisectability better.

Signed-off-by: Ben Gamari <bgamari@gmail.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/radeon: split busmaster enable out to a separate function
Dave Airlie [Fri, 20 Feb 2009 03:28:59 +0000 (13:28 +1000)]
drm/radeon: split busmaster enable out to a separate function

this is just a code cleanup from the kms tree.

Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/radeon: align ring writes to 16 dwords boundaries.
Dave Airlie [Fri, 20 Feb 2009 03:28:34 +0000 (13:28 +1000)]
drm/radeon: align ring writes to 16 dwords boundaries.

On some radeon GPUs this appears to introduce another level of
stability around interacting with the ring.

Its pretty much what fglrx appears to do.

Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm/radeon: Print PCI ID of cards when probing
Benjamin Herrenschmidt [Fri, 6 Feb 2009 05:46:27 +0000 (16:46 +1100)]
drm/radeon: Print PCI ID of cards when probing

This is usedul when you have multiple cards to figure out which
one is which minor.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm: Only use DRM_IOCTL_UPDATE_DRAW compat wrapper for compat X86.
David Miller [Wed, 18 Feb 2009 09:35:21 +0000 (01:35 -0800)]
drm: Only use DRM_IOCTL_UPDATE_DRAW compat wrapper for compat X86.

Only X86 32-bit uses a different alignment for "unsigned long long"
than it's 64-bit counterpart.

Therefore this compat translation is only correct, and only needed,
when either CONFIG_X86 or CONFIG_IA64.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm: radeon: Fix unaligned access in r300_scratch().
David Miller [Wed, 18 Feb 2009 09:35:23 +0000 (01:35 -0800)]
drm: radeon: Fix unaligned access in r300_scratch().

In compat mode, the cmdbuf->buf 64-bit address cookie can
potentially be only 32-bit aligned.  Dereferencing this as
64-bit causes expensive unaligned traps on platforms like
sparc64.

Use get_unaligned() to fix.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm: Preserve SHMLBA bits in hash key for _DRM_SHM mappings.
David Miller [Wed, 18 Feb 2009 23:41:02 +0000 (15:41 -0800)]
drm: Preserve SHMLBA bits in hash key for _DRM_SHM mappings.

Platforms such as sparc64 have D-cache aliasing issues.  We
cannot allow virtual mappings in different contexts to be such
that two cache lines can be loaded for the same backing data.
Updates to one cache line won't be seen by accesses to the other
cache line.

Code in sparc64 and other architectures solve this problem by
making sure that all userland mappings of MAP_SHARED objects have
the same virtual address base.  They implement this by keying
off of the page offset, and using that to choose a suitably
consistent virtual address for mmap() requests.

Making things even worse, getting this wrong on sparc64 can result
in hangs during DRM lock acquisition.  This is because, at least on
UltraSPARC-III, normal loads consult the D-cache but atomics such
as 'cas' (which is what cmpxchg() is implement using) only consult
the L2 cache.  So if a D-cache alias is inserted, the load can
see different data than the atomic, and we'll loop forever because
the atomic compare-and-exchange will never complete successfully.

So to make this all work properly, we need to make sure that the
hash address computed by drm_map_handle() preserves the SHMLBA
relevant bits, and that's what this patch does for _DRM_SHM mappings.

As a historical note, many years ago this bug didn't exist because we
used to just use the low 32-bits of the address as the hash and just
hope for the best.  This preserved the SHMLBA bits properly.  But when
the hashtab code was added to DRM, this was no longer the case.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
16 years agodrm: ati_pcigart: Fix limit check in drm_ati_pcigart_init().
David Miller [Sun, 15 Feb 2009 09:08:07 +0000 (01:08 -0800)]
drm: ati_pcigart: Fix limit check in drm_ati_pcigart_init().

The variable 'max_pages' is ambiguous.  There are two concepts
of "pages" being used in this function.

First, we have ATI GART pages which are always 4096 bytes.
Then, we have system pages which are of size PAGE_SIZE.

Eliminate the confusion by creating max_ati_pages and
max_real_pages.  Calculate and use them as appropriate.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
16 years agodrm: radeon: Use surface for PCI GART table.
David Miller [Sat, 14 Feb 2009 09:51:07 +0000 (01:51 -0800)]
drm: radeon: Use surface for PCI GART table.

This allocates a physical surface for the PCI GART table, this way no
matter what other surface configurations exist the GART table will
always be seen by the hardware properly.

We encode the file pointer of the virtual surface allocate using a
special cookie value, called PCIGART_FILE_PRIV.  On the last close, we
release that surface.

Just to be doubly safe, we run the pcigart table setup with the main
surface control register clear.

Based upon ideas from David Airlie and Ben Benjamin Herrenschmidt.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
16 years agodrm: radeon: Fix calculation of RB_RPTR_ADDR in non-AGP case.
David Miller [Thu, 12 Feb 2009 10:15:44 +0000 (02:15 -0800)]
drm: radeon: Fix calculation of RB_RPTR_ADDR in non-AGP case.

The address needs to be a GART relative address, rather than a PCI
DMA address.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
16 years agodrm: radeon: Fix RADEON_*_EMITED defines.
David Miller [Thu, 12 Feb 2009 10:15:39 +0000 (02:15 -0800)]
drm: radeon: Fix RADEON_*_EMITED defines.

These are not supposed to be booleans, they are
supposed to be bit masks.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
16 years agodrm: radeon: Fix ring_rptr accesses.
David Miller [Thu, 12 Feb 2009 10:15:37 +0000 (02:15 -0800)]
drm: radeon: Fix ring_rptr accesses.

The memory behind ring_rptr can either be in ioremapped memory
or a vmalloc() normal kernel memory buffer.

However, the code unconditionally uses DRM_{READ,WRITE}32() (and thus
readl() and writel()) to access it.

Basically, if RADEON_IS_AGP then it's ioremap()'d memory else it's
vmalloc'd memory.

Adjust all of the ring_rptr access code as needed.

While we're here, kill the 'scratch' pointer in drm_radeon_private.
It's only used in the one place where it is initialized.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
16 years agodrm: ati_pcigart: Need to use PCI_DMA_BIDIRECTIONAL.
David Miller [Thu, 12 Feb 2009 10:15:34 +0000 (02:15 -0800)]
drm: ati_pcigart: Need to use PCI_DMA_BIDIRECTIONAL.

The buffers mapped by the PCI GART can be written to by the device,
not just read.

For example, this happens via the RB_RPTR writeback on Radeon.

So we can't use PCI_DMA_TODEVICE else we'll get protection faults
on IOMMU platforms.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
16 years agodrm: ati_pcigart: Do not access I/O MEM space using pointer derefs.
David Miller [Thu, 12 Feb 2009 10:15:27 +0000 (02:15 -0800)]
drm: ati_pcigart: Do not access I/O MEM space using pointer derefs.

The PCI GART table initialization code treats the GART table mapping
unconditionally as a kernel virtual address.

But it could be in the framebuffer, for example, and thus we're
dealing with a PCI MEM space ioremap() cookie.  Treating that as a
virtual address is illegal and will crash some system types (such as
sparc64 where the ioremap() return value is actually a physical I/O
address).

So access the area correctly, using gart_info->gart_table_location as
our guide.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
16 years agodrm: Drop unused and broken dri_library_name sysfs attribute.
Kristian Høgsberg [Mon, 5 Jan 2009 21:10:05 +0000 (16:10 -0500)]
drm: Drop unused and broken dri_library_name sysfs attribute.

The kernel shouldn't be in the business of telling user space which
driver to load.  The kernel defers mapping PCI IDs to module names
to user space and we should do the same for DRI drivers.

And in fact, that's how it does work today.  Nothing uses the
dri_library_name attribute, and the attribute is in fact broken.
For intel devices, it falls back to the default behaviour of returning
the kernel module name as the DRI driver name, which doesn't work for
i965 devices.  Nobody has ever hit this problem or filed a bug about this.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
16 years agodrm: claim PCI device when running in modesetting mode.
Kristian Høgsberg [Sun, 4 Jan 2009 21:55:33 +0000 (16:55 -0500)]
drm: claim PCI device when running in modesetting mode.

Under kernel modesetting, we manage the device at all times, regardless
of VT switching and X servers, so the only decent thing to do is to
claim the PCI device.  In that case, we call the suspend/resume hooks
directly from the pci driver hooks instead of the current class device detour.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
16 years agodrm: Make drm_local_map use a resource_size_t offset
Benjamin Herrenschmidt [Mon, 2 Feb 2009 05:55:47 +0000 (16:55 +1100)]
drm: Make drm_local_map use a resource_size_t offset

This changes drm_local_map to use a resource_size for its "offset"
member instead of an unsigned long, thus allowing 32-bit machines
with a >32-bit physical address space to be able to store there
their register or framebuffer addresses when those are above 4G,
such as when using a PCI video card on a recent AMCC 440 SoC.

This patch isn't as "trivial" as it sounds: A few functions needed
to have some unsigned long/int changed to resource_size_t and a few
printk's had to be adjusted.

But also, because userspace isn't capable of passing such offsets,
I had to modify drm_find_matching_map() to ignore the offset passed
in for maps of type _DRM_FRAMEBUFFER or _DRM_REGISTERS.

If we ever support multiple _DRM_FRAMEBUFFER or _DRM_REGISTERS maps
for a given device, we might have to change that trick, but I don't
think that happens on any current driver.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
16 years agodrm: Split drm_map and drm_local_map
Benjamin Herrenschmidt [Mon, 2 Feb 2009 05:55:46 +0000 (16:55 +1100)]
drm: Split drm_map and drm_local_map

Once upon a time, the DRM made the distinction between the drm_map
data structure exchanged with user space and the drm_local_map used
in the kernel.

For some reasons, while the BSD port still has that "feature", the
linux part abused drm_map for kernel internal usage as the local
map only existed as a typedef of the struct drm_map.

This patch fixes it by declaring struct drm_local_map separately
(though its content is currently identical to the userspace variant),
and changing the kernel code to only use that, except when it's a
user<->kernel interface (ie. ioctl).

This allows subsequent changes to the in-kernel format

I've also replaced the use of drm_local_map_t with struct drm_local_map
in a couple of places. Mostly by accident but they are the same (the
former is a typedef of the later) and I have some remote plans and
half finished patch to completely kill the drm_local_map_t typedef
so I left those bits in.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
16 years agodrm: Use resource_size_t for drm_get_resource_{start, len}
Benjamin Herrenschmidt [Mon, 2 Feb 2009 05:55:45 +0000 (16:55 +1100)]
drm: Use resource_size_t for drm_get_resource_{start, len}

The DRM uses its own wrappers to obtain resources from PCI devices,
which currently convert the resource_size_t into an unsigned long.

This is broken on 32-bit platforms with >32-bit physical address
space.

This fixes them, along with a few occurences of unsigned long used
to store such a resource in drivers.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
16 years agocpumask: remove x86 cpumask_t uses.
Rusty Russell [Fri, 13 Mar 2009 04:19:57 +0000 (14:49 +1030)]
cpumask: remove x86 cpumask_t uses.

Impact: cleanup

We are removing cpumask_t in favour of struct cpumask: mainly as a
marker of what code is now CONFIG_CPUMASK_OFFSTACK-safe.

The only non-trivial change here is vector_allocation_domain():
explicitly clear the mask and set the first word, rather than using
assignment.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agocpumask: use cpumask_var_t in uv_flush_tlb_others.
Rusty Russell [Fri, 13 Mar 2009 04:19:57 +0000 (14:49 +1030)]
cpumask: use cpumask_var_t in uv_flush_tlb_others.

Impact: remove cpumask_t, reduce per-cpu size for CONFIG_CPUMASK_OFFSTACK=y

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agocpumask: remove cpumask_t assignment from vector_allocation_domain()
Rusty Russell [Fri, 13 Mar 2009 04:19:56 +0000 (14:49 +1030)]
cpumask: remove cpumask_t assignment from vector_allocation_domain()

Impact: cleanup

It's not legal to do assignments into cpumask_var_t; they will soon be of
variable length.

So explicitly clear the mask and set the first word, rather than using
assignment.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agocpumask: make Xen use the new operators.
Rusty Russell [Fri, 13 Mar 2009 04:19:56 +0000 (14:49 +1030)]
cpumask: make Xen use the new operators.

Impact: cleanup

In particular, *map are deprecated, and you have to use the accessors
as *mask are const.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
To: Jeremy Fitzhardinge <jeremy@xensource.com>

16 years agocpumask: clean up summit's send_IPI functions
Rusty Russell [Fri, 13 Mar 2009 04:19:55 +0000 (14:49 +1030)]
cpumask: clean up summit's send_IPI functions

Impact: cleanup, remove cpumask from stack

summit_send_IPI_allbutself might as well call
default_send_IPI_mask_allbutself_logical().  Also change cpumask_t to
struct cpumask and &cpu_online_map to cpu_online_mask while here.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agocpumask: use new cpumask functions throughout x86
Rusty Russell [Fri, 13 Mar 2009 04:19:54 +0000 (14:49 +1030)]
cpumask: use new cpumask functions throughout x86

Impact: cleanup

1) &cpu_online_map -> cpu_online_mask
2) first_cpu/next_cpu_nr -> cpumask_first/cpumask_next
3) cpu_*_map manipulation -> init_cpu_* / set_cpu_*

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agox86: unify cpu_callin_mask/cpu_callout_mask/cpu_initialized_mask/cpu_sibling_setup_mask
Rusty Russell [Fri, 13 Mar 2009 04:19:54 +0000 (14:49 +1030)]
x86: unify cpu_callin_mask/cpu_callout_mask/cpu_initialized_mask/cpu_sibling_setup_mask

Impact: cleanup

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agocpumask: convert struct cpuinfo_x86's llc_shared_map to cpumask_var_t
Rusty Russell [Fri, 13 Mar 2009 04:19:53 +0000 (14:49 +1030)]
cpumask: convert struct cpuinfo_x86's llc_shared_map to cpumask_var_t

Impact: reduce kernel memory usage when CONFIG_CPUMASK_OFFSTACK=y

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agocpumask: convert node_to_cpumask_map[] to cpumask_var_t
Rusty Russell [Fri, 13 Mar 2009 04:19:53 +0000 (14:49 +1030)]
cpumask: convert node_to_cpumask_map[] to cpumask_var_t

Impact: reduce kernel memory usage when CONFIG_CPUMASK_OFFSTACK=y

Straightforward conversion: done for 32 and 64 bit kernels.
node_to_cpumask_map is now a cpumask_var_t array.

64-bit used to be a dynamic cpumask_t array, and 32-bit used to be a
static cpumask_t array.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agox86: unify 32 and 64-bit node_to_cpumask_map
Rusty Russell [Fri, 13 Mar 2009 04:19:52 +0000 (14:49 +1030)]
x86: unify 32 and 64-bit node_to_cpumask_map

Impact: cleanup

We take the 64-bit code and use it on 32-bit as well.  The new file
is called mm/numa.c.

In a minor cleanup, we use cpu_none_mask instead of declaring a local
cpu_mask_none.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agocpumask: remove x86's node_to_cpumask now everyone uses cpumask_of_node
Rusty Russell [Fri, 13 Mar 2009 04:19:52 +0000 (14:49 +1030)]
cpumask: remove x86's node_to_cpumask now everyone uses cpumask_of_node

Impact: cleanup

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agox86: arch_send_call_function_ipi_mask
Rusty Russell [Fri, 13 Mar 2009 04:19:51 +0000 (14:49 +1030)]
x86: arch_send_call_function_ipi_mask

Impact: implement new API

We define arch_send_call_function_ipi_mask and generic kernel/smp.c
code creates arch_send_call_function_ipi() as a wrapper.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agocpumask: convert arch/x86/kernel/cpu/mcheck/mce_64.c
Rusty Russell [Fri, 13 Mar 2009 04:19:51 +0000 (14:49 +1030)]
cpumask: convert arch/x86/kernel/cpu/mcheck/mce_64.c

Impact: reduce kernel memory usage when CONFIG_CPUMASK_OFFSTACK=y

Simple conversion of mce_device_initialized to cpumask_var_t.  We don't
check the alloc_cpumask_var() return since it's boot-time only, and
the misc_register() in that same function isn't checked.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agocpumask: x86: convert cpu_sibling_map/cpu_core_map to cpumask_var_t
Rusty Russell [Fri, 13 Mar 2009 04:19:50 +0000 (14:49 +1030)]
cpumask: x86: convert cpu_sibling_map/cpu_core_map to cpumask_var_t

Impact: reduce per-cpu size for CONFIG_CPUMASK_OFFSTACK=y

In most places it's cleaner to use the accessors cpu_sibling_mask()
and cpu_core_mask() wrappers which already exist.

I couldn't avoid cleaning up the access in oprofile, either.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agocpumask: convert arch/x86/kernel/nmi.c's backtrace_mask to a cpumask_var_t
Rusty Russell [Fri, 13 Mar 2009 04:19:49 +0000 (14:49 +1030)]
cpumask: convert arch/x86/kernel/nmi.c's backtrace_mask to a cpumask_var_t

Impact: cleanup, reduce memory usage for CONFIG_CPUMASK_OFFSTACK=y

I *think* every path calls check_nmi_watchdog before using the
watchdog, so that's the right place for the initialization.

If that's wrong, we'll get a nice NULL-deref with
CONFIG_CPUMASK_OFFSTACK=y, and have uncovered another bug.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agocpumask: convert c1e_mask in arch/x86/kernel/process.c to cpumask_var_t.
Rusty Russell [Fri, 13 Mar 2009 04:19:49 +0000 (14:49 +1030)]
cpumask: convert c1e_mask in arch/x86/kernel/process.c to cpumask_var_t.

Impact: reduce kernel size when CONFIG_CPUMASK_OFFSTACK=y

Simple conversion.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agocpumask: remove obsolete topology_core_siblings and topology_thread_siblings: x86
Rusty Russell [Fri, 13 Mar 2009 04:19:48 +0000 (14:49 +1030)]
cpumask: remove obsolete topology_core_siblings and topology_thread_siblings: x86

Impact: cleanup

There were replaced by topology_core_cpumask and topology_thread_cpumask.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agocpumask: remove cpu_coregroup_map: x86
Rusty Russell [Fri, 13 Mar 2009 04:19:48 +0000 (14:49 +1030)]
cpumask: remove cpu_coregroup_map: x86

Impact: cleanup

cpu_coregroup_mask is the New Hotness.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agocpumask: remove the now-obsoleted pcibus_to_cpumask(): x86
Rusty Russell [Fri, 13 Mar 2009 04:19:47 +0000 (14:49 +1030)]
cpumask: remove the now-obsoleted pcibus_to_cpumask(): x86

Impact: reduce stack usage for large NR_CPUS

cpumask_of_pcibus() is the new version.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agocpumask: remove dangerous CPU_MASK_ALL_PTR, &CPU_MASK_ALL.: x86
Rusty Russell [Fri, 13 Mar 2009 04:19:47 +0000 (14:49 +1030)]
cpumask: remove dangerous CPU_MASK_ALL_PTR, &CPU_MASK_ALL.: x86

Impact: cleanup

(Thanks to Al Viro for reminding me of this, via Ingo)

CPU_MASK_ALL is the (deprecated) "all bits set" cpumask, defined as so:

#define CPU_MASK_ALL (cpumask_t) { { ... } }

Taking the address of such a temporary is questionable at best,
unfortunately 321a8e9d (cpumask: add CPU_MASK_ALL_PTR macro) added
CPU_MASK_ALL_PTR:

#define CPU_MASK_ALL_PTR (&CPU_MASK_ALL)

Which formalizes this practice.  One day gcc could bite us over this
usage (though we seem to have gotten away with it so far).

So replace everywhere which used &CPU_MASK_ALL or CPU_MASK_ALL_PTR
with the modern "cpu_all_mask" (a real const struct cpumask *), and remove
CPU_MASK_ALL_PTR altogether.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Ingo Molnar <mingo@elte.hu>
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Mike Travis <travis@sgi.com>
16 years agocpumask: replace node_to_cpumask with cpumask_of_node.
Rusty Russell [Fri, 13 Mar 2009 04:19:46 +0000 (14:49 +1030)]
cpumask: replace node_to_cpumask with cpumask_of_node.

Impact: cleanup

node_to_cpumask (and the blecherous node_to_cpumask_ptr which
contained a declaration) are replaced now everyone implements
cpumask_of_node.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agocpumask: use topology_core_cpumask/topology_thread_cpumask instead of cpu_core_map...
Rusty Russell [Fri, 13 Mar 2009 04:19:46 +0000 (14:49 +1030)]
cpumask: use topology_core_cpumask/topology_thread_cpumask instead of cpu_core_map/cpu_sibling_map

Impact: cleanup

This is presumably what those definitions are for, and while all archs
define cpu_core_map/cpu_sibling map, that's changing (eg. x86 wants to
change it to a pointer).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
16 years agoV4L/DVB (10972): zl10353: i2c_gate_ctrl bug fix
Antti Palosaari [Tue, 10 Mar 2009 16:06:40 +0000 (13:06 -0300)]
V4L/DVB (10972): zl10353: i2c_gate_ctrl bug fix

zl10353 i2c-gate was always closed and due to that devices having tuner
behind i2c-gate were broken. Add module configuration which allows disabling
i2c-gate only when really needed.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
16 years agotracing: add comment for use of double __builtin_consant_p
Steven Rostedt [Fri, 13 Mar 2009 04:12:52 +0000 (00:12 -0400)]
tracing: add comment for use of double __builtin_consant_p

Impact: documentation

The use of the double __builtin_contant_p checks in the event_trace_printk
can be confusing to developers and reviewers. This patch adds a comment
to explain why it is there.

Requested-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
LKML-Reference: <20090313122235.43EB.A69D9226@jp.fujitsu.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
16 years agotracing: left align location header in stack_trace
Steven Rostedt [Fri, 13 Mar 2009 04:00:58 +0000 (00:00 -0400)]
tracing: left align location header in stack_trace

Ingo Molnar suggested, instead of:

        Depth    Size      Location    (27 entries)
        -----    ----      --------
  0)     2880      48   lock_timer_base+0x2b/0x4f
  1)     2832      80   __mod_timer+0x33/0xe0
  2)     2752      16   __ide_set_handler+0x63/0x65

To have it be:

        Depth    Size   Location    (27 entries)
        -----    ----   --------
  0)     2880      48   lock_timer_base+0x2b/0x4f
  1)     2832      80   __mod_timer+0x33/0xe0
  2)     2752      16   __ide_set_handler+0x63/0x65

Requested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
16 years agocpuacct: reduce one NULL check in fast-path
Li Zefan [Thu, 12 Mar 2009 01:23:01 +0000 (09:23 +0800)]
cpuacct: reduce one NULL check in fast-path

Impact: micro-optimization

In cpuacct_charge(), task_ca() will never return NULL, so change
for(...) to do { } while(...) to save one NULL check.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Menage <menage@google.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Bharata B Rao <bharata@linux.vnet.ibm.com>
LKML-Reference: <49B863F5.2060400@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoMerge branches 'sched/clock', 'sched/urgent' and 'linus' into sched/core
Ingo Molnar [Fri, 13 Mar 2009 03:50:44 +0000 (04:50 +0100)]
Merge branches 'sched/clock', 'sched/urgent' and 'linus' into sched/core

16 years agoMerge branch 'tip/tracing/ftrace' of git://git.kernel.org/pub/scm/linux/kernel/git...
Ingo Molnar [Fri, 13 Mar 2009 03:34:09 +0000 (04:34 +0100)]
Merge branch 'tip/tracing/ftrace' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into tracing/ftrace

16 years agoMerge branches 'tracing/ftrace' and 'linus' into tracing/core
Ingo Molnar [Fri, 13 Mar 2009 03:33:17 +0000 (04:33 +0100)]
Merge branches 'tracing/ftrace' and 'linus' into tracing/core

16 years agoVM, x86, PAT: Change is_linear_pfn_mapping to not use vm_pgoff
Pallipadi, Venkatesh [Fri, 13 Mar 2009 00:45:27 +0000 (17:45 -0700)]
VM, x86, PAT: Change is_linear_pfn_mapping to not use vm_pgoff

Impact: fix false positive PAT warnings - also fix VirtalBox hang

Use of vma->vm_pgoff to identify the pfnmaps that are fully
mapped at mmap time is broken. vm_pgoff is set by generic mmap
code even for cases where drivers are setting up the mappings
at the fault time.

The problem was originally reported here:

 http://marc.info/?l=linux-kernel&m=123383810628583&w=2

Change is_linear_pfn_mapping logic to overload VM_INSERTPAGE
flag along with VM_PFNMAP to mean full PFNMAP setup at mmap
time.

Problem also tracked at:

 http://bugzilla.kernel.org/show_bug.cgi?id=12800

Reported-by: Thomas Hellstrom <thellstrom@vmware.com>
Tested-by: Frans Pop <elendil@planet.nl>
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha>@intel.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: "ebiederm@xmission.com" <ebiederm@xmission.com>
Cc: <stable@kernel.org> # only for 2.6.29.1, not .28
LKML-Reference: <20090313004527.GA7176@linux-os.sc.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years ago[ARM] pxa: fix typo in BANK_OFF() macro in gpio.h
Eric Miao [Fri, 13 Mar 2009 02:50:17 +0000 (10:50 +0800)]
[ARM] pxa: fix typo in BANK_OFF() macro in gpio.h

The typo was originally fixed by Mike Rapoport and missed. And is
later reported by Matthias Meier.

Signed-off-by: Matthias Meier <matthias.j.meier@gmx.net>
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
16 years agoLinus 2.6.29-rc8
Linus Torvalds [Fri, 13 Mar 2009 02:39:28 +0000 (19:39 -0700)]
Linus 2.6.29-rc8

16 years agobitmap: fix end condition in bitmap_find_free_region
Linus Torvalds [Fri, 13 Mar 2009 02:32:51 +0000 (19:32 -0700)]
bitmap: fix end condition in bitmap_find_free_region

Guennadi Liakhovetski noticed that the end condition for the loop in
bitmap_find_free_region() is wrong, and the "return if error" was also
using the wrong conditional that would only trigger if the bitmap was an
exact multiple of the allocation size, which is not necessarily the case
with dma_alloc_from_coherent().

Such a failure would end up in bitmap_find_free_region() accessing
beyond the end of the bitmap.

Reported-by: Guennadi Liakhovetski <lg@denx.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoring-buffer: document reader page design
Steven Rostedt [Fri, 13 Mar 2009 02:24:17 +0000 (22:24 -0400)]
ring-buffer: document reader page design

In a private email conversation I explained how the ring buffer
page worked by using silly ASCII art. Ingo suggested that I add
that to the comments of the code.

Here it is.

Requested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
16 years agox86: cpu_debug add write support for MSRs
Jaswinder Singh Rajput [Wed, 11 Mar 2009 21:07:00 +0000 (02:37 +0530)]
x86: cpu_debug add write support for MSRs

Supported write flag for registers.
currently write is enabled only for PMC MSR.

[root@ht]# cat /sys/kernel/debug/x86/cpu/cpu1/pmc/0x300/value
0x0

[root@ht]# echo 1234 > /sys/kernel/debug/x86/cpu/cpu1/pmc/0x300/value
[root@ht]# cat /sys/kernel/debug/x86/cpu/cpu1/pmc/0x300/value
0x4d2

[root@ht]# echo 0x1234 > /sys/kernel/debug/x86/cpu/cpu1/pmc/0x300/value
[root@ht]# cat /sys/kernel/debug/x86/cpu/cpu1/pmc/0x300/value
0x1234

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agotracing: show event name in trace for TRACE_EVENT created events
Steven Rostedt [Fri, 13 Mar 2009 02:00:19 +0000 (22:00 -0400)]
tracing: show event name in trace for TRACE_EVENT created events

Unlike TRACE_FORMAT() macros, the TRACE_EVENT() macros do not show
the event name in the trace file. Knowing the event type in the trace
output is very useful.

Instead of:

   task swapper:0 [140] ==> ntpd:3308 [120]

We now have:

   sched_switch: task swapper:0 [140] ==> ntpd:3308 [120]

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
16 years agox86: separate mtrr cleanup/mtrr_e820 trim to separate file
Yinghai Lu [Thu, 12 Mar 2009 03:07:39 +0000 (20:07 -0700)]
x86: separate mtrr cleanup/mtrr_e820 trim to separate file

Impact: cleanup

mtrr main.c is too big, seperate mtrr cleanup and mtrr e820 trim
code to another file.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <49B87C7B.80809@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: print out mtrr_range_state when user specify size
Yinghai Lu [Thu, 12 Mar 2009 03:05:46 +0000 (20:05 -0700)]
x86: print out mtrr_range_state when user specify size

Impact: print more debug info

Keep it consistent with autodetect version.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <49B87C0A.4010105@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: more MTRR debug printouts
Yinghai Lu [Fri, 13 Mar 2009 01:43:54 +0000 (18:43 -0700)]
x86: more MTRR debug printouts

Impact: improve MTRR debugging messages

There's still inefficiencies suspected with the MTRR sanitizing
code, so make sure we get all the info we need from a dmesg.

- Remove unneeded mtrr_show

 (It will only printout one time by first cpu, so it is no big deal.)

- Also print out directly from get_mtrr, because it doesn't update mtrr_state.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <49B9BA5A.40108@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: create a non-zero sized bm_pte only when needed
Jan Beulich [Thu, 12 Mar 2009 13:11:50 +0000 (13:11 +0000)]
x86: create a non-zero sized bm_pte only when needed

Impact: kernel image size reduction

Since in most configurations the pmd page needed maps the same range of
virtual addresses which is also mapped by the earlier inserted one for
covering FIX_DBGP_BASE, that page (and its insertion in the page
tables) can be avoided altogether by detecting the condition at compile
time.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
LKML-Reference: <49B91826.76E4.0078.0@novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix code paths used by update_mptable
Jan Beulich [Thu, 12 Mar 2009 13:07:23 +0000 (13:07 +0000)]
x86: fix code paths used by update_mptable

Impact: fix crashes under Xen due to unrobust e820 code

find_e820_area_size() must return a properly distinguishable and
out-of-bounds value when it fails, and -1UL does not meet that
criteria on i386/PAE. Additionally, callers of the function must
check against that value.

early_reserve_e820() should be prepared for the region found to be
outside of the addressable range on 32-bits.

e820_update_range_map() should not blindly update e820, but should do
all it work on the map it got a pointer passed for (which in 50% of the
cases is &e820_saved). It must also not call e820_add_region(), as that
again acts on e820 unconditionally.

The issues were found when trying to make this option work in our Xen
kernel (i.e. where some of the silent assumptions made in the code
would not hold).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
LKML-Reference: <49B9171B.76E4.0078.0@novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: clean up output resulting from update_mptable option
Jan Beulich [Thu, 12 Mar 2009 12:57:10 +0000 (12:57 +0000)]
x86: clean up output resulting from update_mptable option

Impact: cleanup

Without apic=verbose, using the update_mptable option would result in
garbled and confusing output due to the inconsistent use of printk() vs
apic_printk().

Signed-off-by: Jan Beulich <jbeulich@novell.com>
LKML-Reference: <49B914B6.76E4.0078.0@novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: properly __init-annotate recent early_printk additions
Jan Beulich [Thu, 12 Mar 2009 12:41:23 +0000 (12:41 +0000)]
x86: properly __init-annotate recent early_printk additions

Impact: cleanup, save memory

Don't keep code resident that's only needed during startup.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
LKML-Reference: <49B91103.76E4.0078.0@novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move save_mr() into .meminit.text
Jan Beulich [Thu, 12 Mar 2009 12:40:06 +0000 (12:40 +0000)]
x86: move save_mr() into .meminit.text

Impact: cleanup, save memory

The function is only being called from boot or memory hotplug paths.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
LKML-Reference: <49B910B6.76E4.0078.0@novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86, 32-bit: also use cpuinfo_x86's x86_{phys,virt}_bits members
Jan Beulich [Thu, 12 Mar 2009 12:37:34 +0000 (12:37 +0000)]
x86, 32-bit: also use cpuinfo_x86's x86_{phys,virt}_bits members

Impact: 32/64-bit consolidation

In a first step, this allows fixing phys_addr_valid() for PAE (which
until now reported all addresses to be valid). Subsequently, this will
also allow simplifying some MTRR handling code.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
LKML-Reference: <49B9101E.76E4.0078.0@novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86, 32-bit: also limit NODES_HIGH_SHIFT here
Jan Beulich [Thu, 12 Mar 2009 12:33:06 +0000 (12:33 +0000)]
x86, 32-bit: also limit NODES_HIGH_SHIFT here

Impact: configuration bug fix

Just like for x86-64, the range of widths valid for NODE_SHIFT is not
unbounded. The upper bound 64-bit uses is definitely also an upper
bound for 32-bit.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
LKML-Reference: <49B90F12.76E4.0078.0@novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify kmap_atomic_pfn() and iomap_atomic_prot_pfn(), fix
Ingo Molnar [Fri, 13 Mar 2009 02:20:49 +0000 (03:20 +0100)]
x86: unify kmap_atomic_pfn() and iomap_atomic_prot_pfn(), fix

Impact: build fix

Move kmap_atomic_prot_pfn() to iomap_32.c. It is used on all 32-bit
kernels, while highmem_32.c is only built on highmem kernels.

( Note: the debug_kmap_atomic_prot() check is removed for now, that
  problem is handled via another patch. )

Reported-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
LKML-Reference: <20090311143317.GA22244@localhost.localdomain>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: smarten /proc/interrupts output
Jan Beulich [Thu, 12 Mar 2009 12:45:15 +0000 (12:45 +0000)]
x86: smarten /proc/interrupts output

Impact: change /proc/interrupts output ABI

With the number of interrupts on large systems growing, assumptions on
the width an interrupt number requires when converted to a decimal
string turn invalid. Therefore, calculate the maximum number of digits
dynamically.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
LKML-Reference: <49B911EB.76E4.0078.0@novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agotracing: Don't use tracing_record_cmdline() in workqueue tracer fix
KOSAKI Motohiro [Fri, 13 Mar 2009 00:03:04 +0000 (09:03 +0900)]
tracing: Don't use tracing_record_cmdline() in workqueue tracer fix

commit c3ffc7a40b7e94b094efe1c8ab4e24370a782b65
"Don't use tracing_record_cmdline() in workqueue tracer"
has a race window.

find_task_by_vpid() requires task_list_lock().

LKML-Reference: <20090313090042.43CD.A69D9226@jp.fujitsu.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
16 years agotracing: tracepoints for softirq entry/exit - tracepoints
Jason Baron [Thu, 12 Mar 2009 18:36:03 +0000 (14:36 -0400)]
tracing: tracepoints for softirq entry/exit - tracepoints

Introduce softirq entry/exit tracepoints. These are useful for
augmenting existing tracers, and to figure out softirq frequencies and
timings.

[
  s/irq_softirq_/softirq_/ for trace point names and
  Fixed printf format in TRACE_FORMAT macro
   - Steven Rostedt
]

LKML-Reference: <20090312183603.GC3352@redhat.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
16 years agotracing: tracepoints for softirq entry/exit - add softirq-to-name array
Jason Baron [Thu, 12 Mar 2009 18:33:36 +0000 (14:33 -0400)]
tracing: tracepoints for softirq entry/exit - add softirq-to-name array

Create a 'softirq_to_name' array, which is indexed by softirq #, so
that we can easily convert between the softirq index # and its name, in
order to get more meaningful output messages.

LKML-Reference: <20090312183336.GB3352@redhat.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>