aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-08-05MIPS: math-emu: Checkpatch cleanupAndrea Gelmini1-2/+1
arch/mips/math-emu/sp_tint.c:76: ERROR: else should follow close brace '}' Signed-off-by: Andrea Gelmini <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/1275/ Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05MIPS: math-emu: Checkpatch cleanupAndrea Gelmini1-1/+1
arch/mips/math-emu/sp_modf.c:32: ERROR: "foo * bar" should be "foo *bar" Signed-off-by: Andrea Gelmini <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/1273/ Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05MIPS: math-emu: Checkpatch cleanupAndrea Gelmini1-2/+1
arch/mips/math-emu/dp_tlong.c:75: ERROR: else should follow close brace '}' Signed-off-by: Andrea Gelmini <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/1272/ Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05MIPS: math-emu: Checkpatch cleanupAndrea Gelmini1-2/+1
arch/mips/math-emu/dp_tint.c:73: ERROR: else should follow close brace '}' Signed-off-by: Andrea Gelmini <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/1271/ Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05MIPS: math-emu: Checkpatch cleanupAndrea Gelmini1-1/+1
arch/mips/math-emu/dp_modf.c:32: ERROR: "foo * bar" should be "foo *bar" Signed-off-by: Andrea Gelmini <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/1269/ Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05MIPS: DECstation: Checkpatch cleanupAndrea Gelmini1-2/+1
arch/mips/dec/promcon.c:37: ERROR: that open brace { should be on the previous line Signed-off-by: Andrea Gelmini <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/1270/ Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05MIPS: Yosemite: ht-irq.c: Checkpatch cleanupAndrea Gelmini1-7/+6
arch/mips/pmc-sierra/yosemite/ht-irq.c:38: ERROR: code indent should use tabs where possible arch/mips/pmc-sierra/yosemite/ht-irq.c:39: ERROR: code indent should use tabs where possible arch/mips/pmc-sierra/yosemite/ht-irq.c:40: ERROR: code indent should use tabs where possible arch/mips/pmc-sierra/yosemite/ht-irq.c:43: ERROR: code indent should use tabs where possible arch/mips/pmc-sierra/yosemite/ht-irq.c:44: ERROR: code indent should use tabs where possible arch/mips/pmc-sierra/yosemite/ht-irq.c:45: ERROR: code indent should use tabs where possible Signed-off-by: Andrea Gelmini <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/1268/ Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05MIPS: PowerTV: Correct ASIC device register names and locationsDavid VomLehn5-8/+8
Correct ASIC device register names and addresses for USB devices. Signed-off-by: David VomLehn <[email protected]> To: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/1258/ Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05MIPS: PowerTV: Use O(1) algorthm for phys_to_dma/dma_to_physDavid VomLehn6-142/+529
Replace phys_to_dma()/dma_to_phys() looping algorithm with an O(1) algorithm The approach taken is inspired by the sparse memory implementation: take a certain number of high-order bits off the address them, use this as an index into a table containing an offset to the desired address and add it to the original value. There is a table for mapping physical addresses to DMA addresses and another one for the reverse mapping. The table sizes depend on how fine-grained the mappings need to be; Coarser granularity less to smaller tables. On a processor with 32-bit physical and DMA addresses, with 4 MIB granularity, memory usage is two 2048-byte arrays. Each 32-byte cache line thus covers 64 MiB of address space. Also, renames phys_to_bus() to phys_to_dma() and bus_to_phys() to dma_to_phys() to align with kernel usage. [Ralf: Fixed silly build breakage due to stackoverflow warning caused by huge array on stack.] Signed-off-by: David VomLehn <[email protected]> To: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/1257/ Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05MIPS: MTX1: Fix build.Ralf Baechle3-3/+12
CC arch/mips/alchemy/mtx-1/board_setup.o {standard input}: Assembler messages: {standard input}:263: Error: opcode not supported on this processor: mips1 (mips1) `sync' {standard input}:274: Error: opcode not supported on this processor: mips1 (mips1) `sync' {standard input}:296: Error: opcode not supported on this processor: mips1 (mips1) `sync' [...] Any .set mipsX statement other than .set mips0 at the end of inline assembler is a big fat bug. Introduced by 9482eabeca315c0276ffb50026b7482481b7097b (linux-mips.org) rsp. 32fd6901a6d8d19f94e4de6be4e4b552ab078620 (kernel.org). While at it, fix the same issue in arch/mips/alchemy/devboards/pb1000/board_setup.c arch/mips/alchemy/xxs1500/board_setup.c as well. Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05MIPS: BCM47xx: Activate SSB_B43_PCI_BRIDGE by defaultHauke Mehrtens1-0/+1
B43_pci_bridge is needed to use the b43 driver with brcm47xx. Activate it by default if PCI is available. Signed-off-by: Hauke Mehrtens <[email protected]> To: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/1510/ Acked-by: Florian Fainelli <[email protected]> Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05MIPS: BCM47xx: Really fix 128MB RAM problemHauke Mehrtens1-8/+14
The previous patch 4a86f2d27733f610e642649aca3e82e86fca9e22 (lmo) rsp. 84a6fcb368a080620d12fc4d79e07902dbee7335 (kernel.org) was wrong. The BCM47xx architecture maps the ram into a 128MB address space. It will be spaced there as often as goes into the 128MB. Detection tries to find the position where the same memory is found. When reading beyond 128MB the processor will throw an exception. If 128MB RAM is installed, it will not find a memory alias because it tries to read beyond the 128MB border. Now it just assumes 128MB installed ram if it can not find an alias. Signed-off-by: Hauke Mehrtens <[email protected]> To: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/1508/ Acked-by: Florian Fainelli <[email protected]> Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05MIPS: Octeon: Workaround link failures with gcc-4.4.x 32-bits toolchainsFlorian Fainelli1-8/+0
When building with a gcc-4.4.x toolchain that is configured to produce 32-bits executables by default, we will produce __lshrti3 in sched_clock() which is never resolved so the kernel fails to link. Unconditionally use the inline assembly version as suggested by David Daney, which works around the issue. Signed-off-by: Florian Fainelli <[email protected]> To: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/1514/ Acked-by: David Daney <[email protected]> Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05MIPS: N32: Fix syscall number comments.David Daney1-4/+4
Signed-off-by: David Daney <[email protected]> To: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/1515/ Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05MIPS: Don't overflow cevt-r4k.c calculations at high clock rates.David Daney1-3/+2
The 'mult' element of struct clock_event_device must never be wider than 32-bits. If it were, it would get truncated when used by clockevent_delta2ns() when this calls do_div(). We can meet this requirement by using clockevent_set_clock() to set the MULT and SHIFT values. Signed-off-by: David Daney <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/1253/ Acked-by: Thomas Gleixner <[email protected]> Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05MIPS: IP27: Don't include <linux/topology.h> into <asm/sn/agent.h>.Ralf Baechle1-1/+0
The include is unecessary and will when building the IP35 result in recursive header inclusion spaghetti. Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05MIPS: TX49xx: Define ARCH_KMALLOC_MINALIGNAtsushi Nemoto1-3/+1
With SLAB, it works without ARCH_KMALLOC_MINALIGN, but with SLOB/SLUB, ARCH_KMALLOC_MINALIGN is required to ensure alignment of kmalloced buffer. Signed-off-by: Atsushi Nemoto <[email protected]> To: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/1248/ Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05VIDEO: Correct use of request_region/request_mem_regionJulia Lawall1-2/+2
request_region should be used with release_region, not request_mem_region. Geert Uytterhoeven pointed out that in the case of drivers/video/gbefb.c, the problem is actually the other way around; request_mem_region should be used instead of request_region. The semantic patch that finds/fixes this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r1@ expression start; @@ request_region(start,...) @b1@ expression r1.start; @@ request_mem_region(start,...) @depends on !b1@ expression r1.start; expression E; @@ - release_mem_region + release_region (start,E) // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Ralf Baechle <[email protected]>
2010-08-05apparmor: depends on NETRandy Dunlap1-1/+1
SECURITY_APPARMOR should depend on NET since AUDIT needs (depends on) NET. Fixes 70-80 errors that occur when CONFIG_NET is not enabled, but APPARMOR selects AUDIT without qualification. E.g.: audit.c:(.text+0x33361): undefined reference to `netlink_unicast' (.text+0x333df): undefined reference to `netlink_unicast' audit.c:(.text+0x3341d): undefined reference to `skb_queue_tail' audit.c:(.text+0x33424): undefined reference to `kfree_skb' audit.c:(.text+0x334cb): undefined reference to `kfree_skb' audit.c:(.text+0x33597): undefined reference to `skb_put' audit.c:(.text+0x3369b): undefined reference to `__alloc_skb' audit.c:(.text+0x336d7): undefined reference to `kfree_skb' (.text+0x3374c): undefined reference to `__alloc_skb' auditfilter.c:(.text+0x35305): undefined reference to `skb_queue_tail' lsm_audit.c:(.text+0x2873): undefined reference to `init_net' lsm_audit.c:(.text+0x2878): undefined reference to `dev_get_by_index' Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: John Johansen <[email protected]> Signed-off-by: James Morris <[email protected]>
2010-08-05Merge branch 'topic/misc' into for-linusTakashi Iwai56-612/+991
2010-08-05Merge branch 'topic/asoc' into for-linusTakashi Iwai127-659/+9110
2010-08-05Merge branch 'topic/hda' into for-linusTakashi Iwai13-147/+897
2010-08-05Merge branch 'sched/urgent' into sched/coreIngo Molnar3-17/+1
Conflicts: include/linux/sched.h Merge reason: Add the leftover .35 urgent bits, fix the conflict. Signed-off-by: Ingo Molnar <[email protected]>
2010-08-05Merge branch 'perf/core' of ↵Ingo Molnar4-27/+25
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/core
2010-08-05Merge branch 'perf/nmi' into perf/coreIngo Molnar16-348/+770
Conflicts: kernel/Makefile Merge reason: Add the now complete topic, fix the conflict. Signed-off-by: Ingo Molnar <[email protected]>
2010-08-05ext4: re-inline ext4_rec_len_(to|from)_disk functionsEric Sandeen2-26/+37
commit 3d0518f4, "ext4: New rec_len encoding for very large blocksizes" made several changes to this path, but from a perf perspective, un-inlining ext4_rec_len_from_disk() seems most significant. This function is called from ext4_check_dir_entry(), which on a file-creation workload is called extremely often. I tested this with bonnie: # bonnie++ -u root -s 0 -f -x 200 -d /mnt/test -n 32 (this does 200 iterations) and got this for the file creations: ext4 stock: Average = 21206.8 files/s ext4 inlined: Average = 22346.7 files/s (+5%) Signed-off-by: Eric Sandeen <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
2010-08-04DMAENGINE: at_hdmac: locking fixletYong Wang1-2/+2
atc_chain_complete shall be called with atchan->lock held and bh disabled. Signed-off-by: Yong Wang <[email protected]> Signed-off-by: Dan Williams <[email protected]>
2010-08-04DMAENGINE: pch_dma: kill another usage of __raw_{read|write}lYong Wang1-2/+2
Use {read|write}l instead of __raw_{read|write}l since PCH DMA controller is PCI device. Signed-off-by: Yong Wang <[email protected]> Signed-off-by: Dan Williams <[email protected]>
2010-08-04virtio_net: implements ethtool_ops.get_drvinfoRusty Russell1-0/+14
I often use "ethtool -i" command to check what driver controls the ehternet device. But because current virtio_net driver doesn't support "ethtool -i", it becomes the following: # ethtool -i eth3 Cannot get driver information: Operation not supported This patch simply adds the "ethtool -i" support. The following is the result when using the virtio_net driver with my patch applied to. # ethtool -i eth3 driver: virtio_net version: N/A firmware-version: N/A bus-info: virtio0 Personally, "-i" is one of the most frequently-used option, and most network drivers support "ethtool -i", so I think virtio_net also should do. Signed-off-by: Taku Izumi <[email protected]> Signed-off-by: Rusty Russell <[email protected]> (use ARRAY_SIZE) Signed-off-by: David S. Miller <[email protected]>
2010-08-04ppp: make channel_ops conststephen hemminger8-13/+16
The PPP channel ops structure should be const. Cleanup the declarations to use standard C99 format. Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-08-04RxRPC: Fix a potential deadlock between the call resend_timer and state_lockDavid Howells2-4/+5
RxRPC can potentially deadlock as rxrpc_resend_time_expired() wants to get call->state_lock so that it can alter the state of an RxRPC call. However, its caller (call_timer_fn()) has an apparent lock on the timer struct. The problem is that rxrpc_resend_time_expired() isn't permitted to lock call->state_lock as this could cause a deadlock against rxrpc_send_abort() as that takes state_lock and then attempts to delete the resend timer by calling del_timer_sync(). The deadlock can occur because del_timer_sync() will sit there forever waiting for rxrpc_resend_time_expired() to return, but the latter may then wait for call->state_lock, which rxrpc_send_abort() holds around del_timer_sync()... This leads to a warning appearing in the kernel log that looks something like the attached. It should be sufficient to simply dispense with the locks. It doesn't matter if we set the resend timer expired event bit and queue the event processor whilst we're changing state to one where the resend timer is irrelevant as the event can just be ignored by the processor thereafter. ======================================================= [ INFO: possible circular locking dependency detected ] 2.6.35-rc3-cachefs+ #115 ------------------------------------------------------- swapper/0 is trying to acquire lock: (&call->state_lock){++--..}, at: [<ffffffffa00200d4>] rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc] but task is already holding lock: (&call->resend_timer){+.-...}, at: [<ffffffff8103b675>] run_timer_softirq+0x182/0x2a5 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&call->resend_timer){+.-...}: [<ffffffff810560bc>] __lock_acquire+0x889/0x8fa [<ffffffff81056184>] lock_acquire+0x57/0x6d [<ffffffff8103bb9c>] del_timer_sync+0x3c/0x86 [<ffffffffa002bb7a>] rxrpc_send_abort+0x50/0x97 [af_rxrpc] [<ffffffffa002bdd9>] rxrpc_kernel_abort_call+0xa1/0xdd [af_rxrpc] [<ffffffffa0061588>] afs_deliver_to_call+0x129/0x368 [kafs] [<ffffffffa006181b>] afs_process_async_call+0x54/0xff [kafs] [<ffffffff8104261d>] worker_thread+0x1ef/0x2e2 [<ffffffff81045f47>] kthread+0x7a/0x82 [<ffffffff81002cd4>] kernel_thread_helper+0x4/0x10 -> #0 (&call->state_lock){++--..}: [<ffffffff81055237>] validate_chain+0x727/0xd23 [<ffffffff810560bc>] __lock_acquire+0x889/0x8fa [<ffffffff81056184>] lock_acquire+0x57/0x6d [<ffffffff813e6b69>] _raw_read_lock_bh+0x34/0x43 [<ffffffffa00200d4>] rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc] [<ffffffff8103b6e6>] run_timer_softirq+0x1f3/0x2a5 [<ffffffff81036828>] __do_softirq+0xa2/0x13e [<ffffffff81002dcc>] call_softirq+0x1c/0x28 [<ffffffff810049f0>] do_softirq+0x38/0x80 [<ffffffff810361a2>] irq_exit+0x45/0x47 [<ffffffff81018fb3>] smp_apic_timer_interrupt+0x88/0x96 [<ffffffff81002893>] apic_timer_interrupt+0x13/0x20 [<ffffffff810011ac>] cpu_idle+0x4d/0x83 [<ffffffff813e06f3>] start_secondary+0x1bd/0x1c1 other info that might help us debug this: 1 lock held by swapper/0: #0: (&call->resend_timer){+.-...}, at: [<ffffffff8103b675>] run_timer_softirq+0x182/0x2a5 stack backtrace: Pid: 0, comm: swapper Not tainted 2.6.35-rc3-cachefs+ #115 Call Trace: <IRQ> [<ffffffff81054414>] print_circular_bug+0xae/0xbd [<ffffffff81055237>] validate_chain+0x727/0xd23 [<ffffffff810560bc>] __lock_acquire+0x889/0x8fa [<ffffffff810539a7>] ? mark_lock+0x42f/0x51f [<ffffffff81056184>] lock_acquire+0x57/0x6d [<ffffffffa00200d4>] ? rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc] [<ffffffff813e6b69>] _raw_read_lock_bh+0x34/0x43 [<ffffffffa00200d4>] ? rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc] [<ffffffffa00200d4>] rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc] [<ffffffff8103b6e6>] run_timer_softirq+0x1f3/0x2a5 [<ffffffff8103b675>] ? run_timer_softirq+0x182/0x2a5 [<ffffffffa002007e>] ? rxrpc_resend_time_expired+0x0/0x96 [af_rxrpc] [<ffffffff810367ef>] ? __do_softirq+0x69/0x13e [<ffffffff81036828>] __do_softirq+0xa2/0x13e [<ffffffff81002dcc>] call_softirq+0x1c/0x28 [<ffffffff810049f0>] do_softirq+0x38/0x80 [<ffffffff810361a2>] irq_exit+0x45/0x47 [<ffffffff81018fb3>] smp_apic_timer_interrupt+0x88/0x96 [<ffffffff81002893>] apic_timer_interrupt+0x13/0x20 <EOI> [<ffffffff81049de1>] ? __atomic_notifier_call_chain+0x0/0x86 [<ffffffff8100955b>] ? mwait_idle+0x6e/0x78 [<ffffffff81009552>] ? mwait_idle+0x65/0x78 [<ffffffff810011ac>] cpu_idle+0x4d/0x83 [<ffffffff813e06f3>] start_secondary+0x1bd/0x1c1 Signed-off-by: David Howells <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-08-04sch_sfq: add sanity check for the packet lengthChangli Gao1-9/+20
The packet length should be checked before the packet data is dereferenced. Signed-off-by: Changli Gao <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-08-04cls_rsvp: add sanity check for the packet lengthChangli Gao1-2/+10
The packet length should be checked before the packet data is dereferenced. Signed-off-by: Changli Gao <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-08-04cls_flow: add sanity check for the packet lengthChangli Gao1-40/+56
The packet length should be checked before the packet data is dereferenced. Signed-off-by: Changli Gao <[email protected]> Acked-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-08-04sk_buff: introduce pskb_network_may_pull()Changli Gao1-0/+5
Signed-off-by: Changli Gao <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-08-04act_nat: fix on the TX pathChangli Gao1-10/+13
On the TX path, skb->data points to the ethernet header, not the network header. So when validating the packet length for accessing we should take the ethernet header into account. Signed-off-by: Changli Gao <[email protected]> Acked-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-08-05virtio_blk: Remove VBID ioctlRyan Harper1-10/+0
With the availablility of a sysfs device attribute for examining disk serial numbers the ioctl is no longer needed. The user-space changes for this aren't upstream yet so we don't have any users to worry about. Signed-off-by: Ryan Harper <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
2010-08-05virtio_blk: Add 'serial' attribute to virtio-blk devices (v2)Ryan Harper1-0/+28
Create a new attribute for virtio-blk devices that will fetch the serial number of the block device. This attribute can be used by udev to create disk/by-id symlinks for devices that don't have a UUID (filesystem) associated with them. ATA_IDENTIFY strings are special in that they can be up to 20 chars long and aren't required to be nul-terminated. The buffer is also zero-padded meaning that if the serial is 19 chars or less that we get a nul-terminated string. When copying this value into a string buffer, we must be careful to copy up to the nul (if it present) and only 20 if it is longer and not to attempt to nul terminate; this isn't needed. Changes since v1: - Added BUILD_BUG_ON() for PAGE_SIZE check - Removed min() since BUILD_BUG_ON() handles the check - Replaced serial_sysfs() by copying id directly to buffer Signed-off-by: Ryan Harper <[email protected]> Signed-off-by: john cooper <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
2010-08-05virtio_blk: support barriers without FLUSH featureChristoph Hellwig1-3/+23
If we want to support barriers with the cache=writethrough mode in qemu we need to tell the block layer that we only need queue drains to implement a barrier. Follow the model set by SCSI and IDE and assume that there is no volatile write cache if the host doesn't advertize it. While this might imply working barriers on old qemu versions or other hypervisors that actually have a volatile write cache this is only a cosmetic issue - these hypervisors don't guarantee any data integrity with or without this patch, but with the patch we at least provide data ordering. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
2010-08-05module: cleanup comments, remove noinlineRusty Russell1-4/+8
On my (32-bit x86) machine, sys_init_module() uses 124 bytes of stack once load_module() is inlined. This effectively reverts ffb4ba76 which inlined it due to stack pressure. Signed-off-by: Rusty Russell <[email protected]>
2010-08-05module: group post-relocation functions into post_relocation()Rusty Russell1-24/+32
This simply hoists more code out of load_module; we also put the identification of the extable and dynamic debug table in with the others in find_module_sections(). We move the taint check to the actual add/remove of the dynamic debug info: this is certain (find_module_sections is too early). Signed-off-by: Rusty Russell <[email protected]> Cc: Yehuda Sadeh <[email protected]>
2010-08-05module: move module args strndup_user to just before useRusty Russell1-15/+13
Instead of copying and allocating the args and storing it in load_info, we can just allocate them right before we need them. Signed-off-by: Rusty Russell <[email protected]>
2010-08-05module: pass load_info into other functionsRusty Russell1-215/+157
Pass the struct load_info into all the other functions in module loading. This neatens things and makes them more consistent. Signed-off-by: Rusty Russell <[email protected]>
2010-08-05module: fix sysfs cleanup for !CONFIG_SYSFSRusty Russell1-7/+6
Restore the stub module_remove_modinfo_attrs, remove the now-unused !CONFIG_SYSFS module_sysfs_init. Also, rename mod_kobject_remove() to mod_sysfs_teardown() as it is the logical counterpart to mod_sysfs_setup now. Reported-by: Randy Dunlap <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
2010-08-05module: sysfs cleanupRusty Russell1-43/+34
We change the sysfs functions to take struct load_info, and call them all in mod_sysfs_setup(). We also clean up the #ifdefs a little. Signed-off-by: Rusty Russell <[email protected]>
2010-08-05module: layout_and_allocateRusty Russell1-99/+125
layout_and_allocate() does everything up to and including the final struct module placement inside the allocated module memory. We have to store the symbol layout information in our struct load_info though. This avoids the nasty code we had before where 'mod' pointed first to the version inside the temporary allocation containing the entire file, then later was moved to point to the real struct module: now the main code only ever sees the final module address. (Includes fix for the Tony Luck-found Linus-diagnosed failure path error). Signed-off-by: Rusty Russell <[email protected]>
2010-08-05module: fix crash in get_ksymbol() when oopsing in module initRusty Russell1-1/+2
Andrew had the sole pleasure of tickling this bug in linux-next; when we set up "info->strtab" it's pointing into the temporary copy of the module. For most uses that is fine, but kallsyms keeps a pointer around during module load (inside mod->strtab). If we oops for some reason inside a module's init function, kallsyms will use the mod->strtab pointer into the now-freed temporary module copy. (Later oopses work fine: after init we overwrite mod->strtab to point to a compacted core-only strtab). Reported-by: Andrew "Grumpy" Morton <[email protected]> Signed-off-by: Rusty "Buggy" Russell <[email protected]> Tested-by: Andrew "Happy" Morton <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
2010-08-05module: kallsyms functions take struct load_infoRusty Russell1-39/+29
Simple refactor causes us to lift struct definition to top of file. Signed-off-by: Rusty Russell <[email protected]>
2010-08-05module: refactor out section header rewriting: FIX modversionsRusty Russell1-6/+6
We can't do the find_sec after removing the SHF_ALLOC flags; it won't find the sections. Signed-off-by: Rusty Russell <[email protected]>
2010-08-05module: refactor out section header rewritingRusty Russell1-25/+45
Put all the "rewrite and check section headers" in one place. This adds another iteration over the sections, but it's far clearer. We iterate once for every find_section() so we already iterate over many times. Signed-off-by: Rusty Russell <[email protected]>