* Re: Next Sept 7: Bug : skb_release_head_state on x86
From: Sachin Sant @ 2009-09-09 11:13 UTC (permalink / raw)
To: Sachin Sant
Cc: Eric Dumazet, netdev, Stephen Rothwell, linux-next, David Miller
In-Reply-To: <4AA5E717.1050002@in.ibm.com>
Sachin Sant wrote:
> Will try to boot 0904 and will check if the same problem can be
> recreated.
I still have this problem with next-20090908.Although the trace
looks a bit different.
Haven't checked today's next.
BUG: unable to handle kernel paging request at 00008c90
IP: [<c0349399>] skb_dma_unmap+0x15/0x91
*pdpt = 0000000035445001 *pde = 0000000000000000
Oops: 0000 [#2] SMP
last sysfs file: /sys/devices/system/cpu/cpu3/topology/core_siblings
Modules linked in: ipv6 microcode fuse loop dm_mod i2c_piix4 tg3 i2c_core pcspkr ppdev button libphy sworks_agp rtc_cmos rtc_core parport_pc sr_mod rtc_lib sg parport agpgart cdrom floppy ohci_hcd ehci_hcd sd_mod crc_t10dif usbcore edd fan ide_pci_generic serverworks ide_core ata_generic pata_serverworks libata ips scsi_mod thermal processor thermal_sys hwmon [last unloaded: speedstep_lib]
Pid: 6, comm: ksoftirqd/1 Tainted: G D (2.6.31-rc9-autotest-next-20090908-5-pae #1) eserver xSeries 235 -[86717AX]-
EIP: 0060:[<c0349399>] EFLAGS: 00010296 CPU: 1
EIP is at skb_dma_unmap+0x15/0x91
EAX: f5d3dc5c EBX: c056bba0 ECX: 00000001 EDX: 00008be8
ESI: f4d3b2f0 EDI: 00008be8 EBP: f5c69ec4 ESP: f5c69eac
DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
Process ksoftirqd/1 (pid: 6, ti=f5c68000 task=f5c4f280 task.ti=f5c68000)
Stack:
00000001 f5d3dc5c f5c69ec4 0000005f f4d3b2f0 00008be8 f5c69f3c f8d191a1
<0> c148347c 00000040 f4900380 f4900340 00000000 f55b2000 f4900340 00000064
<0> f553aa00 00000000 f4900340 00000000 f49006b8 d0622200 0000059a f4d377c0
Call Trace:
[<f8d191a1>] ? tg3_poll+0x10f/0x802 [tg3]
[<c034c151>] ? net_rx_action+0x93/0x173
[<c01376b8>] ? __do_softirq+0xa7/0x144
[<c013777b>] ? do_softirq+0x26/0x2b
[<c01377ca>] ? ksoftirqd+0x4a/0xae
[<c0137780>] ? ksoftirqd+0x0/0xae
[<c0146a56>] ? kthread+0x61/0x66
[<c01469f5>] ? kthread+0x0/0x66
[<c0103507>] ? kernel_thread_helper+0x7/0x10
Code: 5a c0 74 07 89 d8 e8 f3 7b e6 ff ba f4 ff ff ff 89 d0 5b 5e 5d c3 55 89 e5 57 56 53 83 ec 0c 8b 1d c0 07 61 c0 89 4d e8 89 45 ec <8b> ba a8 00 00 00 83 7d e8 02 8b 42 50 8b 72 54 8b 4f 0c 8b 57
EIP: [<c0349399>] skb_dma_unmap+0x15/0x91 SS:ESP 0068:f5c69eac
CR2: 0000000000008c90
---[ end trace 9239788a6557ba57 ]---
Kernel panic - not syncing: Fatal exception in interrupt
Pid: 6, comm: ksoftirqd/1 Tainted: G D 2.6.31-rc9-autotest-next-20090908-5-pae #1
I went back and tried out some old next versions. Seems like
the problem was introduced in next-20090903. next-20090902
worked fine.
Thanks
-Sachin
--
---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------
^ permalink raw reply
* Re: Next Sept 7: Bug : skb_release_head_state on x86
From: Eric Dumazet @ 2009-09-09 12:10 UTC (permalink / raw)
To: Sachin Sant; +Cc: netdev, Stephen Rothwell, linux-next, David Miller
In-Reply-To: <4AA78DD4.60003@in.ibm.com>
Sachin Sant a écrit :
> Sachin Sant wrote:
>> Will try to boot 0904 and will check if the same problem can be
>> recreated.
> I still have this problem with next-20090908.Although the trace
> looks a bit different.
>
> Haven't checked today's next.
>
> BUG: unable to handle kernel paging request at 00008c90
> IP: [<c0349399>] skb_dma_unmap+0x15/0x91
> *pdpt = 0000000035445001 *pde = 0000000000000000
> Oops: 0000 [#2] SMP
> last sysfs file: /sys/devices/system/cpu/cpu3/topology/core_siblings
> Modules linked in: ipv6 microcode fuse loop dm_mod i2c_piix4 tg3
> i2c_core pcspkr ppdev button libphy sworks_agp rtc_cmos rtc_core
> parport_pc sr_mod rtc_lib sg parport agpgart cdrom floppy ohci_hcd
> ehci_hcd sd_mod crc_t10dif usbcore edd fan ide_pci_generic serverworks
> ide_core ata_generic pata_serverworks libata ips scsi_mod thermal
> processor thermal_sys hwmon [last unloaded: speedstep_lib]
>
> Pid: 6, comm: ksoftirqd/1 Tainted: G D
> (2.6.31-rc9-autotest-next-20090908-5-pae #1) eserver xSeries 235
> -[86717AX]-
> EIP: 0060:[<c0349399>] EFLAGS: 00010296 CPU: 1
> EIP is at skb_dma_unmap+0x15/0x91
> EAX: f5d3dc5c EBX: c056bba0 ECX: 00000001 EDX: 00008be8
> ESI: f4d3b2f0 EDI: 00008be8 EBP: f5c69ec4 ESP: f5c69eac
> DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
> Process ksoftirqd/1 (pid: 6, ti=f5c68000 task=f5c4f280 task.ti=f5c68000)
> Stack:
> 00000001 f5d3dc5c f5c69ec4 0000005f f4d3b2f0 00008be8 f5c69f3c f8d191a1
> <0> c148347c 00000040 f4900380 f4900340 00000000 f55b2000 f4900340 00000064
> <0> f553aa00 00000000 f4900340 00000000 f49006b8 d0622200 0000059a f4d377c0
> Call Trace:
> [<f8d191a1>] ? tg3_poll+0x10f/0x802 [tg3]
> [<c034c151>] ? net_rx_action+0x93/0x173
> [<c01376b8>] ? __do_softirq+0xa7/0x144
> [<c013777b>] ? do_softirq+0x26/0x2b
> [<c01377ca>] ? ksoftirqd+0x4a/0xae
> [<c0137780>] ? ksoftirqd+0x0/0xae
> [<c0146a56>] ? kthread+0x61/0x66
> [<c01469f5>] ? kthread+0x0/0x66
> [<c0103507>] ? kernel_thread_helper+0x7/0x10
> Code: 5a c0 74 07 89 d8 e8 f3 7b e6 ff ba f4 ff ff ff 89 d0 5b 5e 5d c3
> 55 89 e5 57 56 53 83 ec 0c 8b 1d c0 07 61 c0 89 4d e8 89 45 ec <8b> ba
> a8 00 00 00 83 7d e8 02 8b 42 50 8b 72 54 8b 4f 0c 8b 57
> EIP: [<c0349399>] skb_dma_unmap+0x15/0x91 SS:ESP 0068:f5c69eac
> CR2: 0000000000008c90
> ---[ end trace 9239788a6557ba57 ]---
> Kernel panic - not syncing: Fatal exception in interrupt
> Pid: 6, comm: ksoftirqd/1 Tainted: G D
> 2.6.31-rc9-autotest-next-20090908-5-pae #1
>
> I went back and tried out some old next versions. Seems like
> the problem was introduced in next-20090903. next-20090902
> worked fine.
>
> Thanks
> -Sachin
>
There were some changes on net-next-2.6 for tg3, you could try to revert them...
(They are working just fine on my machine, but I suspect you have a different chip)
# lspci | grep Ether
14:04.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5715S Gigabit Ethernet (rev a3)
14:04.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5715S Gigabit Ethernet (rev a3)
commit 7ab0f2736bfe137a82a7084bbfb5f809da95cabd
Author: Ben Hutchings <bhutchings@solarflare.com>
Date: Thu Sep 3 10:39:43 2009 +0000
netdev: Remove redundant checks for CAP_NET_ADMIN in MDIO implementations
dev_ioctl() already checks capable(CAP_NET_ADMIN) before calling the
driver's implementation of MDIO ioctls.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit daf09de817353f18bb81a23a023d429cfd258e62
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 13:22:42 2009 +0000
tg3: Update version to 3.102
This patch updates the tg3 version to 3.102.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 882e9793faa9425dff581c33b1af45ed10145626
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 13:21:36 2009 +0000
tg3: Add MDIO bus address assignments
The 5717 is a dual port chip that has a shared MDIO bus design. While
it is impossible for one function to interface with the wrong phy, that
function still needs to know which MDIO bus address to use when
interfacing with its own phy. This patch adds code to determine which
MDIO bus address to use.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit a1b950d56de3c72bea3343f54de24c43fb7dc74e
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 13:20:17 2009 +0000
tg3: Add 5717 NVRAM detection routines
This patch adds NVRAM detection routines for the 5717.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f6eb9b1fc1411d22c073f5264e5630a541d0f7df
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 13:19:53 2009 +0000
tg3: Add 5717 asic rev
This patch adds the 5717 asic rev.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 8d9d7cfc0ec2fe37ff9afd74326d03f38f96ad1b
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 13:19:05 2009 +0000
tg3: Assign rx ret producer indexes by vector
When RSS is enabled, the status block format changes slightly. The
"rx_jumbo_consumer", "reserved", and "rx_mini_consumer" members get
mapped to the other three rx return ring producer indexes. This patch
introduces a new per-interrupt member which identifies which location
in the status block a particular vector should look for return ring
updates.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 0c1d0e2b05e92ad847b3ebe1c75b7974086bc8fa
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 13:16:33 2009 +0000
tg3: Adjust RSS ring allocation strategies
When multivector RSS is enabled, the first interrupt vector is only used
to report link interrupts and error conditions. This patch changes the
code so that rx and tx ring resources are not allocated for this vector.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit baf8a94a572928710e9e60967d153a7bf3aebd9c
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 13:13:00 2009 +0000
tg3: Add RSS support
This patch adds code needed to enable RSS.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit b6080e126012047d42e53154189fdca286d0600e
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 13:12:00 2009 +0000
tg3: Add coalesce parameters for msix vectors
This patch adds code to tune the coalescing parameters for the other
msix vectors.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fed9781081aa9600765346c108ff22751e003715
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 13:10:19 2009 +0000
tg3: Enable NAPI instances for other int vectors
This patch adds code to enable and disable the rest of the NAPI
instances.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fe5f5787f0866e9f883bdd90018a354f2f3defd1
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 13:09:39 2009 +0000
tg3: Add TSS support
This patch exposes the additional transmit rings to the kernel and makes
the necessary modifications to transmit, open, and close paths.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 89aeb3bceaa1a02651206a76a7b9dcb8f3884702
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 13:08:58 2009 +0000
tg3: Update intmbox and coal_now for msix
This patch fixes up two spots that need attention now that msix support
has been added.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f77a6a8e6cee17b21a43bdf6b853cc2fc0e2c4df
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 13:04:37 2009 +0000
tg3: Add tx and rx ring resource tracking
This patch adds code to assign status block, tx producer ring and rx
return ring resources needed for the other interrupt vectors.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 646c9eddcffd202bb0f3d906cecf94eaf10cad31
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 12:58:41 2009 +0000
tg3: Add mailbox assignments
The 5717 assigns mailbox locations to interrupt vectors in a rather
non-intuitive way. (Much of the complexity stems from legacy
compatibility issues.) This patch implements the assignment scheme.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 679563f47cd2547a0e091b5bd3ddf30027af6b08
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 12:55:46 2009 +0000
tg3: Add MSI-X support
This patch adds MSI-X support.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 4f125f42dd55390016e21f8b3960f99d02d1001f
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 12:55:02 2009 +0000
tg3: Add support code around kernel interrupt API
This patch adds code to support multiple interrupt vectors around the
kernel's interrupt API.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2d31ecaf10c4ae03d49aed516481b2839b0220f6
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 12:53:31 2009 +0000
tg3: Create tg3_rings_reset()
This patch moves most of the chip ring setup logic into a separate
function. This will make it easier to verify the multi ring setup
changes.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fd2ce37f8e4a570ce90b141a2e7c476c5b399836
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 12:51:13 2009 +0000
tg3: Add per-int coalesce now member
Each interrupt vector has its own bit in the host coalescing register to
force that vector's status block to be updated and generate an
interrupt. This patch adds a member to the per-interrupt structure
that records which bit belongs to that vector.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f19af9c2cc015e42dfe4bd5c383e32066ec2801c
Author: Matt Carlson <mcarlson@broadcom.com>
Date: Tue Sep 1 12:47:49 2009 +0000
tg3: inline tg3_cond_int()
This patch inlines the code of tg3_cond_int() into the function's only
callsite. This prep work makes the following patch cleaner.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: linux-next: rr tree build failure
From: Siarhei Liakh @ 2009-09-09 14:32 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Rusty Russell, linux-next, linux-kernel, Xuxian Jiang,
Arjan van de Ven
In-Reply-To: <20090909134752.f5b8c2e7.sfr@canb.auug.org.au>
On Tue, Sep 8, 2009 at 11:47 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi Rusty,
>
> Today's linux-next build (powerpc ppc64_defconfig) failed like this:
>
> kernel/module.c: In function 'set_section_ro_nx':
> kernel/module.c:1549: error: implicit declaration of function 'set_memory_ro'
> kernel/module.c:1560: error: implicit declaration of function 'set_memory_nx'
> kernel/module.c: In function 'unset_section_ro_nx':
> kernel/module.c:1575: error: implicit declaration of function 'set_memory_rw'
>
> Caused by commit 25306e21864c2a220d6fa2e0632425028aa9626c
> ("module:ro-nx-protection") which uses these interfaces that are only
> defined on x86 ...
Looks like I have made some bad assumptions. I will re-write the
original patch to be x86-only.
Sorry for breaking the build.
^ permalink raw reply
* New kvm.git branch for linux-next
From: Avi Kivity @ 2009-09-09 17:55 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: Marcelo Tosatti, linux-next, kvm-devel
Stephen, please pick up the 'linux-next' branch of kvm.git instead
'master' as you do now. This will better reflect what is actually going
to -next, will cause fewer merge errors, and will improve -next
bisectability.
(this is actually a symbolic ref to kvm-updates/2.6.32 which will be
updated when kvm-updates/2.6.33 is created)
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
^ permalink raw reply
* [PATCH 1/2 (resubmission)] n_tty: honor opost flag for echoes
From: Joe Peterson @ 2009-09-09 21:03 UTC (permalink / raw)
To: greg; +Cc: sfr, linux-next, Linux Kernel, torvalds
[-- Attachment #1: Type: text/plain, Size: 234 bytes --]
This (and the forthcoming part 2, which is the same patch with corrected
offsets) are resubmissions to avoid the conflict with "n_tty: do O_ONLCR
translation as a single write" and to move the O_OPOST test to the caller.
-Joe
[-- Attachment #2: n_tty-honor-opost-flag-for-echoes.patch --]
[-- Type: text/plain, Size: 2610 bytes --]
Fixes the following bug:
http://bugs.linuxbase.org/show_bug.cgi?id=2692
Causes processing of echoed characters (output from the echo buffer) to
honor the O_OPOST flag, which is consistent with the old behavior.
Note that this and the next patch ("n_tty: move echoctl check and
clean up logic") were verified together by the bug reporters, and
the test now passes.
Signed-off-by: Joe Peterson <joe@skyrush.com>
---
diff -Nurp a/drivers/char/n_tty.c b/drivers/char/n_tty.c
--- a/drivers/char/n_tty.c 2009-09-07 16:54:03.540366388 -0600
+++ b/drivers/char/n_tty.c 2009-09-07 16:53:53.880294497 -0600
@@ -272,7 +272,8 @@ static inline int is_continuation(unsign
*
* This is a helper function that handles one output character
* (including special characters like TAB, CR, LF, etc.),
- * putting the results in the tty driver's write buffer.
+ * doing OPOST processing and putting the results in the
+ * tty driver's write buffer.
*
* Note that Linux currently ignores TABDLY, CRDLY, VTDLY, FFDLY
* and NLDLY. They simply aren't relevant in the world today.
@@ -351,8 +352,9 @@ static int do_output_char(unsigned char
* @c: character (or partial unicode symbol)
* @tty: terminal device
*
- * Perform OPOST processing. Returns -1 when the output device is
- * full and the character must be retried.
+ * Output one character with OPOST processing.
+ * Returns -1 when the output device is full and the character
+ * must be retried.
*
* Locking: output_lock to protect column state and space left
* (also, this is called from n_tty_write under the
@@ -378,8 +380,11 @@ static int process_output(unsigned char
/**
* process_output_block - block post processor
* @tty: terminal device
- * @inbuf: user buffer
- * @nr: number of bytes
+ * @buf: character buffer
+ * @nr: number of bytes to output
+ *
+ * Output a block of characters with OPOST processing.
+ * Returns the number of characters output.
*
* This path is used to speed up block console writes, among other
* things when processing blocks of output data. It handles only
@@ -606,12 +611,18 @@ static void process_echoes(struct tty_st
if (no_space_left)
break;
} else {
- int retval;
-
- retval = do_output_char(c, tty, space);
- if (retval < 0)
- break;
- space -= retval;
+ if (O_OPOST(tty) &&
+ !(test_bit(TTY_HW_COOK_OUT, &tty->flags))) {
+ int retval = do_output_char(c, tty, space);
+ if (retval < 0)
+ break;
+ space -= retval;
+ } else {
+ if (!space)
+ break;
+ tty_put_char(tty, c);
+ space -= 1;
+ }
cp += 1;
nr -= 1;
}
^ permalink raw reply
* [PATCH 2/2 (resubmission)] n_tty: move echoctl check and clean up logic
From: Joe Peterson @ 2009-09-09 21:03 UTC (permalink / raw)
To: greg; +Cc: sfr, linux-next, linux-kernel, torvalds
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: n_tty-move-echoctl-check-and-clean-up-logic.patch --]
[-- Type: text/plain, Size: 2610 bytes --]
Check L_ECHOCTL before insertting a character in the echo buffer
(rather than as the buffer is processed), to be more consistent with
when all other L_ flags are checked. Also cleaned up the related logic.
Note that this and the previous patch ("n_tty: honor opost flag for echoes")
were verified together by the reporters of the bug that patch addresses
(http://bugs.linuxbase.org/show_bug.cgi?id=2692), and the test now passes.
Signed-off-by: Joe Peterson <joe@skyrush.com>
---
diff -Nurp b/drivers/char/n_tty.c c/drivers/char/n_tty.c
--- b/drivers/char/n_tty.c 2009-09-09 14:17:35.516776962 -0600
+++ c/drivers/char/n_tty.c 2009-09-09 14:20:36.123394364 -0600
@@ -577,33 +577,23 @@ static void process_echoes(struct tty_st
break;
default:
- if (iscntrl(op)) {
- if (L_ECHOCTL(tty)) {
- /*
- * Ensure there is enough space
- * for the whole ctrl pair.
- */
- if (space < 2) {
- no_space_left = 1;
- break;
- }
- tty_put_char(tty, '^');
- tty_put_char(tty, op ^ 0100);
- tty->column += 2;
- space -= 2;
- } else {
- if (!space) {
- no_space_left = 1;
- break;
- }
- tty_put_char(tty, op);
- space--;
- }
- }
/*
- * If above falls through, this was an
- * undefined op.
+ * If the op is not a special byte code,
+ * it is a ctrl char tagged to be echoed
+ * as "^X" (where X is the letter
+ * representing the control char).
+ * Note that we must ensure there is
+ * enough space for the whole ctrl pair.
+ *
*/
+ if (space < 2) {
+ no_space_left = 1;
+ break;
+ }
+ tty_put_char(tty, '^');
+ tty_put_char(tty, op ^ 0100);
+ tty->column += 2;
+ space -= 2;
cp += 2;
nr -= 2;
}
@@ -810,8 +800,8 @@ static void echo_char_raw(unsigned char
* Echo user input back onto the screen. This must be called only when
* L_ECHO(tty) is true. Called from the driver receive_buf path.
*
- * This variant tags control characters to be possibly echoed as
- * as "^X" (where X is the letter representing the control char).
+ * This variant tags control characters to be echoed as "^X"
+ * (where X is the letter representing the control char).
*
* Locking: echo_lock to protect the echo buffer
*/
@@ -824,7 +814,7 @@ static void echo_char(unsigned char c, s
add_echo_byte(ECHO_OP_START, tty);
add_echo_byte(ECHO_OP_START, tty);
} else {
- if (iscntrl(c) && c != '\t')
+ if (L_ECHOCTL(tty) && iscntrl(c) && c != '\t')
add_echo_byte(ECHO_OP_START, tty);
add_echo_byte(c, tty);
}
^ permalink raw reply
* Re: linux-next: manual merge of the tty tree with the tree
From: Joe Peterson @ 2009-09-09 21:05 UTC (permalink / raw)
To: Greg KH; +Cc: Linus Torvalds, Stephen Rothwell, linux-next, linux-kernel
In-Reply-To: <20090908160658.GA4739@kroah.com>
On Tue, Sep 8, 2009 at 10:06, Greg KH<greg@kroah.com> wrote:
> Thanks for doing this, I'll drop the patch from my tree and wait for you
> to test and resubmit this.
No problem, Greg - see the two resubmitted patch parts I just sent
out; and please excuse the double send (munged the addresses on the
lists).
-Joe
^ permalink raw reply
* Re: [PATCH 00/07] pm: remove late/early platform driver pm callbacks V2
From: Rafael J. Wysocki @ 2009-09-09 22:09 UTC (permalink / raw)
To: Dan Williams
Cc: Magnus Damm, linux-kernel, gregkh, pavel, hskinnemoen, anemo,
linux-usb, akpm, stern, ben-linux, linux-omap, linux-pm,
felipe.balbi, nicolas.ferre, linux-next
In-Reply-To: <e9c3a7c20909081825i1578a522w5d7f4e5d678b5d74@mail.gmail.com>
On Wednesday 09 September 2009, Dan Williams wrote:
> 2009/7/4 Rafael J. Wysocki <rjw@sisk.pl>:
> > On Wednesday 24 June 2009, Magnus Damm wrote:
> >> pm: remove late/early platform driver pm callbacks V2
> >>
> >> [PATCH 01/07] arm: rework omap suspend_late()/resume_early()
> >> [PATCH 02/07] dma: rework dw_dmac suspend_late()/resume_early()
> >> [PATCH 03/07] dma: rework txx9dmac suspend_late()/resume_early()
> >> [PATCH 04/07] i2c: rework i2c-pxa suspend_late()/resume_early()
> >> [PATCH 05/07] i2c: rework i2c-s3c2410 suspend_late()/resume() V2
> >> [PATCH 06/07] usb: rework musb suspend()/resume_early()
> >> [PATCH 07/07] pm: remove platform device suspend_late()/resume_early() V2
> >>
> >> These patches simply remove ->suspend_late() and ->resume_early()
> >> from struct platform_driver. Drivers are converted to dev_pm_ops
> >> with CONFIG_SUSPEND in mind. Untested.
> >>
> >> All patches except [02/07] are known to compile.
> >>
> >> Signed-off-by: Magnus Damm <damm@igel.co.jp>
> [..]
> >
> > The series is now in the linux-next branch of the suspend-2.6 tree. I'll move
> > it into the for-linus branch, which is not rebased, if the patches are not
> > reported to cause any problems in the next few days.
> >
>
> Hi,
>
> My linux-next test builds for drivers/dma/ caught a missed conversion
> of the at_hdmac driver. Please check the attached fix (compile tested
> only) and include it in this series.
Applied to suspend-2.6/linux-next, thanks.
Best,
Rafael
^ permalink raw reply
* Re: New kvm.git branch for linux-next
From: Stephen Rothwell @ 2009-09-10 0:20 UTC (permalink / raw)
To: Avi Kivity; +Cc: Marcelo Tosatti, linux-next, kvm-devel
In-Reply-To: <4AA7EC06.1070109@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 627 bytes --]
Hi Avi,
On Wed, 09 Sep 2009 20:55:18 +0300 Avi Kivity <avi@redhat.com> wrote:
>
> Stephen, please pick up the 'linux-next' branch of kvm.git instead
> 'master' as you do now. This will better reflect what is actually going
> to -next, will cause fewer merge errors, and will improve -next
> bisectability.
>
> (this is actually a symbolic ref to kvm-updates/2.6.32 which will be
> updated when kvm-updates/2.6.33 is created)
That sounds great. I have changed over starting from today.
Thanks.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* linux-next: manual merge of the block tree with the tree
From: Stephen Rothwell @ 2009-09-10 4:48 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-next, linux-kernel, Ed Cashin
Hi Jens,
Today's linux-next merge of the block tree got a conflict in
drivers/block/aoe/aoeblk.c between commit
7135a71b19be1faf48b7148d77844d03bc0717d6 ("aoe: allocate unused
request_queue for sysfs") from Linus' tree and commit
5063fe01e7dc205ebca89877f8eb01d6a5b0ebd6 ("writeback: add name to
backing_dev_info") from the block tree.
I fixed it up (see below) and can carry the fix for a while.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc drivers/block/aoe/aoeblk.c
index 1e15889,0efb8fc..0000000
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@@ -264,12 -264,10 +264,13 @@@ aoeblk_gdalloc(void *vp
goto err_disk;
}
- blk_queue_make_request(&d->blkq, aoeblk_make_request);
- d->blkq.backing_dev_info.name = "aoe";
- if (bdi_init(&d->blkq.backing_dev_info))
+ d->blkq = blk_alloc_queue(GFP_KERNEL);
+ if (!d->blkq)
goto err_mempool;
+ blk_queue_make_request(d->blkq, aoeblk_make_request);
++ d->blkq->backing_dev_info.name = "aoe";
+ if (bdi_init(&d->blkq->backing_dev_info))
+ goto err_blkq;
spin_lock_irqsave(&d->lock, flags);
gd->major = AOE_MAJOR;
gd->first_minor = d->sysminor * AOE_PARTITIONS;
^ permalink raw reply
* linux-next: arm tree build failure
From: Stephen Rothwell @ 2009-09-10 4:59 UTC (permalink / raw)
To: Russell King; +Cc: linux-next, linux-kernel, sedji gaouaou
[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]
Hi Russell,
The next-20090907 and later builds (arm at91cap9adk_defconfig) failed
like this:
arch/arm/mach-at91/at91cap9_devices.c:821: warning: 'struct atmel_ac97_data' declared inside parameter list
arch/arm/mach-at91/at91cap9_devices.c:821: warning: its scope is only this definition or declaration, which is probably not what you want
arch/arm/mach-at91/at91cap9_devices.c:821: error: conflicting types for 'at91_add_device_ac97'
arch/arm/mach-at91/include/mach/board.h:178: note: previous declaration of 'at91_add_device_ac97' was here
arch/arm/mach-at91/board-cap9adk.c:367: error: variable 'cap9adk_ac97_data' has initializer but incomplete type
arch/arm/mach-at91/board-cap9adk.c: In function 'cap9adk_board_init':
arch/arm/mach-at91/board-cap9adk.c:397: warning: passing argument 1 of 'at91_add_device_ac97' from incompatible pointer type
arch/arm/mach-at91/include/mach/board.h:178: note: expected 'struct ac97c_platform_data *' but argument is of type 'struct atmel_ac97_data *'
Caused by commit d656f07a7405e788e1275d0238b67f593615f2bb ("ARM: 5640/1:
This patch modifies the support of AC97 on the at91sam9263 ek board").
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* linux-next: m86k/m68knommu tree build failure
From: Stephen Rothwell @ 2009-09-10 5:11 UTC (permalink / raw)
To: Geert Uytterhoeven, Greg Ungerer; +Cc: linux-next, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 729 bytes --]
Hi Geert, Greg,
Today's linux-next build (m68k defconfig) failed like this:
kernel/built-in.o: In function `ptrace_resume':
ptrace.c:(.text+0xc5d6): undefined reference to `user_disable_single_step'
ptrace.c:(.text+0xc5fe): undefined reference to `user_enable_single_step'
ptrace.c:(.text+0xc620): undefined reference to `user_disable_single_step'
Caused by commit 5db612ef70d24be12f6dbf5d06b23bcd6bc2fc05 ("m68knommu:
define arch_has_single_step() and friends"). This commit added
definitions of these functions for m68knommu, but added declarations (and
arch_has_single_step()) in a common header file.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: linux-next: m86k/m68knommu tree build failure
From: Greg Ungerer @ 2009-09-10 5:37 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: Geert Uytterhoeven, linux-next, linux-kernel
In-Reply-To: <20090910151137.fb71c103.sfr@canb.auug.org.au>
Hi Stephen,
Stephen Rothwell wrote:
> Today's linux-next build (m68k defconfig) failed like this:
>
> kernel/built-in.o: In function `ptrace_resume':
> ptrace.c:(.text+0xc5d6): undefined reference to `user_disable_single_step'
> ptrace.c:(.text+0xc5fe): undefined reference to `user_enable_single_step'
> ptrace.c:(.text+0xc620): undefined reference to `user_disable_single_step'
>
> Caused by commit 5db612ef70d24be12f6dbf5d06b23bcd6bc2fc05 ("m68knommu:
> define arch_has_single_step() and friends"). This commit added
> definitions of these functions for m68knommu, but added declarations (and
> arch_has_single_step()) in a common header file.
Ah, yes, thanks. I'll fix that. I don't regularly build for m68k,
so I missed that in my test builds.
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: gerg@snapgear.com
SnapGear Group, McAfee PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com
^ permalink raw reply
* Re: linux-next: manual merge of the block tree with the tree
From: Jens Axboe @ 2009-09-10 7:24 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Ed Cashin
In-Reply-To: <20090910144801.2b604ee7.sfr@canb.auug.org.au>
On Thu, Sep 10 2009, Stephen Rothwell wrote:
> Hi Jens,
>
> Today's linux-next merge of the block tree got a conflict in
> drivers/block/aoe/aoeblk.c between commit
> 7135a71b19be1faf48b7148d77844d03bc0717d6 ("aoe: allocate unused
> request_queue for sysfs") from Linus' tree and commit
> 5063fe01e7dc205ebca89877f8eb01d6a5b0ebd6 ("writeback: add name to
> backing_dev_info") from the block tree.
>
> I fixed it up (see below) and can carry the fix for a while.
Thanks, I'll update my for-2.6.32 branch today and let that propagate
into for-next to resolve this.
--
Jens Axboe
^ permalink raw reply
* Re: linux-next: manual merge of the block tree with the tree
From: Stephen Rothwell @ 2009-09-10 7:40 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-next, linux-kernel, Ed Cashin
In-Reply-To: <20090910072407.GO18599@kernel.dk>
[-- Attachment #1: Type: text/plain, Size: 320 bytes --]
Hi Jens,
On Thu, 10 Sep 2009 09:24:07 +0200 Jens Axboe <jens.axboe@oracle.com> wrote:
>
> Thanks, I'll update my for-2.6.32 branch today and let that propagate
> into for-next to resolve this.
Thanks.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: linux-next: manual merge of the block tree with the tree
From: Jens Axboe @ 2009-09-10 7:43 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Ed Cashin
In-Reply-To: <20090910174048.58653ad0.sfr@canb.auug.org.au>
On Thu, Sep 10 2009, Stephen Rothwell wrote:
> Hi Jens,
>
> On Thu, 10 Sep 2009 09:24:07 +0200 Jens Axboe <jens.axboe@oracle.com> wrote:
> >
> > Thanks, I'll update my for-2.6.32 branch today and let that propagate
> > into for-next to resolve this.
>
> Thanks.
It is resolved and updated now.
--
Jens Axboe
^ permalink raw reply
* linux-next: merge window reminder
From: Stephen Rothwell @ 2009-09-10 7:50 UTC (permalink / raw)
To: LKML; +Cc: linux-next
[-- Attachment #1: Type: text/plain, Size: 394 bytes --]
Hi all,
Please do not add code destined for 2.6.33 into linux-next trees until
(at least) 2.6.32-rc1 is out. This will hopefully give those who have
stuff destined for just after -rc1 a chance.
Also this time can be used productively to fix the bugs we left in
2.6.31. :-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: linux-next: m86k/m68knommu tree build failure
From: Andreas Schwab @ 2009-09-10 8:04 UTC (permalink / raw)
To: Greg Ungerer
Cc: Stephen Rothwell, Geert Uytterhoeven, linux-next, linux-kernel
In-Reply-To: <4AA890B5.8000207@snapgear.com>
Greg Ungerer <gerg@snapgear.com> writes:
> Hi Stephen,
>
> Stephen Rothwell wrote:
>> Today's linux-next build (m68k defconfig) failed like this:
>>
>> kernel/built-in.o: In function `ptrace_resume':
>> ptrace.c:(.text+0xc5d6): undefined reference to `user_disable_single_step'
>> ptrace.c:(.text+0xc5fe): undefined reference to `user_enable_single_step'
>> ptrace.c:(.text+0xc620): undefined reference to `user_disable_single_step'
>>
>> Caused by commit 5db612ef70d24be12f6dbf5d06b23bcd6bc2fc05 ("m68knommu:
>> define arch_has_single_step() and friends"). This commit added
>> definitions of these functions for m68knommu, but added declarations (and
>> arch_has_single_step()) in a common header file.
>
> Ah, yes, thanks. I'll fix that. I don't regularly build for m68k,
> so I missed that in my test builds.
An m68k implementation is here
<http://permalink.gmane.org/gmane.linux.ports.m68k/721>.
Andreas.
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
^ permalink raw reply
* linux-next: Tree for September 10
From: Stephen Rothwell @ 2009-09-10 9:03 UTC (permalink / raw)
To: linux-next; +Cc: LKML
[-- Attachment #1: Type: text/plain, Size: 9195 bytes --]
Hi all,
Please do not add code destined for 2.6.33 into linux-next trees until
(at least) 2.6.32-rc1 is out. This will hopefully give those who have
stuff destined for just after -rc1 a chance.
Changes since 20090909:
The acpi tree lost its build failure.
The rr tree still has a build failure so I used the version from
next-20090908.
The block tree gained a conflict against Linus' tree.
The security-testing tree lost its build failure.
The scsi-post-merge tree still has a build failure so I used the version
from 20090904.
----------------------------------------------------------------------------
I have created today's linux-next tree at
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
(patches at http://www.kernel.org/pub/linux/kernel/v2.6/next/ ). If you
are tracking the linux-next tree using git, you should not use "git pull"
to do so as that will try to merge the new linux-next release with the
old one. You should use "git fetch" as mentioned in the FAQ on the wiki
(see below).
You can see which trees have been included by looking in the Next/Trees
file in the source. There are also quilt-import.log and merge.log files
in the Next directory. Between each merge, the tree was built with
a ppc64_defconfig for powerpc and an allmodconfig for x86_64. After the
final fixups (if any), it is also built with powerpc allnoconfig (32 and
64 bit), ppc44x_defconfig and allyesconfig (minus
CONFIG_PROFILE_ALL_BRANCHES - this fails its final link) and i386, sparc
and sparc64 defconfig. These builds also have
CONFIG_ENABLE_WARN_DEPRECATED, CONFIG_ENABLE_MUST_CHECK and
CONFIG_DEBUG_INFO disabled when necessary.
Below is a summary of the state of the merge.
We are up to 140 trees (counting Linus' and 21 trees of patches pending for
Linus' tree), more are welcome (even if they are currently empty).
Thanks to those who have contributed, and to those who haven't, please do.
Status of my local build tests will be at
http://kisskb.ellerman.id.au/linux-next . If maintainers want to give
advice about cross compilers/configs that work, we are always open to add
more builds.
Thanks to Jan Dittmer for adding the linux-next tree to his build tests
at http://l4x.org/k/ , the guys at http://test.kernel.org/ and Randy
Dunlap for doing many randconfig builds.
There is a wiki covering stuff to do with linux-next at
http://linux.f-seidel.de/linux-next/pmwiki/ . Thanks to Frank Seidel.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
$ git checkout master
$ git reset --hard stable
Merging origin/master
Merging fixes/fixes
Merging arm-current/master
Merging m68k-current/for-linus
Merging powerpc-merge/merge
Merging sparc-current/master
Merging scsi-rc-fixes/master
Merging net-current/master
Merging sound-current/for-linus
Merging pci-current/for-linus
Merging wireless-current/master
Merging kbuild-current/master
Merging quilt/driver-core.current
Merging quilt/tty.current
Merging quilt/usb.current
Merging cpufreq-current/fixes
Merging input-current/for-linus
Merging md-current/for-linus
Merging audit-current/for-linus
Merging crypto-current/master
Merging ide-curent/master
Merging dwmw2/master
Merging arm/devel
Merging davinci/for-next
Merging pxa/for-next
Merging thumb-2/thumb-2
CONFLICT (add/add): Merge conflict in arch/arm/include/asm/unified.h
Merging avr32/avr32-arch
Merging blackfin/for-linus
Merging cris/for-next
Merging ia64/test
Merging m68k/for-next
Merging m68knommu/for-next
Merging microblaze/next
Merging mips/mips-for-linux-next
Merging parisc/next
Merging powerpc/next
CONFLICT (content): Merge conflict in kernel/gcov/Kconfig
Merging 4xx/next
Merging galak/next
Merging s390/features
Merging sh/master
Merging sparc/master
Merging xtensa/master
Merging cifs/master
Merging configfs/linux-next
Merging ecryptfs/next
Merging ext3/for_next
Merging ext4/next
Merging fatfs/master
Merging fuse/for-next
Merging gfs2/master
Merging jfs/next
Merging nfs/linux-next
Merging nfsd/nfsd-next
CONFLICT (content): Merge conflict in net/sunrpc/cache.c
Merging nilfs2/for-next
Merging ocfs2/linux-next
Merging squashfs/master
Merging udf/for_next
Merging v9fs/for-next
Merging ubifs/linux-next
Merging xfs/master
CONFLICT (content): Merge conflict in fs/xfs/linux-2.6/xfs_lrw.c
Merging reiserfs-bkl/reiserfs/kill-bkl
Merging vfs/for-next
Merging pci/linux-next
CONFLICT (content): Merge conflict in arch/powerpc/kernel/pci_64.c
Applying: pci: merge fixup for fundamental reset conflict with powerpc tree
Merging hid/for-next
Merging quilt/i2c
Merging quilt/jdelvare-hwmon
Merging quilt/kernel-doc
Merging v4l-dvb/master
CONFLICT (content): Merge conflict in drivers/media/video/sh_mobile_ceu_camera.c
Merging quota/for_next
Merging kbuild/master
Merging kconfig/for-next
CONFLICT (content): Merge conflict in scripts/extract-ikconfig
Merging ide/master
Merging libata/NEXT
Merging infiniband/for-next
Merging acpi/test
CONFLICT (content): Merge conflict in drivers/acpi/power.c
Merging ieee1394/for-next
Merging ubi/linux-next
Merging kvm/linux-next
Merging dlm/next
Merging scsi/master
Merging async_tx/next
Merging net/master
Merging wireless/master
Merging mtd/master
CONFLICT (content): Merge conflict in drivers/mtd/mtdcore.c
Merging crypto/master
Merging sound/for-next
Merging cpufreq/next
Merging quilt/rr
$ git reset --hard HEAD^
Merging refs/next/20090908/rr
CONFLICT (content): Merge conflict in drivers/net/virtio_net.c
Merging mmc/next
Merging input/next
CONFLICT (content): Merge conflict in drivers/base/platform.c
Merging lsm/for-next
Merging block/for-next
CONFLICT (content): Merge conflict in drivers/block/aoe/aoeblk.c
CONFLICT (content): Merge conflict in fs/ubifs/super.c
Merging quilt/device-mapper
Merging embedded/master
Merging firmware/master
Merging pcmcia/master
Merging battery/master
CONFLICT (content): Merge conflict in drivers/power/wm97xx_battery.c
Merging leds/for-mm
Merging backlight/for-mm
Merging kgdb/kgdb-next
Merging slab/for-next
Merging uclinux/for-next
Merging md/for-next
Merging mfd/for-next
CONFLICT (content): Merge conflict in drivers/input/misc/Kconfig
Merging hdlc/hdlc-next
Merging drm/drm-next
CONFLICT (content): Merge conflict in firmware/Makefile
Merging voltage/for-next
CONFLICT (content): Merge conflict in drivers/regulator/Kconfig
Merging security-testing/next
CONFLICT (content): Merge conflict in arch/arm/kernel/signal.c
CONFLICT (content): Merge conflict in arch/parisc/include/asm/thread_info.h
CONFLICT (content): Merge conflict in arch/parisc/kernel/entry.S
CONFLICT (content): Merge conflict in arch/parisc/kernel/signal.c
Applying: security: fix merge for tun_struct changes
Merging lblnet/master
CONFLICT (content): Merge conflict in drivers/net/tun.c
Merging agp/agp-next
CONFLICT (content): Merge conflict in drivers/char/agp/uninorth-agp.c
Merging uwb/for-upstream
Merging watchdog/master
Merging bdev/master
Merging dwmw2-iommu/master
Merging cputime/cputime
Merging osd/linux-next
Merging jc_docs/docs-next
Merging nommu/master
Merging trivial/for-next
Merging audit/for-next
Merging omap/for-next
Merging quilt/aoe
Merging suspend/linux-next
Merging bluetooth/master
Merging fsnotify/for-next
Merging irda/for-next
Merging hwlat/for-linus
Merging drbd/drbd
Merging kmemleak/kmemleak
Merging tip/auto-latest
CONFLICT (content): Merge conflict in arch/x86/include/asm/socket.h
CONFLICT (content): Merge conflict in arch/x86/kernel/setup.c
CONFLICT (content): Merge conflict in drivers/pci/dmar.c
CONFLICT (content): Merge conflict in drivers/pci/intel-iommu.c
CONFLICT (content): Merge conflict in include/linux/rcupdate.h
Applying: tip: fix merge for cupmask update
Merging oprofile/for-next
CONFLICT (content): Merge conflict in kernel/trace/ring_buffer.c
Merging percpu/for-next
CONFLICT (content): Merge conflict in arch/sh/kernel/vmlinux.lds.S
CONFLICT (content): Merge conflict in kernel/sched.c
CONFLICT (content): Merge conflict in mm/percpu.c
Merging sfi/sfi-test
CONFLICT (content): Merge conflict in arch/x86/kernel/setup.c
Merging asm-generic/next
Merging hwpoison/hwpoison
Merging quilt/driver-core
CONFLICT (content): Merge conflict in drivers/base/class.c
CONFLICT (content): Merge conflict in drivers/mtd/mtdcore.c
CONFLICT (content): Merge conflict in init/main.c
Merging quilt/tty
CONFLICT (content): Merge conflict in arch/x86/include/asm/termios.h
Merging quilt/usb
Merging quilt/staging
CONFLICT (delete/modify): drivers/staging/at76_usb/at76_usb.c deleted in quilt/staging and modified in HEAD. Version HEAD of drivers/staging/at76_usb/at76_usb.c left in tree.
CONFLICT (delete/modify): drivers/staging/epl/VirtualEthernetLinux.c deleted in quilt/staging and modified in HEAD. Version HEAD of drivers/staging/epl/VirtualEthernetLinux.c left in tree.
$ git rm -f drivers/staging/epl/VirtualEthernetLinux.c
$ git rm -f drivers/staging/at76_usb/at76_usb.c
Merging scsi-post-merge/master
$ git reset --hard HEAD^
Merging refs/next/20090904/scsi-post-merge
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: linux-next: scsi tree build warnings
From: James Bottomley @ 2009-09-10 17:08 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Robert Love, linux-scsi
In-Reply-To: <20090907130024.d67c032d.sfr@canb.auug.org.au>
On Mon, 2009-09-07 at 13:00 +1000, Stephen Rothwell wrote:
> Hi James,
>
> Today's linux-next build (x86_64 allmodconfig) produced these warnings:
>
> usr/include/scsi/fc/fc_els.h:165: found __[us]{8,16,32,64} type without #include <linux/types.h>
> usr/include/scsi/fc/fc_fs.h:32: found __[us]{8,16,32,64} type without #include <linux/types.h>
> usr/include/scsi/fc/fc_gs.h:29: found __[us]{8,16,32,64} type without #include <linux/types.h>
> usr/include/scsi/fc/fc_ns.h:71: found __[us]{8,16,32,64} type without #include <linux/types.h>
>
> Introduced by commit 171bb4f9f6a20d405a3cb5111ce92ad83aae2302 ("[SCSI]
> libfc: Export FC headers").
OK, I've dropped this patch ... Robert, can you resubmit it when you've
verified it all works.
James
^ permalink raw reply
* Re: linux-next: scsi tree build warnings
From: Robert Love @ 2009-09-10 19:58 UTC (permalink / raw)
To: James Bottomley
Cc: Stephen Rothwell, linux-next@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-scsi
In-Reply-To: <1252602497.11956.95.camel@mulgrave.site>
On Thu, 2009-09-10 at 10:08 -0700, James Bottomley wrote:
> On Mon, 2009-09-07 at 13:00 +1000, Stephen Rothwell wrote:
> > Hi James,
> >
> > Today's linux-next build (x86_64 allmodconfig) produced these warnings:
> >
> > usr/include/scsi/fc/fc_els.h:165: found __[us]{8,16,32,64} type without #include <linux/types.h>
> > usr/include/scsi/fc/fc_fs.h:32: found __[us]{8,16,32,64} type without #include <linux/types.h>
> > usr/include/scsi/fc/fc_gs.h:29: found __[us]{8,16,32,64} type without #include <linux/types.h>
> > usr/include/scsi/fc/fc_ns.h:71: found __[us]{8,16,32,64} type without #include <linux/types.h>
> >
> > Introduced by commit 171bb4f9f6a20d405a3cb5111ce92ad83aae2302 ("[SCSI]
> > libfc: Export FC headers").
>
> OK, I've dropped this patch ... Robert, can you resubmit it when you've
> verified it all works.
>
Yes, I'll fix this and resubmit.
^ permalink raw reply
* [PATCH v6] RO/NX protection for loadable kernel modules
From: Siarhei Liakh @ 2009-09-11 2:50 UTC (permalink / raw)
To: linux-kernel, linux-security-module, linux-next
Cc: Arjan van de Ven, James Morris, Andrew Morton, Andi Kleen,
Thomas Gleixner, H. Peter Anvin, Ingo Molnar, Rusty Russell,
Stephen Rothwell
This patch is a logical extension of the protection provided by
CONFIG_DEBUG_RODATA to LKMs. The protection is provided by splitting
module_core and module_init into three logical parts each and setting
appropriate page access permissions for each individual section:
1. Code: RO+X
2. RO data: RO+NX
3. RW data: RW+NX
In order to achieve proper protection, layout_sections() have been
modified to align each of the three parts mentioned above onto page
boundary. Next, the corresponding page access permissions are set
right before successful exit from load_module(). Further, free_module()
and sys_init_module have been modified to set module_core and
module_init as RW+NX right before calling module_free().
By default, the original section layout is preserved and RO/NX is
enforced only for whole pages of same content.
However, when compiled with CONFIG_DEBUG_RODATA=y, the patch
will page-align each group of sections to ensure that each page contains
only one type of content.
RO/NX enforcement is active on x86 only.
v1: Initial proof-of-concept patch.
v2: The patch have been re-written to reduce the number of #ifdefs and
to make it architecture-agnostic. Code formatting have been corrected also.
v3: Opportunistic RO/NX protectiuon is now unconditional. Section
page-alignment is enabled when CONFIG_DEBUG_RODATA=y.
v4: Removed most macros and improved coding style.
v5: Changed page-alignment and RO/NX section size calculation
v6: Fixed comments. Restricted RO/NX enforcement to x86 only
The patch have been developed for Linux 2.6.30 by Siarhei Liakh
<sliakh.lkml@gmail.com> and Xuxian Jiang <jiang@cs.ncsu.edu>.
---
Signed-off-by: Siarhei Liakh <sliakh.lkml@gmail.com>
Signed-off-by: Xuxian Jiang <jiang@cs.ncsu.edu>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
diff --git a/include/linux/module.h b/include/linux/module.h
index 627ac08..5ba770e 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -293,6 +293,9 @@ struct module
/* The size of the executable code in each section. */
unsigned int init_text_size, core_text_size;
+ /* Size of RO sections of the module (text+rodata) */
+ unsigned int init_ro_size, core_ro_size;
+
/* Arch-specific module values */
struct mod_arch_specific arch;
diff --git a/kernel/module.c b/kernel/module.c
index e797812..660278a 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -52,6 +52,7 @@
#include <linux/ftrace.h>
#include <linux/async.h>
#include <linux/percpu.h>
+#include <linux/pfn.h>
#if 0
#define DEBUGP printk
@@ -63,6 +64,26 @@
#define ARCH_SHF_SMALL 0
#endif
+/*
+ * Modules' sections will be aligned on page boundaries
+ * to ensure complete separation of code and data, but
+ * only when CONFIG_DEBUG_RODATA=y
+ */
+#ifdef CONFIG_DEBUG_RODATA
+#define debug_align(X) ALIGN(X, PAGE_SIZE)
+#else
+#define debug_align(X) (X)
+#endif
+
+/*
+ * Given BASE and SIZE this macro calculates the number of pages the
+ * memory regions occupies
+ */
+#define NUMBER_OF_PAGES(BASE, SIZE) ((SIZE > 0) ? \
+ (PFN_DOWN((unsigned long)BASE + SIZE - 1) - \
+ PFN_DOWN((unsigned long)BASE) + 1) \
+ : (0UL))
+
/* If this is set, the section belongs in the init part of the module */
#define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG-1))
@@ -1471,6 +1492,69 @@ static int __unlink_module(void *_mod)
return 0;
}
+/*
+ * LKM RO/NX protection: protect module's text/ro-data
+ * from modification and any data from execution.
+ */
+static void set_section_ro_nx(void *base,
+ unsigned long text_size,
+ unsigned long ro_size,
+ unsigned long total_size)
+{
+#ifdef CONFIG_X86
+ /* begin and end PFNs of the current subsection */
+ unsigned long begin_pfn;
+ unsigned long end_pfn;
+
+ /*
+ * Set RO for module text and RO-data:
+ * - Always protect first page.
+ * - Do not protect last partial page.
+ */
+ if (ro_size > 0) {
+ begin_pfn = PFN_DOWN((unsigned long)base);
+ end_pfn = PFN_DOWN((unsigned long)base + ro_size);
+ if (end_pfn > begin_pfn)
+ set_memory_ro(begin_pfn << PAGE_SHIFT,
+ end_pfn - begin_pfn);
+ }
+
+ /*
+ * Set NX permissions for module data:
+ * - Do not protect first partial page.
+ * - Always protect last page.
+ */
+ if (total_size > text_size) {
+ begin_pfn = PFN_UP((unsigned long)base + text_size);
+ end_pfn = PFN_UP((unsigned long)base + total_size);
+ if (end_pfn > begin_pfn)
+ set_memory_nx(begin_pfn << PAGE_SHIFT,
+ end_pfn - begin_pfn);
+ }
+#endif
+}
+
+/* Setting memory back to RW+NX before releasing it */
+void unset_section_ro_nx(struct module *mod, void *module_region)
+{
+#ifdef CONFIG_X86
+ unsigned long total_pages;
+
+ if (mod->module_core == module_region) {
+ /* Set core as NX+RW */
+ total_pages = NUMBER_OF_PAGES(mod->module_core, mod->core_size);
+ set_memory_nx((unsigned long)mod->module_core, total_pages);
+ set_memory_rw((unsigned long)mod->module_core, total_pages);
+
+ } else if (mod->module_init == module_region) {
+ /* Set init as NX+RW */
+ total_pages = NUMBER_OF_PAGES(mod->module_init, mod->init_size);
+ set_memory_nx((unsigned long)mod->module_init, total_pages);
+ set_memory_rw((unsigned long)mod->module_init, total_pages);
+ }
+#endif
+}
+
/* Free a module, remove from lists, etc (must hold module_mutex). */
static void free_module(struct module *mod)
{
@@ -1493,6 +1577,7 @@ static void free_module(struct module *mod)
ftrace_release(mod->module_core, mod->core_size);
/* This may be NULL, but that's OK */
+ unset_section_ro_nx(mod, mod->module_init);
module_free(mod, mod->module_init);
kfree(mod->args);
if (mod->percpu)
@@ -1505,6 +1590,7 @@ static void free_module(struct module *mod)
lockdep_free_key_range(mod->module_core, mod->core_size);
/* Finally, free the core (containing the module structure) */
+ unset_section_ro_nx(mod, mod->module_core);
module_free(mod, mod->module_core);
}
@@ -1678,8 +1764,19 @@ static void layout_sections(struct module *mod,
s->sh_entsize = get_offset(mod, &mod->core_size, s, i);
DEBUGP("\t%s\n", secstrings + s->sh_name);
}
- if (m == 0)
+ switch (m) {
+ case 0: /* executable */
+ mod->core_size = debug_align(mod->core_size);
mod->core_text_size = mod->core_size;
+ break;
+ case 1: /* RO: text and ro-data */
+ mod->core_size = debug_align(mod->core_size);
+ mod->core_ro_size = mod->core_size;
+ break;
+ case 3: /* whole core */
+ mod->core_size = debug_align(mod->core_size);
+ break;
+ }
}
DEBUGP("Init section allocation order:\n");
@@ -1696,8 +1793,19 @@ static void layout_sections(struct module *mod,
| INIT_OFFSET_MASK);
DEBUGP("\t%s\n", secstrings + s->sh_name);
}
- if (m == 0)
+ switch (m) {
+ case 0: /* executable */
+ mod->init_size = debug_align(mod->init_size);
mod->init_text_size = mod->init_size;
+ break;
+ case 1: /* RO: text and ro-data */
+ mod->init_size = debug_align(mod->init_size);
+ mod->init_ro_size = mod->init_size;
+ break;
+ case 3: /* whole init */
+ mod->init_size = debug_align(mod->init_size);
+ break;
+ }
}
}
@@ -2291,6 +2399,18 @@ static noinline struct module *load_module(void
__user *umod,
/* Get rid of temporary copy */
vfree(hdr);
+ /* Set RO and NX regions for core */
+ set_section_ro_nx(mod->module_core,
+ mod->core_text_size,
+ mod->core_ro_size,
+ mod->core_size);
+
+ /* Set RO and NX regions for init */
+ set_section_ro_nx(mod->module_init,
+ mod->init_text_size,
+ mod->init_ro_size,
+ mod->init_size);
+
/* Done! */
return mod;
@@ -2394,6 +2514,7 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
mutex_lock(&module_mutex);
/* Drop initial reference. */
module_put(mod);
+ unset_section_ro_nx(mod, mod->module_init);
module_free(mod, mod->module_init);
mod->module_init = NULL;
mod->init_size = 0;
^ permalink raw reply related
* Re: linux-next: rr tree build failure
From: Siarhei Liakh @ 2009-09-11 3:00 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Rusty Russell, linux-next, linux-kernel, Xuxian Jiang,
Arjan van de Ven
In-Reply-To: <20090909134752.f5b8c2e7.sfr@canb.auug.org.au>
On Tue, Sep 8, 2009 at 11:47 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi Rusty,
>
> Today's linux-next build (powerpc ppc64_defconfig) failed like this:
>
> kernel/module.c: In function 'set_section_ro_nx':
> kernel/module.c:1549: error: implicit declaration of function 'set_memory_ro'
> kernel/module.c:1560: error: implicit declaration of function 'set_memory_nx'
> kernel/module.c: In function 'unset_section_ro_nx':
> kernel/module.c:1575: error: implicit declaration of function 'set_memory_rw'
>
> Caused by commit 25306e21864c2a220d6fa2e0632425028aa9626c
> ("module:ro-nx-protection") which uses these interfaces that are only
> defined on x86 ...
>
> I have used the version of the rr tree from next-20090908 for today.
I have posted a replacement patch for that commit: "[PATCH v6] RO/NX
protection for loadable kernel modules"
Please let me know if you would rather see a short "patch patch"
rather than complete patch replacement. The fix, essentially, is to
encapsulate entire bodies of unset_section_ro_nx() and
set_section_ro_nx() inside #ifdef CONFIG_X86 ... #endif. This way
set_memory_* will be called only on x86.
Thanks.
^ permalink raw reply
* [PATCH 0/3] kernel.h: move logging functions to separate file
From: Joe Perches @ 2009-09-11 3:29 UTC (permalink / raw)
To: linux-kernel, linux-next
Cc: Ingo Molnar, Greg Kroah-Hartman, Andrew Morton, Steven Rostedt,
Peter Zijlstra
kernel.h has gotten cluttered.
Unclutter it and make it kernel style compatible.
Joe Perches (3):
include/linux/logging.h: Separate logging functions out of kernel.h
include/linux/logging.h: Reduce data usage of printk_once
include/linux/kernel.h: neaten and group functions and definitions
include/linux/kernel.h | 754 ++++++++++++++++-------------------------------
include/linux/logging.h | 313 ++++++++++++++++++++
2 files changed, 573 insertions(+), 494 deletions(-)
create mode 100644 include/linux/logging.h
^ permalink raw reply
* [PATCH 1/3] include/linux/logging.h: Separate logging functions out of kernel.h
From: Joe Perches @ 2009-09-11 3:29 UTC (permalink / raw)
To: linux-kernel, linux-next
Cc: Ingo Molnar, Greg Kroah-Hartman, Andrew Morton, Steven Rostedt,
Peter Zijlstra
In-Reply-To: <cover.1252639195.git.joe@perches.com>
Moved all logging/tracing bits to a separate file
Neatened a bit for checkpatch complaints
Signed-off-by: Joe Perches <joe@perches.com>
---
include/linux/kernel.h | 293 +-------------------------------------------
include/linux/logging.h | 313 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 314 insertions(+), 292 deletions(-)
create mode 100644 include/linux/logging.h
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index f61039e..20eb8ae 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -17,10 +17,10 @@
#include <linux/typecheck.h>
#include <linux/ratelimit.h>
#include <linux/dynamic_debug.h>
+#include <linux/logging.h>
#include <asm/byteorder.h>
#include <asm/bug.h>
-
struct ftrace_branch_data {
const char *func;
const char *file;
@@ -112,9 +112,6 @@ static inline void branch_profiler(struct ftrace_branch_data *data, int cond)
#endif /* CONFIG_PROFILE_ALL_BRANCHES */
#endif
-extern const char linux_banner[];
-extern const char linux_proc_banner[];
-
#define USHORT_MAX ((u16)(~0U))
#define SHORT_MAX ((s16)(USHORT_MAX>>1))
#define SHORT_MIN (-SHORT_MAX - 1)
@@ -180,31 +177,6 @@ extern const char linux_proc_banner[];
*/
#define lower_32_bits(n) ((u32)(n))
-#define KERN_EMERG "<0>" /* system is unusable */
-#define KERN_ALERT "<1>" /* action must be taken immediately */
-#define KERN_CRIT "<2>" /* critical conditions */
-#define KERN_ERR "<3>" /* error conditions */
-#define KERN_WARNING "<4>" /* warning conditions */
-#define KERN_NOTICE "<5>" /* normal but significant condition */
-#define KERN_INFO "<6>" /* informational */
-#define KERN_DEBUG "<7>" /* debug-level messages */
-
-/* Use the default kernel loglevel */
-#define KERN_DEFAULT "<d>"
-/*
- * Annotation for a "continued" line of log printout (only done after a
- * line that had no enclosing \n). Only to be used by core/arch code
- * during early bootup (a continued line is not SMP-safe otherwise).
- */
-#define KERN_CONT "<c>"
-
-extern int console_printk[];
-
-#define console_loglevel (console_printk[0])
-#define default_message_loglevel (console_printk[1])
-#define minimum_console_loglevel (console_printk[2])
-#define default_console_loglevel (console_printk[3])
-
struct completion;
struct pt_regs;
struct user;
@@ -303,93 +275,8 @@ extern int func_ptr_is_kernel_text(void *ptr);
struct pid;
extern struct pid *session_of_pgrp(struct pid *pgrp);
-/*
- * FW_BUG
- * Add this to a message where you are sure the firmware is buggy or behaves
- * really stupid or out of spec. Be aware that the responsible BIOS developer
- * should be able to fix this issue or at least get a concrete idea of the
- * problem by reading your message without the need of looking at the kernel
- * code.
- *
- * Use it for definite and high priority BIOS bugs.
- *
- * FW_WARN
- * Use it for not that clear (e.g. could the kernel messed up things already?)
- * and medium priority BIOS bugs.
- *
- * FW_INFO
- * Use this one if you want to tell the user or vendor about something
- * suspicious, but generally harmless related to the firmware.
- *
- * Use it for information or very low priority BIOS bugs.
- */
-#define FW_BUG "[Firmware Bug]: "
-#define FW_WARN "[Firmware Warn]: "
-#define FW_INFO "[Firmware Info]: "
-
-#ifdef CONFIG_PRINTK
-asmlinkage int vprintk(const char *fmt, va_list args)
- __attribute__ ((format (printf, 1, 0)));
-asmlinkage int printk(const char * fmt, ...)
- __attribute__ ((format (printf, 1, 2))) __cold;
-
-extern struct ratelimit_state printk_ratelimit_state;
-extern int printk_ratelimit(void);
-extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
- unsigned int interval_msec);
-
-/*
- * Print a one-time message (analogous to WARN_ONCE() et al):
- */
-#define printk_once(x...) ({ \
- static int __print_once = 1; \
- \
- if (__print_once) { \
- __print_once = 0; \
- printk(x); \
- } \
-})
-
-void log_buf_kexec_setup(void);
-#else
-static inline int vprintk(const char *s, va_list args)
- __attribute__ ((format (printf, 1, 0)));
-static inline int vprintk(const char *s, va_list args) { return 0; }
-static inline int printk(const char *s, ...)
- __attribute__ ((format (printf, 1, 2)));
-static inline int __cold printk(const char *s, ...) { return 0; }
-static inline int printk_ratelimit(void) { return 0; }
-static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \
- unsigned int interval_msec) \
- { return false; }
-
-/* No effect, but we still get type checking even in the !PRINTK case: */
-#define printk_once(x...) printk(x)
-
-static inline void log_buf_kexec_setup(void)
-{
-}
-#endif
-
-extern int printk_needs_cpu(int cpu);
-extern void printk_tick(void);
-
-extern void asmlinkage __attribute__((format(printf, 1, 2)))
- early_printk(const char *fmt, ...);
-
unsigned long int_sqrt(unsigned long);
-static inline void console_silent(void)
-{
- console_loglevel = 0;
-}
-
-static inline void console_verbose(void)
-{
- if (console_loglevel)
- console_loglevel = 15;
-}
-
extern void bust_spinlocks(int yes);
extern void wake_up_klogd(void);
extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */
@@ -397,7 +284,6 @@ extern int panic_timeout;
extern int panic_on_oops;
extern int panic_on_unrecovered_nmi;
extern int panic_on_io_nmi;
-extern const char *print_tainted(void);
extern void add_taint(unsigned flag);
extern int test_taint(unsigned flag);
extern unsigned long get_taint(void);
@@ -452,183 +338,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
return buf;
}
-#ifndef pr_fmt
-#define pr_fmt(fmt) fmt
-#endif
-
-#define pr_emerg(fmt, ...) \
- printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_alert(fmt, ...) \
- printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_crit(fmt, ...) \
- printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_err(fmt, ...) \
- printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_warning(fmt, ...) \
- printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_notice(fmt, ...) \
- printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_info(fmt, ...) \
- printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_cont(fmt, ...) \
- printk(KERN_CONT fmt, ##__VA_ARGS__)
-
-/* pr_devel() should produce zero code unless DEBUG is defined */
-#ifdef DEBUG
-#define pr_devel(fmt, ...) \
- printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
-#else
-#define pr_devel(fmt, ...) \
- ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; })
-#endif
-
-/* If you are writing a driver, please use dev_dbg instead */
-#if defined(DEBUG)
-#define pr_debug(fmt, ...) \
- printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
-#elif defined(CONFIG_DYNAMIC_DEBUG)
-/* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */
-#define pr_debug(fmt, ...) do { \
- dynamic_pr_debug(fmt, ##__VA_ARGS__); \
- } while (0)
-#else
-#define pr_debug(fmt, ...) \
- ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; })
-#endif
-
-/*
- * General tracing related utility functions - trace_printk(),
- * tracing_on/tracing_off and tracing_start()/tracing_stop
- *
- * Use tracing_on/tracing_off when you want to quickly turn on or off
- * tracing. It simply enables or disables the recording of the trace events.
- * This also corresponds to the user space /sys/kernel/debug/tracing/tracing_on
- * file, which gives a means for the kernel and userspace to interact.
- * Place a tracing_off() in the kernel where you want tracing to end.
- * From user space, examine the trace, and then echo 1 > tracing_on
- * to continue tracing.
- *
- * tracing_stop/tracing_start has slightly more overhead. It is used
- * by things like suspend to ram where disabling the recording of the
- * trace is not enough, but tracing must actually stop because things
- * like calling smp_processor_id() may crash the system.
- *
- * Most likely, you want to use tracing_on/tracing_off.
- */
-#ifdef CONFIG_RING_BUFFER
-void tracing_on(void);
-void tracing_off(void);
-/* trace_off_permanent stops recording with no way to bring it back */
-void tracing_off_permanent(void);
-int tracing_is_on(void);
-#else
-static inline void tracing_on(void) { }
-static inline void tracing_off(void) { }
-static inline void tracing_off_permanent(void) { }
-static inline int tracing_is_on(void) { return 0; }
-#endif
-#ifdef CONFIG_TRACING
-extern void tracing_start(void);
-extern void tracing_stop(void);
-extern void ftrace_off_permanent(void);
-
-extern void
-ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3);
-
-static inline void __attribute__ ((format (printf, 1, 2)))
-____trace_printk_check_format(const char *fmt, ...)
-{
-}
-#define __trace_printk_check_format(fmt, args...) \
-do { \
- if (0) \
- ____trace_printk_check_format(fmt, ##args); \
-} while (0)
-
-/**
- * trace_printk - printf formatting in the ftrace buffer
- * @fmt: the printf format for printing
- *
- * Note: __trace_printk is an internal function for trace_printk and
- * the @ip is passed in via the trace_printk macro.
- *
- * This function allows a kernel developer to debug fast path sections
- * that printk is not appropriate for. By scattering in various
- * printk like tracing in the code, a developer can quickly see
- * where problems are occurring.
- *
- * This is intended as a debugging tool for the developer only.
- * Please refrain from leaving trace_printks scattered around in
- * your code.
- */
-
-#define trace_printk(fmt, args...) \
-do { \
- __trace_printk_check_format(fmt, ##args); \
- if (__builtin_constant_p(fmt)) { \
- static const char *trace_printk_fmt \
- __attribute__((section("__trace_printk_fmt"))) = \
- __builtin_constant_p(fmt) ? fmt : NULL; \
- \
- __trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
- } else \
- __trace_printk(_THIS_IP_, fmt, ##args); \
-} while (0)
-
-extern int
-__trace_bprintk(unsigned long ip, const char *fmt, ...)
- __attribute__ ((format (printf, 2, 3)));
-
-extern int
-__trace_printk(unsigned long ip, const char *fmt, ...)
- __attribute__ ((format (printf, 2, 3)));
-
-/*
- * The double __builtin_constant_p is because gcc will give us an error
- * if we try to allocate the static variable to fmt if it is not a
- * constant. Even with the outer if statement.
- */
-#define ftrace_vprintk(fmt, vargs) \
-do { \
- if (__builtin_constant_p(fmt)) { \
- static const char *trace_printk_fmt \
- __attribute__((section("__trace_printk_fmt"))) = \
- __builtin_constant_p(fmt) ? fmt : NULL; \
- \
- __ftrace_vbprintk(_THIS_IP_, trace_printk_fmt, vargs); \
- } else \
- __ftrace_vprintk(_THIS_IP_, fmt, vargs); \
-} while (0)
-
-extern int
-__ftrace_vbprintk(unsigned long ip, const char *fmt, va_list ap);
-
-extern int
-__ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);
-
-extern void ftrace_dump(void);
-#else
-static inline void
-ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { }
-static inline int
-trace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
-
-static inline void tracing_start(void) { }
-static inline void tracing_stop(void) { }
-static inline void ftrace_off_permanent(void) { }
-static inline int
-trace_printk(const char *fmt, ...)
-{
- return 0;
-}
-static inline int
-ftrace_vprintk(const char *fmt, va_list ap)
-{
- return 0;
-}
-static inline void ftrace_dump(void) { }
-#endif /* CONFIG_TRACING */
-
/*
* Display an IP address in readable format.
*/
diff --git a/include/linux/logging.h b/include/linux/logging.h
new file mode 100644
index 0000000..361d5ed
--- /dev/null
+++ b/include/linux/logging.h
@@ -0,0 +1,313 @@
+#ifndef _LINUX_LOGGING_H
+#define _LINUX_LOGGING_H
+
+#ifdef __KERNEL__
+
+extern const char linux_banner[];
+extern const char linux_proc_banner[];
+
+/*
+ * Defines used for printk logging level
+ */
+
+#define KERN_EMERG "<0>" /* system is unusable */
+#define KERN_ALERT "<1>" /* action must be taken immediately */
+#define KERN_CRIT "<2>" /* critical conditions */
+#define KERN_ERR "<3>" /* error conditions */
+#define KERN_WARNING "<4>" /* warning conditions */
+#define KERN_NOTICE "<5>" /* normal but significant condition */
+#define KERN_INFO "<6>" /* informational */
+#define KERN_DEBUG "<7>" /* debug-level messages */
+
+/* Use the default kernel loglevel */
+#define KERN_DEFAULT "<d>"
+/*
+ * Annotation for a "continued" line of log printout (only done after a
+ * line that had no enclosing \n). Only to be used by core/arch code
+ * during early bootup (a continued line is not SMP-safe otherwise).
+ */
+#define KERN_CONT "<c>"
+
+/*
+ * Console elements
+ */
+
+extern int console_printk[];
+
+#define console_loglevel (console_printk[0])
+#define default_message_loglevel (console_printk[1])
+#define minimum_console_loglevel (console_printk[2])
+#define default_console_loglevel (console_printk[3])
+
+static inline void console_silent(void)
+{
+ console_loglevel = 0;
+}
+
+static inline void console_verbose(void)
+{
+ if (console_loglevel)
+ console_loglevel = 15;
+}
+
+/*
+ * FW_BUG
+ * Add this to a message where you are sure the firmware is buggy or behaves
+ * really stupid or out of spec. Be aware that the responsible BIOS developer
+ * should be able to fix this issue or at least get a concrete idea of the
+ * problem by reading your message without the need of looking at the kernel
+ * code.
+ *
+ * Use it for definite and high priority BIOS bugs.
+ *
+ * FW_WARN
+ * Use it for not that clear (e.g. could the kernel messed up things already?)
+ * and medium priority BIOS bugs.
+ *
+ * FW_INFO
+ * Use this one if you want to tell the user or vendor about something
+ * suspicious, but generally harmless related to the firmware.
+ *
+ * Use it for information or very low priority BIOS bugs.
+ */
+#define FW_BUG "[Firmware Bug]: "
+#define FW_WARN "[Firmware Warn]: "
+#define FW_INFO "[Firmware Info]: "
+
+#ifdef CONFIG_PRINTK
+
+asmlinkage int vprintk(const char *fmt, va_list args)
+ __attribute__ ((format (printf, 1, 0)));
+asmlinkage int printk(const char *fmt, ...)
+ __attribute__ ((format (printf, 1, 2))) __cold;
+
+extern struct ratelimit_state printk_ratelimit_state;
+extern int printk_ratelimit(void);
+extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
+ unsigned int interval_msec);
+
+/*
+ * Print a one-time message (analogous to WARN_ONCE() et al):
+ */
+#define printk_once(fmt, ...) \
+({ \
+ static int __print_once = 1; \
+ \
+ if (__print_once) { \
+ __print_once = 0; \
+ printk(fmt, ##__VA_ARGS__); \
+ } \
+})
+
+void log_buf_kexec_setup(void);
+
+#else
+
+static inline int vprintk(const char *s, va_list args)
+ __attribute__ ((format (printf, 1, 0)));
+static inline int vprintk(const char *s, va_list args) { return 0; }
+static inline int printk(const char *s, ...)
+ __attribute__ ((format (printf, 1, 2)));
+static inline int __cold printk(const char *s, ...) { return 0; }
+static inline int printk_ratelimit(void) { return 0; }
+static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies,
+ unsigned int interval_msec)
+{
+ return false;
+}
+
+/* No effect, but we still get type checking even in the !PRINTK case: */
+#define printk_once(fmt, ...) printk(fmt, ##__VA_ARGS__)
+
+static inline void log_buf_kexec_setup(void)
+{
+}
+
+#endif /* CONFIG_PRINTK */
+
+extern int printk_needs_cpu(int cpu);
+extern void printk_tick(void);
+
+extern void asmlinkage __attribute__((format(printf, 1, 2)))
+ early_printk(const char *fmt, ...);
+
+extern const char *print_tainted(void);
+
+#ifndef pr_fmt
+#define pr_fmt(fmt) fmt
+#endif
+
+#define pr_emerg(fmt, ...) \
+ printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_alert(fmt, ...) \
+ printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_crit(fmt, ...) \
+ printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_err(fmt, ...) \
+ printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_warning(fmt, ...) \
+ printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_notice(fmt, ...) \
+ printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_info(fmt, ...) \
+ printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_cont(fmt, ...) \
+ printk(KERN_CONT fmt, ##__VA_ARGS__)
+
+/* pr_devel() should produce zero code unless DEBUG is defined */
+#ifdef DEBUG
+#define pr_devel(fmt, ...) \
+ printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#else
+#define pr_devel(fmt, ...) \
+ ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; })
+#endif
+
+/* If you are writing a driver, please use dev_dbg instead */
+#if defined(DEBUG)
+#define pr_debug(fmt, ...) \
+ printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#elif defined(CONFIG_DYNAMIC_DEBUG)
+/* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */
+#define pr_debug(fmt, ...) \
+ do { dynamic_pr_debug(fmt, ##__VA_ARGS__); } while (0)
+#else
+#define pr_debug(fmt, ...) \
+ ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; })
+#endif
+
+/*
+ * General tracing related utility functions - trace_printk(),
+ * tracing_on/tracing_off and tracing_start()/tracing_stop
+ *
+ * Use tracing_on/tracing_off when you want to quickly turn on or off
+ * tracing. It simply enables or disables the recording of the trace events.
+ * This also corresponds to the user space /sys/kernel/debug/tracing/tracing_on
+ * file, which gives a means for the kernel and userspace to interact.
+ * Place a tracing_off() in the kernel where you want tracing to end.
+ * From user space, examine the trace, and then echo 1 > tracing_on
+ * to continue tracing.
+ *
+ * tracing_stop/tracing_start has slightly more overhead. It is used
+ * by things like suspend to ram where disabling the recording of the
+ * trace is not enough, but tracing must actually stop because things
+ * like calling smp_processor_id() may crash the system.
+ *
+ * Most likely, you want to use tracing_on/tracing_off.
+ */
+#ifdef CONFIG_RING_BUFFER
+void tracing_on(void);
+void tracing_off(void);
+/* trace_off_permanent stops recording with no way to bring it back */
+void tracing_off_permanent(void);
+int tracing_is_on(void);
+#else
+static inline void tracing_on(void) { }
+static inline void tracing_off(void) { }
+static inline void tracing_off_permanent(void) { }
+static inline int tracing_is_on(void) { return 0; }
+#endif
+#ifdef CONFIG_TRACING
+extern void tracing_start(void);
+extern void tracing_stop(void);
+extern void ftrace_off_permanent(void);
+
+extern void
+ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3);
+
+static inline void __attribute__ ((format (printf, 1, 2)))
+____trace_printk_check_format(const char *fmt, ...)
+{
+}
+#define __trace_printk_check_format(fmt, args...) \
+do { \
+ if (0) \
+ ____trace_printk_check_format(fmt, ##args); \
+} while (0)
+
+/**
+ * trace_printk - printf formatting in the ftrace buffer
+ * @fmt: the printf format for printing
+ *
+ * Note: __trace_printk is an internal function for trace_printk and
+ * the @ip is passed in via the trace_printk macro.
+ *
+ * This function allows a kernel developer to debug fast path sections
+ * that printk is not appropriate for. By scattering in various
+ * printk like tracing in the code, a developer can quickly see
+ * where problems are occurring.
+ *
+ * This is intended as a debugging tool for the developer only.
+ * Please refrain from leaving trace_printks scattered around in
+ * your code.
+ */
+
+#define trace_printk(fmt, args...) \
+do { \
+ __trace_printk_check_format(fmt, ##args); \
+ if (__builtin_constant_p(fmt)) { \
+ static const char *trace_printk_fmt \
+ __attribute__((section("__trace_printk_fmt"))) = \
+ __builtin_constant_p(fmt) ? fmt : NULL; \
+ \
+ __trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
+ } else \
+ __trace_printk(_THIS_IP_, fmt, ##args); \
+} while (0)
+
+extern int
+__trace_bprintk(unsigned long ip, const char *fmt, ...)
+ __attribute__ ((format (printf, 2, 3)));
+
+extern int
+__trace_printk(unsigned long ip, const char *fmt, ...)
+ __attribute__ ((format (printf, 2, 3)));
+
+/*
+ * The double __builtin_constant_p is because gcc will give us an error
+ * if we try to allocate the static variable to fmt if it is not a
+ * constant. Even with the outer if statement.
+ */
+#define ftrace_vprintk(fmt, vargs) \
+do { \
+ if (__builtin_constant_p(fmt)) { \
+ static const char *trace_printk_fmt \
+ __attribute__((section("__trace_printk_fmt"))) = \
+ __builtin_constant_p(fmt) ? fmt : NULL; \
+ \
+ __ftrace_vbprintk(_THIS_IP_, trace_printk_fmt, vargs); \
+ } else \
+ __ftrace_vprintk(_THIS_IP_, fmt, vargs); \
+} while (0)
+
+extern int
+__ftrace_vbprintk(unsigned long ip, const char *fmt, va_list ap);
+
+extern int
+__ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);
+
+extern void ftrace_dump(void);
+#else
+static inline void
+ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { }
+static inline int
+trace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
+
+static inline void tracing_start(void) { }
+static inline void tracing_stop(void) { }
+static inline void ftrace_off_permanent(void) { }
+static inline int
+trace_printk(const char *fmt, ...)
+{
+ return 0;
+}
+static inline int
+ftrace_vprintk(const char *fmt, va_list ap)
+{
+ return 0;
+}
+static inline void ftrace_dump(void) { }
+#endif /* CONFIG_TRACING */
+
+#endif /* __KERNEL__ */
+#endif /* _LINUX_LOGGING_H */
--
1.6.3.1.10.g659a0.dirty
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox