Commit graph

33261 commits

Author SHA1 Message Date
Andi Kleen
70583161e8 [PATCH] i386: Fix up backtrace fallback patch
I didn't test all compilation combinations. Shame on me.
And fix a missing option in the boot option following x86-64 (Jan Beulich)

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-29 20:59:55 -07:00
Andi Kleen
65f87d8a8a [PATCH] x86_64: Fix swiotlb=force
It was broken before. But having it is important as possible hardware
bug workaround.

And previously there was no way to force swiotlb if there is another IOMMU.
Side effect is that iommu=force won't force swiotlb anymore even if there
isn't another IOMMU.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-29 20:59:55 -07:00
Andi Kleen
355540f333 [PATCH] x86_64: Revert k8-bus.c northbridge access change
As Travis Betak points out it accesses the wrong northbridge subfunction
now. Switch back to the old code.

Cc: "Travis Betak" <betak@mpdtxmail.amd.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-29 20:59:55 -07:00
Jon Mason
d2105b10fe [PATCH] x86_64: Calgary IOMMU - Multi-Node NULL pointer dereference fix
Calgary hits a NULL pointer dereference when booting in a multi-chassis
NUMA system.  See Redhat bugzilla number 198498, found by Konrad
Rzeszutek (konradr@redhat.com).

There are many issues that had to be resolved to fix this problem.
Firstly when I originally wrote the code to handle NUMA systems, I
had a large misunderstanding that was not corrected until now.  That was
that I thought the "number of nodes online" referred to number of
physical systems connected.  So that if NUMA was disabled, there
would only be 1 node and it would only show that node's PCI bus.
In reality if NUMA is disabled, the system displays all of the
connected chassis as one node but is only ignorant of the delays
in accessing main memory.  Therefore, references to num_online_nodes()
and MAX_NUMNODES are incorrect and need to be set to the maximum
number of nodes that can be accessed (which are 8).  I created a
variable, MAX_NUM_CHASSIS, and set it to 8 to fix this.

Secondly, when walking the PCI in detect_calgary, the code only
checked the first "slot" when looking to see if a device is present.
This will work for most cases, but unfortunately it isn't always the
case.  In the NUMA MXE drawers, there are USB devices present on the
3rd slot (with slot 1 being empty).  So, to work around this, all
slots (up to 8) are scanned to see if there are any devices present.

Lastly, the bus is being enumerated on large systems in a different
way the we originally thought.  This throws the ugly logic we had
out the window.  To more elegantly handle this, I reorganized the
kva array to be sparse (which removed the need to have any bus number
to kva slot logic in tce.c) and created a secondary space array to
contain the bus number to phb mapping.

With these changes Calgary boots on an x460 with 4 nodes with and
without NUMA enabled.

Signed-off-by: Jon Mason <jdmason@us.ibm.com>
Signed-off-by: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-29 20:59:55 -07:00
Muli Ben-Yehuda
089bbbcb36 [PATCH] x86_64: Calgary IOMMU - fix off by one error
Fixed off-by-one error in detect_calgary and calgary_init which will
cause arrays to overflow.  Also, removed impossible to hit BUG_ON.

Signed-off-by: Jon Mason <jdmason@us.ibm.com>
Signed-off-by: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-29 20:59:55 -07:00
Andi Kleen
0e5f61b00c [PATCH] x86_64: On Intel systems when CPU has C3 don't use TSC
On Intel systems generally the TSC stops in C3 or deeper,
so don't use it there. Follows similar logic on i386.

This should fix problems on Meroms.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-29 20:59:55 -07:00
Andi Kleen
260f659b23 [PATCH] x86_64: Update defconfig
Update defconfig

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-29 20:59:55 -07:00
Trent Piepho
ddecbe112b V4L/DVB (4380): Bttv: Revert VBI_OFFSET to previous value, it works better
A previous patch changed VBI_OFFSET to match what the datasheets say it
should be.  However, the bt8x8 datasheets are wrong.  The old value of
244 is closer to what is actually observed.  The real value appears to
not be constant and is different for different chip revisions.
Acked-by: Alan Cox <alan@redhat.com>

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:39 -03:00
Trent Piepho
8c313111a2 V4L/DVB (4379): Videodev: Check return value of class_device_register() correctly
Errors are return values < 0, not != 0.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:38 -03:00
Mike Isely
08d4180836 V4L/DVB (4373): Correctly handle sysfs error leg file removal in pvrusb2
Take note of which sysfs files / groups that the pvrusb2 successfully
creates and only delete those specific items when tearing things
down.  (Previously we just blindly tore everything down every time.)

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:37 -03:00
Trent Piepho
d94fc9a08e V4L/DVB (4368): Bttv: use class_device_create_file and handle errors
Revert bttv-driver.c from video_device_create_file() to use
class_device_create_file() again.  video_device_create_file() is only
available when V4L1 is on.
Proper error checking is added for failure of class_device_create_file().
Will print error message and unroll partially created sysfs entries.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:36 -03:00
Trent Piepho
53dd8def52 V4L/DVB (4367): Videodev: Handle class_device related errors
Add proper error checking and roll-back for failure of
class_device_create_file() in videodev.c.  Print error messages and
unroll partially created sysfs entries.
Also, failure of class_device_register() in video_register_device() is
handled correctly.  It was failing to de-allocate the minor number.  This
must be done in video_register_device(), since the caller has no way of
knowing if failure occurred before or after the class device was
registered.
Also added an error message if video_register_device() is called with
an unknown type, which should never happen.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:34 -03:00
Mauro Carvalho Chehab
df2732706c V4L/DVB (4365): OVERLAY flag were enabled by mistake
A patch from Aug, 17 activated by mistake OVERLAY flag on cx88-video,
together with several cx88-blackbird cleanups. This makes the cx88 driver
to report:
/dev/video0 [v4l2]: ioctl VIDIOC_G_FBUF: Invalid argument
instead of:
/dev/video0 [v4l2]: no overlay support

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:32 -03:00
Mauro Carvalho Chehab
fb0b664c22 V4L/DVB (4344): Fix broken dependencies on media Kconfig
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:31 -03:00
Mauro Carvalho Chehab
985bc96e27 V4L/DVB (4343): Fix for compilation without V4L1 or V4L1_COMPAT
Removed usage of HAVE_V4L1
Including videodev.h will just include videodev2.h if V4L1 is not supported
V4L1 code at core drivers will honor CONFIG_V4L1_COMPAT stuff

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:30 -03:00
Mauro Carvalho Chehab
f251d23eae V4L/DVB (4342): Fix ext_controls align on 64 bit architectures
u64 is aligned as 128bits on x86_64 architetures, requiring an special
handling to ioctls that depends on v4l2_ext_control. 
Let's fix this before ext controls go to kernel mainstream to avoid one 
more compat32 stuff.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:29 -03:00
Mauro Carvalho Chehab
eb4eeccc18 V4L/DVB (4341): VIDIOCSMICROCODE were missing on compat_ioctl32
video_code size is 24 on i386 and 32 on x86_64, so a proper handling is needed
on compat_ioctl32 to fix it.
This code should be tested, since just *a few* boards use this ioctl.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:27 -03:00
Andrew de Quincey
95faba22d8 V4L/DVB (4322): Fix dvb-pll autoprobing
Trent Piepho pointed out that the pll test i2c transmission is slightly
wrong; it was transmitting a zero length message, and then reading from the
PLL. This was wrong; it should only be transmitting a single read i2c message.

Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:26 -03:00
Andrew de Quincey
55c05b6d22 V4L/DVB (4311): Fix possible dvb-pll oops
Supplying a NULL i2c adapter to dvb_pll_attach is allowed, for example with
mt352 demods. However, the pll i2c probe will segfault because it does not
check for this.

Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:25 -03:00
Mike Isely
e61b6fc58b V4L/DVB (4337): Refine dead code elimination in pvrusb2
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:24 -03:00
Oliver Endriss
32e4c3a562 V4L/DVB (4323): [budget/budget-av/budget-ci/budget-patch drivers] fixed DMA start/stop code
Fix bug reported by Andrew de Quincey:
After cold boot the saa7146 DMA did not start if the demuxer was opened
before the frontend has locked to the signal.
DMA transfers will be started now if (and only if)
the frontend is locked and data should be sent to the demuxer.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:23 -03:00
Michael Krufky
3117beec7e V4L/DVB (4316): Check __must_check warnings
Check __must_check warnings for class_device_register and class_device_create_file

video_device_create_file was declared as a void, but instead should
return the int value of class_device_create_file.

Move the check from bttv-driver.c into v4l2-dev.h, because all other
callers of video_device_create_file must also be checked.

Replace the call to class_device_create_file in videodev.c with
video_device_create_file, as defined in v4l2-dev.h, so that the
return value of class_device_create_file will be checked.

Check the return value of class_device_register in videodev.c and
pvrusb2-sysfs.c

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:21 -03:00
Michael Krufky
d9cd2d9b61 V4L/DVB (4314): Set the Auxiliary Byte when tuning LG H06xF in analog mode
With the LG H06xF tuners, an auxiliary byte must be sent after the
standard four-byte i2c sequence. The code that does this is currently in
the wrong place, causing random bytes to be written to the tuner over
i2c in the set_type function.
This patch moves this code from set_type to default_set_tv_freq.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:20 -03:00
Ricardo Cerqueira
a62c61d382 V4L/DVB (4313): Bugfix for keycode calculation on NPG remotes
Fix keycode calculations (all codes for this remote were wrong due to a
lost + sign)

Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:19 -03:00
Adrian Bunk
7845701820 V4L/DVB (4310): Saa7134: rename dmasound_{init, exit}
Two different exports with the same name are not a good idea:
$ grep -r EXPORT_SYMBOL\(dmasound_init\) *
drivers/media/video/saa7134/saa7134-core.c:EXPORT_SYMBOL(dmasound_init);
sound/oss/dmasound/dmasound_core.c:EXPORT_SYMBOL(dmasound_init);
$ 
This patch renames the saa7134 dmasound_{init,exit} to 
saa7134_dmasound_{init,exit}.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:18 -03:00
Hartmut Hackmann
d5fdd1354e V4L/DVB (4306): Support non interlaced capture by default for saa713x
This patch just sets the option noninterlaced to 1 by default since
it has no known disadvantages. It is still possibe to get the old
behaviour by setting noninterlaced=0.

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:16 -03:00
Randy Dunlap
c526e224e4 V4L/DVB (4298): Check all __must_check warnings in bttv.
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:15 -03:00
Andrew de Quincey
6ba475042f V4L/DVB (4296): Remove stradis MODULE_DEVICE_INFO definition
To prevent autoloading of the driver, as it then conflicts with every other
saa7146 device in existence.

Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:14 -03:00
Marco Schluessler
6a85774741 V4L/DVB (4295): Fix typo in comment for TDA9819
Fix typo in comment for TDA9819

Signed-off-by: Marco Schluessler <marco@lordzodiac.de>
Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:12 -03:00
Andrew de Quincey
93e2b1ae97 V4L/DVB (4294): Fix broken tda665x PLL definition.
It was pointed out on the mailing list that this PLL definition is broken. I
went back to the original dibusb driver and confirmed it used to use these
settings, as well as consulting the datasheet.

Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:11 -03:00
Andrew de Quincey
f281309381 V4L/DVB (4293): Fix unstable DISEQC behaviour on budget cards.
Use the stv0299 native DISEQC implementation instead of the bitbanging one
as required by the ves1893. This was originally found by Oliver Endriss.

Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:10 -03:00
Andrew de Quincey
04c56d0e5b V4L/DVB (4292): Fix DISEQC regression
The changes to add frontend reinitialisation moved the position where the
init() op is called into the frontend thread. Unfortunately, since DISEQC
operations do not use the frontend thread, this meant that DISEQC could be
called against an uninitalised frontend, leading to all sorts of trouble.
Patch fixes this by reinstating the original fronted intialisation call.

Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:09 -03:00
Andrew de Quincey
061b623c54 V4L/DVB (4291): Add dvbpll i2c device check.
Some cards have multiple possible addresses for their PLLs, with no other
way to tell if a PLL is present or not apart from probing to see if an i2c
device is present. This adds a quick check to see if an i2c device is
present at the given i2c address.

Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Acked-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-29 17:22:07 -03:00
Catalin Marinas
ceaccbd2a6 [ARM] 3734/1: Fix the unused variable warning in __iounmap()
Patch from Catalin Marinas

This patch adds #ifdef around some variables in the arch/arm/mm/ioremap.c
file.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-07-29 08:29:30 +01:00
George G. Davis
7b1df1985c [ARM] 3737/1: Export ARM copy/clear_user_page symbols
Patch from George G. Davis

As reported by various folks on the ARM Linux kernel mailing list,
the video-buf.ko driver has undefined references on all ARM machines
which use it as observed during `make modules`:

Warning: "v4wb_clear_user_page" [drivers/media/video/video-buf.ko] undefined!

Similar warnings exist for all ARM machines which use this driver.
So this change adds the missing EXPORT_SYMBOLs to allow using this
driver as a module.

Signed-off-by: George G. Davis <gdavis@mvista.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-07-29 08:29:27 +01:00
Lennert Buytenhek
a6a38a6622 [ARM] 3736/1: xscale: don't mis-report 80219 as an iop32x
Patch from Lennert Buytenhek

The IOP 80219 xscale CPU is a stripped down version of the IOP32x.
But the fact that the 80219 and IOP32x are very similar doesn't mean
that they need to share a cpu table entry.  It's also somewhat confusing
for the end user to see the 80219 reported as an IOP32x, so this patch
splits the IOP32x cpu table entry to make a separate entry for the
80219.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-07-29 08:29:26 +01:00
Linus Torvalds
dc710afe95 Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  [libata] sata_promise: comment out duplicate PCI ID
  [PATCH] libata: improve EH action and EHI flag handling
  [PATCH] libata: fix eh_skip_recovery condition
  [PATCH] libata: fix autopsy ehc->i.action and ehc->i.dev handling
2006-07-28 22:47:44 -07:00
Jeff Garzik
ab3b3fd381 Merge branch 'master' into upstream-fixes 2006-07-29 01:39:17 -04:00
Jeff Garzik
4da3dcf346 Merge branch 'upstream' of git://electric-eye.fr.zoreil.com/home/romieu/linux-2.6 into upstream-fixes 2006-07-29 01:26:51 -04:00
Stephen Hemminger
187ff3b857 [PATCH] skge: chip clock rate typo
Okay, Fix both typo's in one patch .The impact is that the incorrect value
was being computed for blinking LED and interrupt moderation values.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-07-29 01:23:51 -04:00
Brice Goglin
9a71db721a [PATCH] myri10ge - Always do a dummy RDMA after loading the firmware
Always do a dummy RDMA after loading the firmware to work around
buggy PCIe chipsets which do not implement resending properly.
This is so cheap as to be almost free, and should never have been
conditional on the tx boundary != 4096.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-07-29 01:23:51 -04:00
Jeff Garzik
5b84b6fa9b Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 into upstream-fixes 2006-07-29 00:32:29 -04:00
Ingo Molnar
e3f2ddeac7 [PATCH] pi-futex: robust-futex exit
Fix robust PI-futexes to be properly unlocked on unexpected exit.

For this to work the kernel has to know whether a futex is a PI or a
non-PI one, because the semantics are different.  Since the space in
relevant glibc data structures is extremely scarce, the best solution is
to encode the 'PI' information in bit 0 of the robust list pointer.
Existing (non-PI) glibc robust futexes have this bit always zero, so the
ABI is kept.  New glibc with PI-robust-futexes will set this bit.

Further fixes from Thomas Gleixner <tglx@linutronix.de>

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-28 21:02:00 -07:00
Ingo Molnar
627371d73c [PATCH] pi-futex: robust-futex exit crash fix
Fix pi_state->list handling bugs: list handling mishap, locking error.
Plus add more debug checks and fix a few style issues i noticed while
debugging this.

(reported by Ulrich Drepper and Jakub Jelinek.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-28 21:02:00 -07:00
Andi Kleen
c97d20a6c5 [PATCH] i386: Do backtrace fallback too
Similar patch to earlier x86-64 patch. When the dwarf2 unwinder fails
dump the left over stack with the old unwinder.

Also some clarifications in the headers.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-28 19:28:00 -07:00
Andi Kleen
b783fd925c [PATCH] x86_64: Document backtracer selection options
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-28 19:28:00 -07:00
Andi Kleen
b13761ecd1 [PATCH] x86_64: Dump leftover backtrace entries when dwarf2 unwinder got stuck
The dwarf2 unwinder currently often gets stuck because a lot
of assembly code doesn't have proper dwarf2 annotiation yet.

This currently often happens with __down. Should fix this by
adding proper dwarf2 annotation to all inline assembly. However
until that's done we need a quick fix for 2.6.18 to avoid
incomplete backtraces.

So when this happens dump the rest of the stack with the old unwinder
instead of silently not dumping it. There was already a optional
"both" mode that dumped both, but that was too ugly.

I also clarified the headers for the different backtraces a bit.

Also add a clear error message for missing dwarf2
annotation that people can work on.

And I removed a dead variable left over from Ingo's changes.

Cc: mingo@elte.hu
Cc: jbeulich@novell.com
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-28 19:28:00 -07:00
bibo mao
a4045dff78 [PATCH] x86_64: Enlarge debug stack for nested kprobes
In x86_64 platform, INT1 and INT3 trap stack is IST stack called DEBUG_STACK,
when INT1/INT3 trap happens, system will switch to DEBUG_STACK by hardware.
Current DEBUG_STACK size is 4K, when int1/int3 trap happens, kernel will
minus current DEBUG_STACK IST value by 4k. But if int3/int1 trap is nested,
it will destroy other vector's IST stack. This patch modifies this, it sets
DEBUG_STACK size as 8K and allows two level of nested int1/int3 trap.

Kprobe DEBUG_STACK may be nested, because kprobe handler may be probed
by other kprobes.

Thanks jbeulich for pointing out error in the first patch.

[AK: nested kprobes are pretty dubious. Hopefully one nest
will be enough. This will cost 8K per CPU (4K more than before)]

Signed-off-by: bibo, mao <bibo.mao@intel.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-28 19:28:00 -07:00
Andi Kleen
0e92da4acb [PATCH] x86_64: Don't clobber r8-r11 in int 0x80 handler
When int 0x80 is called from long mode r8-r11 would leak out of the
kernel (or rather they would be filled with some values from
the kernel stack). I don't think it's a security issue because
the values come from the fixed stack frame which should be near
always user registers from a previous interrupt.

Still better fix it.

Longer term the register save macros need to be cleaned up
to avoid such mistakes in the future.

Original analysis from Richard Brunner, fix by me.

Cc: Richard.Brunner@amd.com

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-28 19:28:00 -07:00
Andi Kleen
d5a2601734 [PATCH] i386/x86-64: Add user_mode checks to profile_pc for oprofile
Fixes a obscure user space triggerable crash during oprofiling.

Oprofile calls profile_pc from NMIs even when user_mode(regs) is not true and
the program counter is inside the kernel lock section. This opens
a race - when a user program jumps to a kernel lock address and
a NMI happens before the illegal page fault exception is raised
and the program has a unmapped esp or ebp then the kernel could
oops. NMIs have a higher priority than exceptions so that could
happen.

Add user_mode checks to i386/x86-64 profile_pc to prevent that.

Cc: John Levon <levon@movementarian.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-28 19:28:00 -07:00