Commit graph

514 commits

Author SHA1 Message Date
Linus Torvalds f429ee3b80 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit: (29 commits)
  audit: no leading space in audit_log_d_path prefix
  audit: treat s_id as an untrusted string
  audit: fix signedness bug in audit_log_execve_info()
  audit: comparison on interprocess fields
  audit: implement all object interfield comparisons
  audit: allow interfield comparison between gid and ogid
  audit: complex interfield comparison helper
  audit: allow interfield comparison in audit rules
  Kernel: Audit Support For The ARM Platform
  audit: do not call audit_getname on error
  audit: only allow tasks to set their loginuid if it is -1
  audit: remove task argument to audit_set_loginuid
  audit: allow audit matching on inode gid
  audit: allow matching on obj_uid
  audit: remove audit_finish_fork as it can't be called
  audit: reject entry,always rules
  audit: inline audit_free to simplify the look of generic code
  audit: drop audit_set_macxattr as it doesn't do anything
  audit: inline checks for not needing to collect aux records
  audit: drop some potentially inadvisable likely notations
  ...

Use evil merge to fix up grammar mistakes in Kconfig file.

Bad speling and horrible grammar (and copious swearing) is to be
expected, but let's keep it to commit messages and comments, rather than
expose it to users in config help texts or printouts.
2012-01-17 16:41:31 -08:00
Eric Paris b05d8447e7 audit: inline audit_syscall_entry to reduce burden on archs
Every arch calls:

if (unlikely(current->audit_context))
	audit_syscall_entry()

which requires knowledge about audit (the existance of audit_context) in
the arch code.  Just do it all in static inline in audit.h so that arch's
can remain blissfully ignorant.

Signed-off-by: Eric Paris <eparis@redhat.com>
2012-01-17 16:16:56 -05:00
Eric Paris d7e7528bcd Audit: push audit success and retcode into arch ptrace.h
The audit system previously expected arches calling to audit_syscall_exit to
supply as arguments if the syscall was a success and what the return code was.
Audit also provides a helper AUDITSC_RESULT which was supposed to simplify things
by converting from negative retcodes to an audit internal magic value stating
success or failure.  This helper was wrong and could indicate that a valid
pointer returned to userspace was a failed syscall.  The fix is to fix the
layering foolishness.  We now pass audit_syscall_exit a struct pt_reg and it
in turns calls back into arch code to collect the return value and to
determine if the syscall was a success or failure.  We also define a generic
is_syscall_success() macro which determines success/failure based on if the
value is < -MAX_ERRNO.  This works for arches like x86 which do not use a
separate mechanism to indicate syscall failure.

We make both the is_syscall_success() and regs_return_value() static inlines
instead of macros.  The reason is because the audit function must take a void*
for the regs.  (uml calls theirs struct uml_pt_regs instead of just struct
pt_regs so audit_syscall_exit can't take a struct pt_regs).  Since the audit
function takes a void* we need to use static inlines to cast it back to the
arch correct structure to dereference it.

The other major change is that on some arches, like ia64, MIPS and ppc, we
change regs_return_value() to give us the negative value on syscall failure.
THE only other user of this macro, kretprobe_example.c, won't notice and it
makes the value signed consistently for the audit functions across all archs.

In arch/sh/kernel/ptrace_64.c I see that we were using regs[9] in the old
audit code as the return value.  But the ptrace_64.h code defined the macro
regs_return_value() as regs[3].  I have no idea which one is correct, but this
patch now uses the regs_return_value() function, so it now uses regs[3].

For powerpc we previously used regs->result but now use the
regs_return_value() function which uses regs->gprs[3].  regs->gprs[3] is
always positive so the regs_return_value(), much like ia64 makes it negative
before calling the audit code when appropriate.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: H. Peter Anvin <hpa@zytor.com> [for x86 portion]
Acked-by: Tony Luck <tony.luck@intel.com> [for ia64]
Acked-by: Richard Weinberger <richard@nod.at> [for uml]
Acked-by: David S. Miller <davem@davemloft.net> [for sparc]
Acked-by: Ralf Baechle <ralf@linux-mips.org> [for mips]
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [for ppc]
2012-01-17 16:16:56 -05:00
Michal Simek d761f0c521 microblaze: Add topology init
Init topology subsystem by cpu registration.

Microblaze Linux kernel is fauling by
"Oops: kernel access of bad area, sig: 11"
because cpu is not initialized.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-01-11 09:20:55 +01:00
Linus Torvalds 4690dfa8cd Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
* 'next' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: Wire-up new system calls
  microblaze: Remove NO_IRQ from architecture
  input: xilinx_ps2: Don't use NO_IRQ
  block: xsysace: Don't use NO_IRQ
  microblaze: Trivial asm fix
  microblaze: Fix debug message in module
  microblaze: Remove eprintk macro
  microblaze: Send CR before LF for early console
  microblaze: Change NO_IRQ to 0
  microblaze: Use irq_of_parse_and_map for timer
  microblaze: intc: Change variable name
  microblaze: Use of_find_compatible_node for timer and intc
  microblaze: Add __cmpdi2
  microblaze: Synchronize __pa __va macros
2012-01-10 17:37:49 -08:00
Linus Torvalds fbce1c234f Changes queued in gpio/next for the start of the 3.3 merge window
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPBSJSAAoJEEFnBt12D9kBDmIP/R6PWxg+NrJaGDmxRWBBkOch
 iI4Et7GT3Sk5hYqPz0kehiSz1F4bqpYK3JmdfqotJIhQCM2znXM+BaDLzgFnMsRf
 g4t70PIZQMpk3pj4gtIkMpZCkRdA9VFriIf1cEdHcLiRdNVsXlTE6CcQT4fbE1P/
 JTAGBrVDwbchuoPsf7Mbu8SYT+cQdWLKpgzC4fAzI++QoYyYBtfvuCHTE4VvasNS
 jMDOfT+u0Gwp6LW34v0gKk7MXEQzeq07r1VZxMyuaWbRQoiLr5d1fy97+Fh5+4dU
 Rb9C6zGIoBzRdiJLlfNYrls/FueDHwPyIwXuapMp5QbaGN5fkhVpIVIhYICOLdHW
 IXH2V3saK1s6QbD7nErNT2lCWZQSCUKq/PR9W40dj3PYAI0oxbRBSoPdfGuW1Bl7
 fYqClUza1Bln8bEmmsvAOnIDdfs6zpkWmfouwx4AGaHTfzIAg4VRdoxdUpS8h+/d
 sNEYi99IuYfl3KWCwQbWJMgCOvoBdOGZSCsTrXnjLf1HJCsQOt/Md69Ff6DLn1VR
 gDp0EeqgDH5oXJmQTW1WjXaJJair2j8pY8mlmGxl1AqA4aY8C3dxIfHxlBPzdxii
 I6KTPaIUSXZaOo6e7XDjjjTzabL4q0aQGT5ahpKj928Rnx00QZNXoTy4FmYkL+0k
 j7QZfM/p6+vfxekKUR17
 =9ugo
 -----END PGP SIGNATURE-----

Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6

Changes queued in gpio/next for the start of the 3.3 merge window

* tag 'gpio-for-linus-20120104' of git://git.secretlab.ca/git/linux-2.6:
  gpio: Add decode of WM8994 GPIO configuration
  gpio: Convert GPIO drivers to module_platform_driver
  gpio: Fix typo in comment in Samsung driver
  gpio: Explicitly index samsung_gpio_cfgs
  gpio: Add Linus Walleij as gpio co-maintainer
  of: Add device tree selftests
  of: create of_phandle_args to simplify return of phandle parsing data
  gpio/powerpc: Eliminate duplication of of_get_named_gpio_flags()
  gpio/microblaze: Eliminate duplication of of_get_named_gpio_flags()
  gpiolib: output basic details and consolidate gpio device drivers
  pch_gpio: Change company name OKI SEMICONDUCTOR to LAPIS Semiconductor
  pch_gpio: Support new device LAPIS Semiconductor ML7831 IOH
  spi/pl022: make the chip deselect handling thread safe
  spi/pl022: add support for pm_runtime autosuspend
  spi/pl022: disable the PL022 block when unused
  spi/pl022: move device disable to workqueue thread
  spi/pl022: skip default configuration before suspending
  spi/pl022: fix build warnings
  spi/pl022: only enable RX interrupts when TX is complete
2012-01-07 12:15:36 -08:00
Linus Torvalds 423d091dfe Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (64 commits)
  cpu: Export cpu_up()
  rcu: Apply ACCESS_ONCE() to rcu_boost() return value
  Revert "rcu: Permit rt_mutex_unlock() with irqs disabled"
  docs: Additional LWN links to RCU API
  rcu: Augment rcu_batch_end tracing for idle and callback state
  rcu: Add rcutorture tests for srcu_read_lock_raw()
  rcu: Make rcutorture test for hotpluggability before offlining CPUs
  driver-core/cpu: Expose hotpluggability to the rest of the kernel
  rcu: Remove redundant rcu_cpu_stall_suppress declaration
  rcu: Adaptive dyntick-idle preparation
  rcu: Keep invoking callbacks if CPU otherwise idle
  rcu: Irq nesting is always 0 on rcu_enter_idle_common
  rcu: Don't check irq nesting from rcu idle entry/exit
  rcu: Permit dyntick-idle with callbacks pending
  rcu: Document same-context read-side constraints
  rcu: Identify dyntick-idle CPUs on first force_quiescent_state() pass
  rcu: Remove dynticks false positives and RCU failures
  rcu: Reduce latency of rcu_prepare_for_idle()
  rcu: Eliminate RCU_FAST_NO_HZ grace-period hang
  rcu: Avoid needlessly IPIing CPUs at GP end
  ...
2012-01-06 08:02:40 -08:00
Michal Simek f3aef2510e microblaze: Wire-up new system calls
Wire up three system calls
sendmmsg/process_vm_readv/process_vm_writev

All tested by testing apps.
Look at:
net: Add sendmmsg socket system call
(sha1: 228e548e60)
Cross Memory Attach
(sha1: fcf634098c)

Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-01-05 11:16:51 +01:00
Michal Simek 5dbeaad3ea microblaze: Trivial asm fix
Just replace one dot with comma. New binutils can detect it.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-01-05 08:34:28 +01:00
Michal Simek f5b778bee6 microblaze: Fix debug message in module
Trivial fix.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-01-05 08:34:27 +01:00
Michal Simek b6d5b28e44 microblaze: Remove eprintk macro
eprintk macro was used for printing early_printk
messages. Early console registration was changed
that's why this is not needed.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-01-05 08:34:26 +01:00
Michal Simek a8c2e555b0 microblaze: Send CR before LF for early console
This patch fixes problem with measuring tools.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-01-05 08:34:25 +01:00
Michal Simek 6c7a2676f5 microblaze: Change NO_IRQ to 0
As has been discussed many times[1], Using NO_IRQ set to anything other
than 0 is bug waiting to happen since many drivers follow the pattern
"if (!irq)" for testing whether or not an irq has been set.

This patch changes the Microblaze NO_IRQ setting from -1 to 0 to bring
it in line with most of the rest of the kernel.  It also prepares for
Microblaze eventually supporting multiple interrupt controllers by
breaking the assumption that hwirq# == Linux IRQ#.  The Linux IRQ
number is just a cookie with no guarantee of a direct relationship
with the hardware irq arrangement.

At this point, Microblaze interrupt handling only supports only one
instance of one kind of interrupt controller (xilinx_intc).  This change
shouldn't affect any architecture code outside of the interrupt
controller driver and the irq_of mapping.

Updated to 3.2 and to use irq_data.hwirq by Rob Herring.
Tested and fixed by Michal Simek.

[1] http://lkml.org/lkml/2005/11/21/221

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-01-05 08:29:13 +01:00
Michal Simek 9d0ced0084 microblaze: Use irq_of_parse_and_map for timer
It is necessary to call generic function for irq finding.
The main reason is that this generic function calls irq_create_of_mapping
which can add some shift because of NO_IRQ.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-01-05 08:22:04 +01:00
Michal Simek 2ecb899b4e microblaze: intc: Change variable name
intr_type is mask - change name.
s/intr_type/intr_mask/g

Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-01-05 08:22:02 +01:00
Michal Simek 5a26cd69cc microblaze: Use of_find_compatible_node for timer and intc
Calling of_find_compatible_node instead of calling private code
which does the same.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-01-05 08:22:01 +01:00
Grant Likely fe9f68449a gpio/microblaze: Eliminate duplication of of_get_named_gpio_flags()
of_reset_gpio_handle() is largely a cut-and-paste copy of
of_get_named_gpio_flags(). There really isn't any reason for the
split, so this patch deletes the duplicate function

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Michal Simek <monstr@monstr.eu>
2011-12-12 13:40:16 -07:00
Frederic Weisbecker 1268fbc746 nohz: Remove tick_nohz_idle_enter_norcu() / tick_nohz_idle_exit_norcu()
Those two APIs were provided to optimize the calls of
tick_nohz_idle_enter() and rcu_idle_enter() into a single
irq disabled section. This way no interrupt happening in-between would
needlessly process any RCU job.

Now we are talking about an optimization for which benefits
have yet to be measured. Let's start simple and completely decouple
idle rcu and dyntick idle logics to simplify.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2011-12-11 10:31:57 -08:00
Frederic Weisbecker 2bbb6817c0 nohz: Allow rcu extended quiescent state handling seperately from tick stop
It is assumed that rcu won't be used once we switch to tickless
mode and until we restart the tick. However this is not always
true, as in x86-64 where we dereference the idle notifiers after
the tick is stopped.

To prepare for fixing this, add two new APIs:
tick_nohz_idle_enter_norcu() and tick_nohz_idle_exit_norcu().

If no use of RCU is made in the idle loop between
tick_nohz_enter_idle() and tick_nohz_exit_idle() calls, the arch
must instead call the new *_norcu() version such that the arch doesn't
need to call rcu_idle_enter() and rcu_idle_exit().

Otherwise the arch must call tick_nohz_enter_idle() and
tick_nohz_exit_idle() and also call explicitly:

- rcu_idle_enter() after its last use of RCU before the CPU is put
to sleep.
- rcu_idle_exit() before the first use of RCU after the CPU is woken
up.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: David Miller <davem@davemloft.net>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2011-12-11 10:31:36 -08:00
Frederic Weisbecker 280f06774a nohz: Separate out irq exit and idle loop dyntick logic
The tick_nohz_stop_sched_tick() function, which tries to delay
the next timer tick as long as possible, can be called from two
places:

- From the idle loop to start the dytick idle mode
- From interrupt exit if we have interrupted the dyntick
idle mode, so that we reprogram the next tick event in
case the irq changed some internal state that requires this
action.

There are only few minor differences between both that
are handled by that function, driven by the ts->inidle
cpu variable and the inidle parameter. The whole guarantees
that we only update the dyntick mode on irq exit if we actually
interrupted the dyntick idle mode, and that we enter in RCU extended
quiescent state from idle loop entry only.

Split this function into:

- tick_nohz_idle_enter(), which sets ts->inidle to 1, enters
dynticks idle mode unconditionally if it can, and enters into RCU
extended quiescent state.

- tick_nohz_irq_exit() which only updates the dynticks idle mode
when ts->inidle is set (ie: if tick_nohz_idle_enter() has been called).

To maintain symmetry, tick_nohz_restart_sched_tick() has been renamed
into tick_nohz_idle_exit().

This simplifies the code and micro-optimize the irq exit path (no need
for local_irq_save there). This also prepares for the split between
dynticks and rcu extended quiescent state logics. We'll need this split to
further fix illegal uses of RCU in extended quiescent states in the idle
loop.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: David Miller <davem@davemloft.net>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2011-12-11 10:31:35 -08:00
Tejun Heo 1aadc0560f memblock: s/memblock_analyze()/memblock_allow_resize()/ and update users
The only function of memblock_analyze() is now allowing resize of
memblock region arrays.  Rename it to memblock_allow_resize() and
update its users.

* The following users remain the same other than renaming.

  arm/mm/init.c::arm_memblock_init()
  microblaze/kernel/prom.c::early_init_devtree()
  powerpc/kernel/prom.c::early_init_devtree()
  openrisc/kernel/prom.c::early_init_devtree()
  sh/mm/init.c::paging_init()
  sparc/mm/init_64.c::paging_init()
  unicore32/mm/init.c::uc32_memblock_init()

* In the following users, analyze was used to update total size which
  is no longer necessary.

  powerpc/kernel/machine_kexec.c::reserve_crashkernel()
  powerpc/kernel/prom.c::early_init_devtree()
  powerpc/mm/init_32.c::MMU_init()
  powerpc/mm/tlb_nohash.c::__early_init_mmu()  
  powerpc/platforms/ps3/mm.c::ps3_mm_add_memory()
  powerpc/platforms/embedded6xx/wii.c::wii_memory_fixups()
  sh/kernel/machine_kexec.c::reserve_crashkernel()

* x86/kernel/e820.c::memblock_x86_fill() was directly setting
  memblock_can_resize before populating memblock and calling analyze
  afterwards.  Call memblock_allow_resize() before start populating.

memblock_can_resize is now static inside memblock.c.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: "H. Peter Anvin" <hpa@zytor.com>
2011-12-08 10:22:08 -08:00
Tejun Heo fe091c208a memblock: Kill memblock_init()
memblock_init() initializes arrays for regions and memblock itself;
however, all these can be done with struct initializers and
memblock_init() can be removed.  This patch kills memblock_init() and
initializes memblock with struct initializer.

The only difference is that the first dummy entries don't have .nid
set to MAX_NUMNODES initially.  This doesn't cause any behavior
difference.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: "H. Peter Anvin" <hpa@zytor.com>
2011-12-08 10:22:07 -08:00
Linus Torvalds 32aaeffbd4 Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
* 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
  Revert "tracing: Include module.h in define_trace.h"
  irq: don't put module.h into irq.h for tracking irqgen modules.
  bluetooth: macroize two small inlines to avoid module.h
  ip_vs.h: fix implicit use of module_get/module_put from module.h
  nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
  include: replace linux/module.h with "struct module" wherever possible
  include: convert various register fcns to macros to avoid include chaining
  crypto.h: remove unused crypto_tfm_alg_modname() inline
  uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
  pm_runtime.h: explicitly requires notifier.h
  linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
  miscdevice.h: fix up implicit use of lists and types
  stop_machine.h: fix implicit use of smp.h for smp_processor_id
  of: fix implicit use of errno.h in include/linux/of.h
  of_platform.h: delete needless include <linux/module.h>
  acpi: remove module.h include from platform/aclinux.h
  miscdevice.h: delete unnecessary inclusion of module.h
  device_cgroup.h: delete needless include <linux/module.h>
  net: sch_generic remove redundant use of <linux/module.h>
  net: inet_timewait_sock doesnt need <linux/module.h>
  ...

Fix up trivial conflicts (other header files, and  removal of the ab3550 mfd driver) in
 - drivers/media/dvb/frontends/dibx000_common.c
 - drivers/media/video/{mt9m111.c,ov6650.c}
 - drivers/mfd/ab3550-core.c
 - include/linux/dmaengine.h
2011-11-06 19:44:47 -08:00
Paul Gortmaker 66421a648d microblaze: Add export.h to arch/microblaze files as required
For access to the EXPORT_SYMBOL variants and THIS_MODULE macros.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:06 -04:00
Peter Zijlstra 84ac218f02 microblaze: Remove __ARCH_WANT_INTERRUPTS_ON_CTXSW usage
As far as I can tell the only reason microblaze has
__ARCH_WANT_INTERRUPTS_ON_CTXSW is because it initializes new task state
with interrupts enabled so that on switch_to() interrupts get enabled.

So change copy_thread() to clear MSR_IE instead of set it, this will
ensure switch_to() will always keep IRQs disabled.

The scheduler will disable IRQs when taking rq->lock in schedule() and
enable IRQs in finish_lock_switch() after its done its magic.

This leaves ARM the only __ARCH_WANT_INTERRUPTS_ON_CTXSW user.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-10-14 12:28:42 +02:00
Edgar E. Iglesias 15ec090833 microblaze: Raise SIGFPE/FPE_INTDIV for div by zero
It fixes the signal nr raised for divizion by zero from
SIGILL to SIGFPE, in accordance to POSIX and other archs.

This came up due to a failed test in the GCC testsuite.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-10-14 12:24:31 +02:00
Edgar E. Iglesias 69515f8b95 microblaze: Switch ELF_ARCH code to 189
Switch arch code to 189, the registered code in the upstream
version of binutils. Continue to accept the experimental 0xbaab.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-10-14 12:24:31 +02:00
Eli Billauer 0fb2a6f283 microblaze: Added DMA sync operations
Added support gor dma_direct_sync_single_for_*() and dma_direct_sync_sg_for_*()

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-10-14 12:24:30 +02:00
Eli Billauer cf560c1801 microblaze: Moved __dma_sync() to dma-mapping.h
__dma_sync_page() was replaced by __dma_sync(), and parameters of calls to
the new function were adjusted to match __dma_sync()'s format.

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-10-14 12:24:29 +02:00
Michal Simek 2309f7cfca microblaze: Add PVR for Microblaze v8.20.a
Microblaze v8.20.a has 0x15 version string.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-10-14 12:24:28 +02:00
Michal Simek 9c6f6f549f microblaze: Clear top bit from cnt32_to_63
Top bit is used as garbage and it must be clear
explicitly.
It is causing the problem with soft lookup code
because it checks delays which are long when
top bit is setup.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-10-14 12:24:20 +02:00
NeilBrown f5b9409973 All Arch: remove linkage for sys_nfsservctl system call
The nfsservctl system call is now gone, so we should remove all
linkage for it.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-26 15:09:58 -07:00
Linus Torvalds 9ed3689bdc Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
* 'next' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: Do not show error message for 32 interrupt lines
  Revert "microblaze: PCI fix typo fault in of_node pointer moving into pci_bus"
  microblaze: PCI fix typo fault in of_node pointer moving into pci_bus
  microblaze: Add support for early console on mdm
  microblaze: Simplify early console binding from DT
  microblaze: Get early printk console earlier
  microblaze: Standardise cpuinfo output for cache policy
  microblaze: Unprivileged stream instruction awareness
  microblaze: trivial: Fix typo fault
  microblaze: exec: Remove redundant set_fs(USER_DS)
  microblaze: Remove duplicated prototype of start_thread()
  microblaze: Fix unaligned value saving to the stack for system with MMU
  microblaze/irqs: Do not trace arch_local_{*,irq_*} functions
2011-07-27 09:24:20 -07:00
Michal Simek 363922946f microblaze: Do not show error message for 32 interrupt lines
When interrupt controller uses 32 interrupts lines the kernel
show error message about mismatch in kind-of-intr parameter
because it exceeds u32. Recast fixs this issue.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-07-27 11:02:00 +02:00
Michal Simek ca12adc8ca microblaze: Add support for early console on mdm
Support mdm early console:
 - extend time for retries
 - add mdm compatible property

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-07-25 09:25:26 +02:00
Michal Simek 2aa8e37596 microblaze: Simplify early console binding from DT
Recognize early Linux console from chosen - linux,stdout-path
instead of detecting the first console with appropriate
compatible strings.
This patch solved the problem on system with multiple
consoles.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-07-25 09:25:13 +02:00
Michal Simek e721a45fbe microblaze: Get early printk console earlier
1. Register early console as standard console
2. Enable CON_BOOT console flag to ensure auto-unregistering by the kernel
3. remap_early_printk function remap physical console baseaddr to virtual space

Usage specific function for console remap is done after memory initialization
with IRQ turn off that's why there is not necessary to protect it.

The reason for remapping is that the kernel use TLB 63 for 1:1 address mapping
to be able to use console in very early boot-up phase. But allocating one TLB
just for console caused performance degression that's why ioremaps create new
mapping and TLB 63 is automatically released and ready to use.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Russell King <linux@arm.linux.org.uk>
CC: Ralf Baechle <ralf@linux-mips.org>
CC: Ingo Molnar <mingo@redhat.com>
CC: Alan Cox <alan@linux.intel.com>
CC: <linux-serial@vger.kernel.org>
CC: Arnd Bergmann <arnd@arndb.de>
2011-07-25 09:23:47 +02:00
John A. Williams 95ce618f85 microblaze: Standardise cpuinfo output for cache policy
The current cpuinfo output for the cache policy has no leading tag:, making
it difficult to parse.  Add a leaning "Dcache-policy:" tag to this field.

Signed-off-by: John A. Williams <john.williams@petalogix.com>
2011-07-25 09:13:43 +02:00
John A. Williams 8904976e8c microblaze: Unprivileged stream instruction awareness
Add cpuinfo support for the new MicroBlaze option permitting userspace
(unprivileged) access to the streaming instructions (FSL / AXI-stream).

Emit a noisy warning at bootup if this is enabled, because bad user code
can potentially lockup the CPU.

Signed-off-by: John A. Williams <john.williams@petalogix.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-07-25 09:13:42 +02:00
Mathias Krause a0ec99bda8 microblaze: exec: Remove redundant set_fs(USER_DS)
The address limit is already set in flush_old_exec() so this
set_fs(USER_DS) is redundant.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
2011-07-25 09:07:45 +02:00
Michal Simek c11389406f microblaze: Fix unaligned value saving to the stack for system with MMU
Several registers weren't saved correctly to the stack.

Unaligned expection for system with MMU stores
value in ex_tmp_data_loc_X address which is load to registers r3.
The next step is to move this value from r3 to a destination
register which caused unaligned exception. For several registers
this value was directly moved to the register.

For example for r28:
by "or r28, r0, r3"

but register r28 was rewritten when kernel returns from exception
handler by value saved on stack.

This patch changed r3 saving to the correct address on the stack.
For example for r28:
by "swi r3, r1, 4 * 28"

When kernel returns from the exception handler, correct value is restored.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-07-25 09:07:45 +02:00
Jonas Bonn 66574cc054 modules: make arch's use default loader hooks
This patch removes all the module loader hook implementations in the
architecture specific code where the functionality is the same as that
now provided by the recently added default hooks.

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-07-24 22:06:04 +09:30
Linus Torvalds 571503e100 Merge branch 'setns'
* setns:
  ns: Wire up the setns system call

Done as a merge to make it easier to fix up conflicts in arm due to
addition of sendmmsg system call
2011-05-28 10:51:01 -07:00
Eric W. Biederman 7b21fddd08 ns: Wire up the setns system call
32bit and 64bit on x86 are tested and working.  The rest I have looked
at closely and I can't find any problems.

setns is an easy system call to wire up.  It just takes two ints so I
don't expect any weird architecture porting problems.

While doing this I have noticed that we have some architectures that are
very slow to get new system calls.  cris seems to be the slowest where
the last system calls wired up were preadv and pwritev.  avr32 is weird
in that recvmmsg was wired up but never declared in unistd.h.  frv is
behind with perf_event_open being the last syscall wired up.  On h8300
the last system call wired up was epoll_wait.  On m32r the last system
call wired up was fallocate.  mn10300 has recvmmsg as the last system
call wired up.  The rest seem to at least have syncfs wired up which was
new in the 2.6.39.

v2: Most of the architecture support added by Daniel Lezcano <dlezcano@fr.ibm.com>
v3: ported to v2.6.36-rc4 by: Eric W. Biederman <ebiederm@xmission.com>
v4: Moved wiring up of the system call to another patch
v5: ported to v2.6.39-rc6
v6: rebased onto parisc-next and net-next to avoid syscall  conflicts.
v7: ported to Linus's latest post 2.6.39 tree.

>  arch/blackfin/include/asm/unistd.h     |    3 ++-
>  arch/blackfin/mach-common/entry.S      |    1 +
Acked-by: Mike Frysinger <vapier@gentoo.org>

Oh - ia64 wiring looks good.
Acked-by: Tony Luck <tony.luck@intel.com>

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-05-28 10:48:39 -07:00
Russell King 03eb14199e Merge branch 'devicetree/arm-next' of git://git.secretlab.ca/git/linux-2.6 into devel-stable 2011-05-25 00:08:17 +01:00
Thomas Gleixner a18f22a968 Merge branch 'consolidate-clksrc-i8253' of master.kernel.org:~rmk/linux-2.6-arm into timers/clocksource
Conflicts:
	arch/ia64/kernel/cyclone.c
	arch/mips/kernel/i8253.c
	arch/x86/kernel/i8253.c

Reason: Resolve conflicts so further cleanups do not conflict further

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-05-14 12:06:36 +02:00
Grant Likely 85f60ae4ee dt/flattree: explicitly pass command line pointer to early_init_dt_scan_chosen
This patch drops the reference to a global 'cmd_line' variable from
early_init_dt_scan_chosen, and instead passes the pointer to the command
line string via the *data argument.  Each architecture does something
slightly different with the initial command line, so it makes sense for
the architecture to be able to specify the variable name.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-11 14:53:18 +02:00
Linus Torvalds 42933bac11 Merge branch 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6
* 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6:
  Fix common misspellings
2011-04-07 11:14:49 -07:00
Michal Simek 9e1491de51 microblaze: Fix ftrace
- Do not trace idle loop which takes a lot time
- Fix cache handling in generic ftrace code
- Do not trace lib functions ashldi3, ashrdi3, lshrdi3
  Functions are called from generic ftrace code which
  can't be traced

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-04-01 09:34:51 +02:00
Michal Simek 57bd35d414 microblaze: Wire up new syscalls
Hook up name_to_handle_at, open_by_handle_at, clock_adjtime, syncfs

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-04-01 09:25:05 +02:00
Michal Simek 56d448010f microblaze: Fix level/edge irq sensibility
Patches:
"microblaze: Convert to new irq function names"
sha (4adc192ec7)
and
"microblaze: Use generic show_interrupts()"
sha(9d61c18b25)

should also setup edge/level in irq_set_chip_and_handler_name
name parameter.

Error log:
~ # cat /proc/interrupts
           CPU0
  2:          2  Xilinx INTC-Xilinx INTC  eth0
  3:          2  Xilinx INTC-Xilinx INTC  eth0
  4:        241  Xilinx INTC-Xilinx INTC  timer
  6:        108  Xilinx INTC-Xilinx INTC  serial

Fixed:
~ # cat /proc/interrupts
           CPU0
  2:          2  Xilinx INTC-level     eth0
  3:          2  Xilinx INTC-level     eth0
  4:        238  Xilinx INTC-edge      timer
  6:        108  Xilinx INTC-level     serial

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Thomas Gleixner <tglx@linutronix.de>

---

v2: Fix exchanged edge and level
2011-04-01 09:25:04 +02:00
Lucas De Marchi 25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Thomas Gleixner 9d61c18b25 microblaze: Use generic show_interrupts()
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-03-29 14:48:06 +02:00
Thomas Gleixner 4adc192ec7 microblaze: Convert to new irq function names
Namespace conversion scripted with coccinelle.

Also retrieve the irq type from irq_data in intc_enable_or_unmask()

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-03-29 14:48:06 +02:00
Linus Torvalds a44f99c7ef Merge branch 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: (25 commits)
  video: change to new flag variable
  scsi: change to new flag variable
  rtc: change to new flag variable
  rapidio: change to new flag variable
  pps: change to new flag variable
  net: change to new flag variable
  misc: change to new flag variable
  message: change to new flag variable
  memstick: change to new flag variable
  isdn: change to new flag variable
  ieee802154: change to new flag variable
  ide: change to new flag variable
  hwmon: change to new flag variable
  dma: change to new flag variable
  char: change to new flag variable
  fs: change to new flag variable
  xtensa: change to new flag variable
  um: change to new flag variables
  s390: change to new flag variable
  mips: change to new flag variable
  ...

Fix up trivial conflict in drivers/hwmon/Makefile
2011-03-20 18:14:55 -07:00
matt mooney 9cce34ba6e microblaze: change to new flag variable
Replace EXTRA_CFLAGS with ccflags-y.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-03-17 14:02:56 +01:00
Linus Torvalds 51e8703bdf Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
* 'next' of git://git.monstr.eu/linux-2.6-microblaze: (33 commits)
  microblaze: Do not copy reset vectors/manual reset vector setup
  microblaze: Fix _reset function
  microblaze: Fix microblaze init vectors
  microblaze: Fix circular headers dependency when ftrace is enabled.
  microblaze: Fix typo in Kconfig
  microblaze: Add missing export symbols for lib functions
  microblaze: Fix /dev/zero corruption from __clear_user()
  microblaze: Convert irq_chip to new functions
  microblaze: Select GENERIC_HARDIRQS_NO_DEPRECATED
  microblaze: Remove stale irq_chip.end
  microblaze: Fix sparse warnings - signal.c
  microblaze: Fix sparse warning - fault.c
  microblaze: Fix missing microblaze specific syscalls declaration
  microblaze: Fix sparse warnings - cache.c
  microblaze: Fix sparse warning - cpuinfo.h
  microblaze: Fix sparse warning - unwind.c
  microblaze: Fix sparse warning - consistent_alloc function
  microblaze: Fix sparse warnings - ptrace
  microblaze: Fix sparse warning - sw_exceptions
  microblaze: Fix sparse warning - timer.c
  ...
2011-03-16 10:48:16 -07:00
Michal Simek 0b9b0200b0 microblaze: Do not copy reset vectors/manual reset vector setup
Reset vector can be setup by bootloader and kernel doens't need
to touch it. If you require to setup reset vector, please use
CONFIG_MANUAL_RESET_VECTOR throught menuconfig.
It is not possible to setup address 0x0 as reset address because
make no sense to set it up at all.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: John Williams <john.williams@petalogix.com>
2011-03-15 10:59:00 +01:00
Michal Simek 7574349cee microblaze: Fix _reset function
If soft reset falls through with no hardware assisted reset, the best
we can do is jump to the reset vector and see what the bootloader left
for us.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: John Williams <john.williams@petalogix.com>
2011-03-15 10:58:44 +01:00
Michal Simek 626afa35c1 microblaze: Fix microblaze init vectors
Microblaze vector table stores several vectors (reset, user exception,
interrupt, debug exception and hardware exception).
All these functions can be below address 0x10000. If they are, wrong
vector table is genarated because jump is not setup from two instructions
(imm upper 16bit and brai lower 16bit).
Adding specific offset prevent problem if address is below 0x10000.
For this case only brai instruction is used.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-15 10:58:34 +01:00
Michal Simek d50c3036fa microblaze: Add missing export symbols for lib functions
Adding missing export symbols for loadable modules.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:59 +01:00
Thomas Gleixner 6f205a4c69 microblaze: Convert irq_chip to new functions
Use proper irq_desc wrappers while at it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:59 +01:00
Thomas Gleixner 6c3564d3f6 microblaze: Remove stale irq_chip.end
irq_chip.end got obsolete with the removal of __do_IRQ().

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Tested-by: Michal Simek <monstr@monstr.eu>
LKML-Reference: <20110203004210.240154507@linutronix.de>
2011-03-09 08:09:59 +01:00
Michal Simek 2cfedb97d6 microblaze: Fix sparse warnings - signal.c
Warning log:
CHECK   arch/microblaze/kernel/signal.c
arch/microblaze/kernel/signal.c:200:9: warning: Using plain integer as NULL pointer
arch/microblaze/kernel/signal.c:201:9: warning: incorrect type in initializer (different address spaces)
arch/microblaze/kernel/signal.c:201:9:    expected void [noderef] *volatile __gu_val<asn:1>
arch/microblaze/kernel/signal.c:201:9:    got void *<noident>

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:59 +01:00
Michal Simek 4302e5254a microblaze: Fix missing microblaze specific syscalls declaration
Warning log:
CHECK   arch/microblaze/kernel/sys_microblaze.c
arch/microblaze/kernel/sys_microblaze.c:37:17: warning: symbol 'microblaze_vfork' was not declared. Should it be static?
arch/microblaze/kernel/sys_microblaze.c:43:17: warning: symbol 'microblaze_clone' was not declared. Should it be static?
arch/microblaze/kernel/sys_microblaze.c:50:17: warning: symbol 'microblaze_execve' was not declared. Should it be static?

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:58 +01:00
Michal Simek 954e8b9599 microblaze: Fix sparse warnings - cache.c
Warning log:
CHECK   arch/microblaze/kernel/cpu/cache.c
arch/microblaze/kernel/cpu/cache.c:522:21: warning: symbol 'wb_msr' was not declared. Should it be static?
arch/microblaze/kernel/cpu/cache.c:538:21: warning: symbol 'wb_nomsr' was not declared. Should it be static?
arch/microblaze/kernel/cpu/cache.c:554:21: warning: symbol 'wt_msr' was not declared. Should it be static?
arch/microblaze/kernel/cpu/cache.c:569:21: warning: symbol 'wt_nomsr' was not declared. Should it be static?
arch/microblaze/kernel/cpu/cache.c:585:21: warning: symbol 'wt_msr_noirq' was not declared. Should it be static?
arch/microblaze/kernel/cpu/cache.c:600:21: warning: symbol 'wt_nomsr_noirq' was not declared. Should it be static?

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:58 +01:00
Michal Simek 419ef3406a microblaze: Fix sparse warning - unwind.c
Warning log:
CHECK   arch/microblaze/kernel/unwind.c
arch/microblaze/kernel/unwind.c:186:6: warning: symbol 'microblaze_unwind_inner' was not declared. Should it be static?

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:58 +01:00
Michal Simek c1df53b33c microblaze: Fix sparse warnings - ptrace
Warning log:
CHECK   arch/microblaze/kernel/ptrace.c
arch/microblaze/kernel/ptrace.c:126:11: warning: incorrect type in initializer (different address spaces)
arch/microblaze/kernel/ptrace.c:126:11:    expected unknown type 2[noderef] *__pu_addr<asn:1>
arch/microblaze/kernel/ptrace.c:126:11:    got unsigned long *<noident>
arch/microblaze/kernel/ptrace.c:134:17: warning: symbol 'do_syscall_trace_enter' was not declared. Should it be static?
arch/microblaze/kernel/ptrace.c:157:17: warning: symbol 'do_syscall_trace_leave' was not declared. Should it be static?

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:58 +01:00
Michal Simek f699980b0d microblaze: Fix sparse warning - sw_exceptions
Function sw_exception is linked with asm code.

Warning log:
CHECK   arch/microblaze/kernel/exceptions.c
arch/microblaze/kernel/exceptions.c:53:6: warning: symbol 'sw_exception' was not declared. Should it be static?

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:58 +01:00
Michal Simek 29e3dbb10f microblaze: Fix sparse warning - timer.c
Variables and init_microblaze_timecounter should be static.

Warning log:
CHECK   arch/microblaze/kernel/timer.c
arch/microblaze/kernel/timer.c:41:14: warning: symbol 'freq_div_hz' was not declared. Should it be static?
arch/microblaze/kernel/timer.c:42:14: warning: symbol 'timer_clock_freq' was not declared. Should it be static?
arch/microblaze/kernel/timer.c:205:12: warning: symbol 'init_microblaze_timecounter' was not declared. Should it be static?

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:57 +01:00
Michal Simek fe34c478d1 microblaze: Fix sparse warning - prom.c
Warning log:
CHECK   arch/microblaze/kernel/dma.c
arch/microblaze/kernel/dma.c:53:26: warning: incorrect type in argument 1 (different base types)
arch/microblaze/kernel/dma.c:53:26:    expected int [signed] gfp
arch/microblaze/kernel/dma.c:53:26:    got restricted unsigned int [usertype] flag

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:57 +01:00
Michal Simek 5323c48b0c microblaze: Add support for DMA_BIDIRECTIONAL
CDMA requires DMA_BIDIRECTIONAL option.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:57 +01:00
Michal Simek 0a2e1d23f2 microblaze: trivial: Add one empty line
Add one empty line to microblaze_ksyms.c.
Remove one empty line to cacheflush.h.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:57 +01:00
Michal Simek a9dbe5eb1f microblaze: Add PVR for Microblaze v8.10.a
Microblaze v8.10.a has 0x14 version string.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:55 +01:00
Michal Simek b9dc9e7781 microblaze: Label MB 7.20.d as broken with WB cache
MB version 7.20.d contains fault which is related with WB that's why
error message will be shown.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:55 +01:00
Michal Simek cd3415779b microblaze: Do not use "la" pseudo instruction - use addik instead
"la" pseudo instruction is only translation to "addik".
Use directly "addik" which is described in the MB reference guide.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:54 +01:00
Michal Simek 6e83557c38 microblaze: Remove r0_ram pointer and PTO alignment
r0_ram pool was used for saving/restoring register
content if hw exception happen. This poll was replaced by
pt_pool_space with PT_SIZE size.
Based on this change SAVE_STATE_ARG_SPACE was removed which
caused that PTO offset is zero that's why is also removed.

r0_ram space was used as scratchpad by v850. In early
Microblaze Linux developing phase was this part of code
blindly copied.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:54 +01:00
Michal Simek d8748e73e8 microblaze: Do not use r0_ram space for syscall debugging
Remove syscall counting space from r0_ram. Use special
syscall_debug_table pool for syscall statistic.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:54 +01:00
Michal Simek 495162dfef microblaze: Optimize BE/LE bootup detecting
Save 0x1 word to rodata section and remove online value
loading if DTB is passed from bootloader. It saves two
asm instructions in bootup.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:53 +01:00
Michal Simek c06b3a0682 microblaze: Do not use r0_ram space for hw exception debugging
Remove hw exception counting space from r0_ram. Use special
exception_debug_table poll for exception statistic.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:53 +01:00
Thomas Gleixner 7acdbb3f35 Merge branch 'linus' into x86/platform
Reason: Import mainline device tree changes on which further patches
        depend on or conflict.

Trivial conflict in: drivers/spi/pxa2xx_spi_pci.c

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-02-23 09:21:41 +01:00
John Stultz b8f39f7dfe microblaze: convert to clocksource_register_hz/khz
This converts the microblaze clocksources to use clocksource_register_hz/khz

CC: Michal Simek <monstr@monstr.eu>
CC: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: John Stultz <johnstul@us.ibm.com>
2011-02-21 13:33:46 -08:00
Michal Simek 0eb6aaf529 microblaze: Fix msr instruction detection
Fix msr instructions detection. The current code
just use msrclr for loading msr content and compare
it with proper MSR content. If msrclr is not implemented
r8 contains pc address.
Previous code wanted to use MSR carry bit but if msrclr
wasn't implemented carry wasn't cleared.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-02-07 19:13:01 +01:00
Michal Simek 1649700408 microblaze: Fix asm compilation warning
Microblaze ASM doesn't support hex values for mfs instructions.

/tmp/ccwiXVmt.s: Assembler messages:
/tmp/ccwiXVmt.s:19: Warning: ignoring operands: x00

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-02-07 19:12:17 +01:00
Sebastian Andrzej Siewior 04bea68b2f of/pci: move of_irq_map_pci() into generic code
There is a tiny difference between PPC32 and PPC64. Microblaze uses the
PPC32 variant.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
[grant.likely@secretlab.ca: Added comment to #endif, moved documentation
	block to function implementation, fixed for non ppc and microblaze
	compiles]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-02-04 11:46:50 -07:00
Michal Simek 9c749e177c microblaze: Fix unaligned issue on MMU system with BS=0 DIV=1
Unaligned code use shift for finding register operand.
There is used BSRLI(r8,r8,2) macro which is expand for BS=0, DIV=1
by
	ori rD, r0, (1 << imm);	\
	idivu rD, rD, rA

but if rD is equal rA then ori instruction rewrite value which
should be devide.

The patch remove this macro which use idivu instruction because
idivu takes 32/34 cycles. The highest shifting is 20 which takes
20 cycles.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-01-28 14:05:00 +01:00
Michal Simek 026a207879 microblaze: Fix DTB passing from bootloader
Little endian system needs to check OF_DT_HEADER
but it is swapped because it is in big-endian.
Microblaze LE provides lwr instruction which loads
magic number in BIG endian format which can be compared.

There is used the fact that if you write 0x1 as word
and load it as byte then you get for big-endian zero
and 1 for little-endian.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-01-28 14:04:36 +01:00
Grant Likely 672c54466d dt/flattree: Return virtual address from early_init_dt_alloc_memory_arch()
The physical address is never used by the device tree code when
allocating memory for unflattening.  Change the architecture's alloc
hook to return the virutal address instead.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-01-15 22:01:58 -07:00
Linus Torvalds 0969d11e20 Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
* 'next' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: remove obsolete DEBUG_BOOTMEM
  microblaze: trivial: Fix removed the part of line
  microblaze: Fix __muldi3 function for little-endian.
  microblaze: Clear i/dcache for sw breakpoints
  microblaze: Remove useless early_init_dt_check_for_initrd
  microblaze: Fix unaligned exception for little endian platform
  microblaze: Add PVR for Microblaze v8.00.b
  microblaze: Correct PVR access macros
  Revert "microblaze: Simplify syscall rutine"
  microblaze: Fix initramfs
  arch/microblaze: Remove unnecessary semicolons
2011-01-11 11:13:46 -08:00
Michal Simek 17b9314687 microblaze: Clear i/dcache for sw breakpoints
There is necessary to flush dcache and invalidate
icache for address where breakpoint (brki r16, 0x18)
was. The reason is that for some cases icache line
still keeps brki instruction and it is not updated
by origin instruction maintains by gdbserver.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-01-03 10:16:56 +01:00
Michal Simek 27cbe8d4d1 microblaze: Remove useless early_init_dt_check_for_initrd
Remove copy&paste error. Microblaze doesn't support initrd.

Signed-off-by: Walter Goossens <waltergoossens@home.nl>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-01-03 10:12:43 +01:00
Michal Simek e3288f3101 microblaze: Fix unaligned exception for little endian platform
Half word unaligned accesses need to be fixed.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-01-03 10:08:29 +01:00
Michal Simek a3c26959cc microblaze: Add PVR for Microblaze v8.00.b
Microblaze v8.00.b have 0x13 version string.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-01-03 10:08:16 +01:00
Michal Simek 9da6345885 Revert "microblaze: Simplify syscall rutine"
This reverts commit 0e41c90908.

Break jffs2 rootfs because the patch removes syscall calling
from kernel space.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-11-18 13:13:52 +01:00
Michal Simek 8cb473da3f microblaze: Fix initramfs
Patch: initramfs: generalize initramfs_data.xxx.S variants
(sha1 6ae64e428f)
requires hooks in linker script.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-11-18 13:02:54 +01:00
David Daney 4b6ba8aacb of/net: Move of_get_mac_address() to a common source file.
There are two identical implementations of of_get_mac_address(), one
each in arch/powerpc/kernel/prom_parse.c and
arch/microblaze/kernel/prom_parse.c.  Move this function to a new
common file of_net.{c,h} and adjust all the callers to include the new
header.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
[grant.likely@secretlab.ca: protect header with #ifdef]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-11-01 01:08:14 -04:00
Namhyung Kim cfd866f6bd ptrace: cleanup arch_ptrace() on microblaze
Remove checking @addr greater than 0 because @addr is now unsigned.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: Michal Simek <monstr@monstr.eu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-27 18:03:11 -07:00
Namhyung Kim 9b05a69e05 ptrace: change signature of arch_ptrace()
Fix up the arguments to arch_ptrace() to take account of the fact that
@addr and @data are now unsigned long rather than long as of a preceding
patch in this series.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: <linux-arch@vger.kernel.org>
Acked-by: Roland McGrath <roland@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-27 18:03:10 -07:00
Linus Torvalds e0e170bd7d Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
* 'next' of git://git.monstr.eu/linux-2.6-microblaze: (42 commits)
  microblaze: Fix build with make 3.82
  fbdev/xilinxfb: Microblaze driver support
  microblaze: Support C optimized lib functions for little-endian
  microblaze: Separate library optimized functions
  microblaze: Support timer on AXI lite
  microblaze: Add support for little-endian Microblaze
  microblaze: KGDB little endian support
  microblaze: Add PVR for endians plus detection
  net: emaclite: Add support for little-endian platforms
  microblaze: trivial: Add comment for AXI pvr
  microblaze: pci-common cleanup
  microblaze: Support early console on uart16550
  microblaze: Do not compile early console support for uartlite if is disabled
  microblaze: Setup early console dynamically
  microblaze: Rename all uartlite early printk functions
  microblaze: remove early printk uarlite console dependency from header
  microblaze: Remove additional compatible properties
  microblaze: Remove hardcoded asm instraction for PVR loading
  microblaze: Use static const char * const where possible
  microblaze: Define VMALLOC_START/END
  ...
2010-10-25 16:53:11 -07:00
Grant Likely 32c97689c4 of/flattree: Eliminate need to provide early_init_dt_scan_chosen_arch
This patch refactors the early init parsing of the chosen node so that
architectures aren't forced to provide an empty implementation of
early_init_dt_scan_chosen_arch.  Instead, if an architecture wants to
do something different, it can either use a wrapper function around
early_init_dt_scan_chosen(), or it can replace it altogether.

This patch was written in preparation to adding device tree support to
both x86 ad MIPS.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Tested-by: David Daney <ddaney@caviumnetworks.com>
2010-10-21 11:10:10 -06:00
Michal Simek ccea0e6e49 microblaze: Support timer on AXI lite
New microblaze systems uses two buses. One for memories
and flashes and the second for low-speed peripherals
which can run on different CLK. This is the reason
why the kernel is trying to read clock-frequency
directly from node. If there is then the kernel will
work with it. If not then cpu CLK is used.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:52:00 +10:00
Michal Simek 02b08045a0 microblaze: Add support for little-endian Microblaze
Microblaze little-endian toolchain exports __MICROBLAZEEL__
which is used in the kernel to identify little/big endian.

The most of the changes are in loading values from DTB which
is always big endian.

Little endian platforms are based on new AXI bus which has
impact to early uartlite initialization.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:59 +10:00
Michal Simek e4f2909227 microblaze: KGDB little endian support
Just need to use little-endian opcode for brki r16, 0x18

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Jason Wessel <jason.wessel@windriver.com>
2010-10-21 15:51:58 +10:00
Michal Simek 8e2ad016b2 microblaze: Add PVR for endians plus detection
Upcomming microblaze version will support little-endian.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
2010-10-21 15:51:57 +10:00
Michal Simek 67f4aaa21c microblaze: Support early console on uart16550
Early console support reuse setting from U-BOOT that's why
it is not necessary to setup baudrates, etc.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:53 +10:00
Michal Simek 51f5fa5094 microblaze: Do not compile early console support for uartlite if is disabled
Kconfig blocks to select any other early console support that's why
this patch has no real impact on current kernel version. But it is done
because of uart16550.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:52 +10:00
Michal Simek 9a7e8d805e microblaze: Setup early console dynamically
Just setup pointer early console in run time.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:51 +10:00
Michal Simek 2af9ebe951 microblaze: Rename all uartlite early printk functions
This is done because of uart16550 early printk support

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:49 +10:00
Michal Simek e65f1e2843 microblaze: Remove additional compatible properties
Device-tree BSP generates longer compatible properties
that's why we can remove extra/old one.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:47 +10:00
Michal Simek a7d8355008 microblaze: Remove hardcoded asm instraction for PVR loading
It comes from past where pvr wasn't supported in msr instruction.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:46 +10:00
Joe Perches 92ee8bd468 microblaze: Use static const char * const where possible
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:45 +10:00
Michal Simek bd3b492a29 microblaze: Export missing symbols for modules
Several kernel modules requires empty_zero_page and mbc
to be exported.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:43 +10:00
Michal Simek 4e07dba7cb microblaze: Add libgcc function directly to kernel
Replaced libgcc functions with asm optimized implementation.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:42 +10:00
Michal Simek 4d24d7f7ae microblaze: wire up prlimit64 and fanotify* syscalls
Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:38 +10:00
Michal Simek f66efecad0 microblaze: Add new microblaze versions
PVR for 7.30.b, 8.00.a versions.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:35 +10:00
Michal Simek b3ea838093 microblaze: remove OUTPUT_FORMAT from linker script
OUTPUT_FORMAT setup bigendian platform. Microblaze Linux port
is becoming bi endian that's why it is removed.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:34 +10:00
Michal Simek 600eb6110a microblaze: Fix r16 and r17 reg saving
r16 and r17 should be saved across interrupt and exception handling.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:33 +10:00
Michal Simek 69717607f0 microblaze: Report if only one timer is used
Kernel needs two timers because of clocksource and clockevent.
It is better to show warning message directly on early
console if available. If it isn't available kernel log buffer
contains it.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:30 +10:00
Michal Simek 7d4320956f microblaze: Clear return value in pt_regs
Signal code uses r3 value which saved in restore_sigcontext to
rt_sigframe but it require to be zeroed. If is not zero rt_sigframe
contains wrong values.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:29 +10:00
Michal Simek 791d0a169b microblaze: Fix sys_rt_sigreturn_wrapper
Do not save return registers before rt_sigreturn is called.
_user_exception(syscall handler) already setup return address
that's why it is removed from rt_sigreturn_wrapper.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:27 +10:00
Michal Simek 0425609680 microblaze: Remove old user debugging gdb stub
Old gdb uses priviledged exception handler to handle
gdb exception. New gdb uses brki r16, 0x18 that's why
we can remove old gdb support.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:23 +10:00
Michal Simek f859f0a235 microblaze: kgdb: Remove unused variable and fix return value
I forget to remove unused variable from kgdb_arch_handle_exception.
Fix return value in microblaze_kgdb_break function.

Error log:
arch/microblaze/kernel/kgdb.c: In function 'microblaze_kgdb_break':
arch/microblaze/kernel/kgdb.c:83: warning: 'return' with a value, in function returning void
arch/microblaze/kernel/kgdb.c: In function 'kgdb_arch_handle_exception':
arch/microblaze/kernel/kgdb.c:119: warning: unused variable 'cpu'

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:19 +10:00
Joe Perches c4554c32a7 microblaze: Remove pr_<level> uses of KERN_<level>
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:37:28 +10:00
Linus Torvalds 86ea51d4a2 Merge branch 'merge-devicetree' of git://git.secretlab.ca/git/linux-2.6
* 'merge-devicetree' of git://git.secretlab.ca/git/linux-2.6:
  spi.h: missing kernel-doc notation, please fix
  of: fix missing headers for of_address_to_resource() in MTD and SysACE drivers
  of: Fix missing includes
  ata: update for of_device to platform_device replacement
  microblaze: Fix of: eliminate of_device->node and dev_archdata->{of,prom}_node
  microblaze: Fix of/address: Merge all of the bus translation code
  booting-without-of: Remove nonexistent chapters from TOC, fix numbering
2010-08-18 09:26:17 -07:00
David Howells d7627467b7 Make do_execve() take a const filename pointer
Make do_execve() take a const filename pointer so that kernel_execve() compiles
correctly on ARM:

arch/arm/kernel/sys_arm.c:88: warning: passing argument 1 of 'do_execve' discards qualifiers from pointer target type

This also requires the argv and envp arguments to be consted twice, once for
the pointer array and once for the strings the array points to.  This is
because do_execve() passes a pointer to the filename (now const) to
copy_strings_kernel().  A simpler alternative would be to cast the filename
pointer in do_execve() when it's passed to copy_strings_kernel().

do_execve() may not change any of the strings it is passed as part of the argv
or envp lists as they are some of them in .rodata, so marking these strings as
const should be fine.

Further kernel_execve() and sys_execve() need to be changed to match.

This has been test built on x86_64, frv, arm and mips.

Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-17 18:07:43 -07:00
Michal Simek a8dcb878b6 microblaze: Fix of/address: Merge all of the bus translation code
Commit dbbdee9473 removed
of_irq_pci_swizzle but didn't use pci_swizzle_interrupt_pin
instead.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-08-16 14:55:46 -06:00
David Howells c788732523 Mark arguments to certain syscalls as being const
Mark arguments to certain system calls as being const where they should be but
aren't.  The list includes:

 (*) The filename arguments of various stat syscalls, execve(), various utimes
     syscalls and some mount syscalls.

 (*) The filename arguments of some syscall helpers relating to the above.

 (*) The buffer argument of various write syscalls.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-13 16:53:13 -07:00
Linus Torvalds 03c0c29aff Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6
* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6: (63 commits)
  of/platform: Register of_platform_drivers with an "of:" prefix
  of/address: Clean up function declarations
  of/spi: call of_register_spi_devices() from spi core code
  of: Provide default of_node_to_nid() implementation.
  of/device: Make of_device_make_bus_id() usable by other code.
  of/irq: Fix endian issues in parsing interrupt specifiers
  of: Fix phandle endian issues
  of/flattree: fix of_flat_dt_is_compatible() to match the full compatible string
  of: remove of_default_bus_ids
  of: make of_find_device_by_node generic
  microblaze: remove references to of_device and to_of_device
  sparc: remove references to of_device and to_of_device
  powerpc: remove references to of_device and to_of_device
  of/device: Replace of_device with platform_device in includes and core code
  of/device: Protect against binding of_platform_drivers to non-OF devices
  of: remove asm/of_device.h
  of: remove asm/of_platform.h
  of/platform: remove all of_bus_type and of_platform_bus_type references
  of: Merge of_platform_bus_type with platform_bus_type
  drivercore/of: Add OF style matching to platform bus
  ...

Fix up trivial conflicts in arch/microblaze/kernel/Makefile due to just
some obj-y removals by the devicetree branch, while the microblaze
updates added a new file.
2010-08-05 15:57:35 -07:00
Michal Simek 2d5973cb5a microblaze: Add KGDB support
Kgdb uses brki r16, 0x18 instruction to call
low level _debug_exception function which save
current state to pt_regs and call microblaze_kgdb_break
function. _debug_exception should be called only from
the kernel space. User space calling is not supported
because user application debugging uses different handling.

pt_regs_to_gdb_regs loads additional special registers
which can't be changed

 * Enable KGDB in Kconfig
 * Remove ancient not-tested KGDB support
 * Remove ancient _debug_exception code from entry.S

Only MMU KGDB support is supported.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Jason Wessel <jason.wessel@windriver.com>
CC: John Williams <john.williams@petalogix.com>
CC: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
CC: linux-kernel@vger.kernel.org
Acked-by: Jason Wessel <jason.wessel@windriver.com>
2010-08-04 10:45:17 +02:00
Michal Simek 751f1605e0 microblaze: Support brki rX, 0x18 for user application debugging
This is the first patch which add support for
user application debugging through brki rX, 0x18 vector.

This patch has side effect which also remove security issue
to use brki rX, 0x18 to freeze kernel.

Support for old gdb support via priviledged exception
(brk r0, r0) is still there. It will be remove in future.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:45:16 +02:00
Michal Simek 958063e67b microblaze: Remove nop after MSRCLR/SET, MTS, MFS instructions
We need to save instruction and the latest Microblaze shouldn't
have any problem with it.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:45:16 +02:00
Michal Simek 0e41c90908 microblaze: Simplify syscall rutine
Syscall can be called only from userspace that's why
we don't need to check which space kernel come from.

Kernel syscall calling is not check and shouldn't come
throught this part of code.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:45:15 +02:00
Michal Simek 0a6b08fda6 microblaze: Move PT_MODE saving to delay slot
We can save one more instruction if PT_MODE is saved in delay slot

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:45:14 +02:00
Michal Simek 80c5ff6b9b microblaze: Fix _interrupt function
Save instructions by using delay slot and
clear UMS only if kernel comes from user space.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:45:13 +02:00
Michal Simek 25f6e59657 microblaze: Fix _user_exception function
Saving some instructions. Clear VMS bit if kernel comes
from kernel space.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:45:12 +02:00
Michal Simek 287503fabd microblaze: Put together addik instructions
Saving instructions by adding 2/3 addik instructions to one.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:44:56 +02:00
Michal Simek 9814cc11e5 microblaze: Use delay slot in syscall macros
Saving instruction with delay slot usage.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:32:22 +02:00
Michal Simek da23355280 microblaze: Save kernel mode in delay slot
This change save one instruction if kernel comes from kernel
space.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:32:21 +02:00
Michal Simek e7741075b3 microblaze: Do not mix register saving and mode setting
Separate reg saving and mode setting.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:32:20 +02:00
Michal Simek e5d2af2b96 microblaze: Move SAVE_STATE upward
SAVE_STATE macro could be used by other rutines too.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:31:09 +02:00
Michal Simek 66f7de8634 microblaze: entry.S: Macro optimization
We are not working with values from MSR that's why
we can discard it and use r11 for different purpose without
saving/restoring.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:30:07 +02:00
Michal Simek c318d483b3 microblaze: Optimize hw exception rutine
Remove set_vms because UMS is cleared and VMS is already setup.
Optimize function calling which save one additional instruction.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:30:06 +02:00
Michal Simek b318067e2c microblaze: Implement clear_ums macro and fix SAVE_STATE macro
VMS is always setup because VM mode was before
exception/syscall/interrupt. Kernel continues in kernel mode
that's why we have to clear UMS bit if kernel comes from
user space.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:29:44 +02:00
Michal Simek 77f6d22605 microblaze: Remove additional setup for kernel_mode
PT_MODE stores information if kernel comes from user
or kernel space. If come from user space, PT_MODE
contains 0. If come from kernel store, PT_MODE contains
non zero value. We don't need to save value 1. I am using
r1 register which contains non zero value.
This change save one additional instruction.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:22:53 +02:00
Michal Simek 06a54604a3 microblaze: Optimize SAVE_STATE macro
SAVE_STATE macro could be used for user_exception
or interrupt functions.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:22:52 +02:00
Michal Simek 40eb0dc456 microblaze: Remove additional loading
We don't need to save r0 to PT_R0. It could be additional
operation.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:22:51 +02:00
Michal Simek 653e447e11 microblaze: Completely remove working with R11 register
We don't need to save R11 register. There is easy way
to use only R1 which is saved and restore later.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:22:50 +02:00
Michal Simek 0388107dd5 microblaze: Do not setup BIP in _debug_exception
BIP is already setup.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:22:50 +02:00
Michal Simek 06b2864038 microblaze: Simplify _debug_exception function
Keep together all arguments for send_sig function.
Move returning address to delay slot which is executed.
Remove additional send_sig loading. I am using IMM part of
rtbd instruction with r0.

old solution:
addik r11, r0, send_sig
rtbd r11, 0
nop

new solution:
rtbd r0, send_sig
nop

There is one instruction saving.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:22:48 +02:00
Michal Simek 8b110d157c microblaze: Optimize SAVE_STATE macro
It is necessary to setup BIP and EE and clear EIP
only for unaligned exception handler. The rest of
hw exception handlers don't require it.
HW exception occured and we are not in virtual mode.
That's why we can do operations protected by EIP.
Interrupt, next hw exception or syscall can't occur.

EIP is cleared by rted.

This change speedup page_fault hw exception handler
which is critical path.

There is also necessary to save R11 content before
flag setup for unaligned exception.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:22:48 +02:00