Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] [PPPOL2TP] Label unused warning when CONFIG_PROC_FS is not set.
From: David Miller @ 2008-02-06  0:32 UTC (permalink / raw)
  To: jeff; +Cc: ramirose, netdev, linux-kernel, paulus
In-Reply-To: <47A8A95B.4060905@garzik.org>

From: Jeff Garzik <jeff@garzik.org>
Date: Tue, 05 Feb 2008 13:22:19 -0500

> David or Paul, wanna pick this up?

I took it, no worries.

^ permalink raw reply

* Re: [PATCH] [IPV4]: Fix compiler error with CONFIG_PROC_FS=n
From: David Miller @ 2008-02-06  0:34 UTC (permalink / raw)
  To: johfel; +Cc: netdev, den
In-Reply-To: <1202237034.9289.8.camel@localhost>

From: Johann Felix Soden <johfel@gmx.de>
Date: Tue, 05 Feb 2008 19:43:54 +0100

> From: Johann Felix Soden <johfel@users.sourceforge.net>
> 
> Handle CONFIG_PROC_FS=n in net/ipv4/fib_frontend.c because:
> 
> net/ipv4/fib_frontend.c: In function 'fib_net_init':
> net/ipv4/fib_frontend.c:1032: error: implicit declaration of function 'fib_proc_init'
> net/ipv4/fib_frontend.c: In function 'fib_net_exit':
> net/ipv4/fib_frontend.c:1047: error: implicit declaration of function 'fib_proc_exit'
> 
> Signed-off-by: Johann Felix Soden <johfel@users.sourceforge.net>

I'm pretty sure I merged in a change this morning which fixes
this.

BTW, in general we do not put ifdefs into *.c code to fix stuff
like this, instead we add empty implementations into a header
file which is a better place for ifdef tests.

And that's how the patch which was merged handles this problem.

^ permalink raw reply

* Re: [PATCH] Add IPv6 support to TCP SYN cookies
From: Glenn Griffin @ 2008-02-06  1:52 UTC (permalink / raw)
  To: Alan Cox
  Cc: Evgeniy Polyakov, Andi Kleen, Glenn Griffin, netdev, linux-kernel
In-Reply-To: <20080205220510.09258826@core>

I realized an earlier email I sent had an incorrect timestamp and wasn't
associated with the thread, so I thought it would be better to resend.
I apologize if this is duplicated for anyone.

Here is a reworked patch that moves the IPv6 syncookie support out of
the ipv4/syncookies.c file and into it's own ipv6/syncookies.c.  The
same CONFIG options and sysctl variables as ipv4, but this way the code
is isolated to the ipv6 module.


Signed-off-by: Glenn Griffin <ggriffin.kernel@gmail.com>
---
 include/net/tcp.h     |    6 +
 net/ipv6/Makefile     |    1 +
 net/ipv6/syncookies.c |  273 +++++++++++++++++++++++++++++++++++++++++++++++++
 net/ipv6/tcp_ipv6.c   |   77 ++++++++++----
 4 files changed, 335 insertions(+), 22 deletions(-)
 create mode 100644 net/ipv6/syncookies.c

diff --git a/include/net/tcp.h b/include/net/tcp.h
index cb5b033..d7f620c 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -436,6 +436,11 @@ extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
 extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, 
 				     __u16 *mss);
 
+/* From net/ipv6/syncookies.c */
+extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
+extern __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb,
+				     __u16 *mss);
+
 /* tcp_output.c */
 
 extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
@@ -1337,6 +1342,7 @@ extern int tcp_proc_register(struct tcp_seq_afinfo *afinfo);
 extern void tcp_proc_unregister(struct tcp_seq_afinfo *afinfo);
 
 extern struct request_sock_ops tcp_request_sock_ops;
+extern struct request_sock_ops tcp6_request_sock_ops;
 
 extern int tcp_v4_destroy_sock(struct sock *sk);
 
diff --git a/net/ipv6/Makefile b/net/ipv6/Makefile
index 87c23a7..d1a1056 100644
--- a/net/ipv6/Makefile
+++ b/net/ipv6/Makefile
@@ -15,6 +15,7 @@ ipv6-$(CONFIG_XFRM) += xfrm6_policy.o xfrm6_state.o xfrm6_input.o \
 ipv6-$(CONFIG_NETFILTER) += netfilter.o
 ipv6-$(CONFIG_IPV6_MULTIPLE_TABLES) += fib6_rules.o
 ipv6-$(CONFIG_PROC_FS) += proc.o
+ipv6-$(CONFIG_SYN_COOKIES) += syncookies.o
 
 ipv6-objs += $(ipv6-y)
 
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
new file mode 100644
index 0000000..521c9da
--- /dev/null
+++ b/net/ipv6/syncookies.c
@@ -0,0 +1,273 @@
+/*
+ *  IPv6 Syncookies implementation for the Linux kernel
+ *
+ *  Authors:
+ *  Glenn Griffin	<ggriffin.kernel@gmail.com>
+ *
+ *  Based on IPv4 implementation by Andi Kleen
+ *  linux/net/ipv4/syncookies.c
+ *
+ *	This program is free software; you can redistribute it and/or
+ *      modify it under the terms of the GNU General Public License
+ *      as published by the Free Software Foundation; either version
+ *      2 of the License, or (at your option) any later version.
+ *
+ */
+
+#include <linux/tcp.h>
+#include <linux/random.h>
+#include <linux/cryptohash.h>
+#include <linux/kernel.h>
+#include <net/ipv6.h>
+#include <net/tcp.h>
+
+extern int sysctl_tcp_syncookies;
+
+static __u32 syncookie_secret[2][16-10+SHA_DIGEST_WORDS];
+
+static __init int init_syncookies(void)
+{
+	get_random_bytes(syncookie_secret, sizeof(syncookie_secret));
+	return 0;
+}
+module_init(init_syncookies);
+
+#define COOKIEBITS 24	/* Upper bits store count */
+#define COOKIEMASK (((__u32)1 << COOKIEBITS) - 1)
+
+/*
+ * This table has to be sorted and terminated with (__u16)-1.
+ * XXX generate a better table.
+ * Unresolved Issues: HIPPI with a 64k MSS is not well supported.
+ * 
+ * Taken directly from ipv4 implementation. 
+ * Should this list be modified for ipv6 use or is it close enough?
+ * rfc 2460 8.3 suggests mss values 20 bytes less than ipv4 counterpart
+ */
+static __u16 const msstab[] = {
+	64 - 1,
+	256 - 1,
+	512 - 1,
+	536 - 1,
+	1024 - 1,
+	1440 - 1,
+	1460 - 1,
+	4312 - 1,
+	(__u16)-1
+};
+/* The number doesn't include the -1 terminator */
+#define NUM_MSS (ARRAY_SIZE(msstab) - 1)
+
+/*
+ * This (misnamed) value is the age of syncookie which is permitted.
+ * Its ideal value should be dependent on TCP_TIMEOUT_INIT and
+ * sysctl_tcp_retries1. It's a rather complicated formula (exponential
+ * backoff) to compute at runtime so it's currently hardcoded here.
+ */
+#define COUNTER_TRIES 4
+
+static inline struct sock *get_cookie_sock(struct sock *sk, struct sk_buff *skb,
+					   struct request_sock *req,
+					   struct dst_entry *dst)
+{
+	struct inet_connection_sock *icsk = inet_csk(sk);
+	struct sock *child;
+
+	child = icsk->icsk_af_ops->syn_recv_sock(sk, skb, req, dst);
+	if (child)
+		inet_csk_reqsk_queue_add(sk, req, child);
+	else
+		reqsk_free(req);
+
+	return child;
+}
+
+static u32 cookie_hash(struct in6_addr *saddr, struct in6_addr *daddr,
+		       __be16 sport, __be16 dport, u32 count, int c)
+{
+	__u32 tmp[16 + 5 + SHA_WORKSPACE_WORDS];
+
+	/*
+	 * we have 320 bits of information to hash, copy in the remaining
+	 * 192 bits required for sha_transform, from the syncookie_secret
+	 * and overwrite the digest with the secret
+	 */
+	memcpy(tmp + 10, syncookie_secret[c], sizeof(syncookie_secret[c]));
+	memcpy(tmp, saddr, 16);
+	memcpy(tmp + 4, daddr, 16);
+	tmp[8] = ((__force u32)sport << 16) + (__force u32)dport;
+	tmp[9] = count;
+	sha_transform(tmp + 16, (__u8 *)tmp, tmp + 16 + 5);
+
+	return tmp[17];
+}
+
+static __u32 secure_tcp_syn_cookie(struct in6_addr *saddr, struct in6_addr *daddr,
+				   __be16 sport, __be16 dport, __u32 sseq,
+				   __u32 count, __u32 data)
+{
+	return (cookie_hash(saddr, daddr, sport, dport, 0, 0) +
+		sseq + (count << COOKIEBITS) +
+		((cookie_hash(saddr, daddr, sport, dport, count, 1) + data)
+		& COOKIEMASK));
+}
+
+static __u32 check_tcp_syn_cookie(__u32 cookie, struct in6_addr *saddr,
+				  struct in6_addr *daddr, __be16 sport,
+				  __be16 dport, __u32 sseq, __u32 count,
+				  __u32 maxdiff)
+{
+	__u32 diff;
+
+	cookie -= cookie_hash(saddr, daddr, sport, dport, 0, 0) + sseq;
+
+	diff = (count - (cookie >> COOKIEBITS)) & ((__u32) -1 >> COOKIEBITS);
+	if (diff >= maxdiff)
+		return (__u32)-1;
+
+	return (cookie -
+		cookie_hash(saddr, daddr, sport, dport, count - diff, 1))
+		& COOKIEMASK;
+}
+
+__u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb, __u16 *mssp)
+{
+	struct ipv6hdr *iph = ipv6_hdr(skb);
+	const struct tcphdr *th = tcp_hdr(skb);
+	int mssind;
+	const __u16 mss = *mssp;
+
+	tcp_sk(sk)->last_synq_overflow = jiffies;
+
+	for (mssind = 0; mss > msstab[mssind + 1]; mssind++)
+		;
+	*mssp = msstab[mssind] + 1;
+
+	NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESSENT);
+
+	return secure_tcp_syn_cookie(&iph->saddr, &iph->daddr, th->source,
+				     th->dest, ntohl(th->seq),
+				     jiffies / (HZ * 60), mssind);
+}
+
+static inline int cookie_check(struct sk_buff *skb, __u32 cookie)
+{
+	struct ipv6hdr *iph = ipv6_hdr(skb);
+	const struct tcphdr *th = tcp_hdr(skb);
+	__u32 seq = ntohl(th->seq) - 1;
+	__u32 mssind = check_tcp_syn_cookie(cookie, &iph->saddr, &iph->daddr,
+					    th->source, th->dest, seq,
+					    jiffies / (HZ * 60), COUNTER_TRIES);
+
+	return mssind < NUM_MSS ? msstab[mssind] + 1 : 0;
+}
+
+struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
+{
+	struct inet_request_sock *ireq;
+	struct inet6_request_sock *ireq6;
+	struct tcp_request_sock *treq;
+	struct ipv6_pinfo *np = inet6_sk(sk);
+	struct tcp_sock *tp = tcp_sk(sk);
+	const struct tcphdr *th = tcp_hdr(skb);
+	__u32 cookie = ntohl(th->ack_seq) - 1;
+	struct sock *ret = sk;
+	struct request_sock *req;
+	int mss;
+	struct dst_entry *dst;
+	__u8 rcv_wscale;
+
+	if (!sysctl_tcp_syncookies || !th->ack)
+		goto out;
+
+	if (time_after(jiffies, tp->last_synq_overflow + TCP_TIMEOUT_INIT) ||
+		(mss = cookie_check(skb, cookie)) == 0) {
+		NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESFAILED);
+		goto out;
+	}
+
+	NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESRECV);
+
+	ret = NULL;
+	req = inet6_reqsk_alloc(&tcp6_request_sock_ops);
+	if (!req)
+		goto out;
+
+	ireq = inet_rsk(req);
+	ireq6 = inet6_rsk(req);
+	treq = tcp_rsk(req);
+	ireq6->pktopts = NULL;
+
+	if (security_inet_conn_request(sk, skb, req)) {
+		reqsk_free(req);
+		goto out;
+	}
+
+	req->mss = mss;
+	ireq->rmt_port = th->source;
+	ipv6_addr_copy(&ireq6->rmt_addr, &ipv6_hdr(skb)->saddr);
+	ipv6_addr_copy(&ireq6->loc_addr, &ipv6_hdr(skb)->daddr);
+	if (ipv6_opt_accepted(sk, skb) ||
+	    np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo ||
+	    np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) {
+		atomic_inc(&skb->users);
+		ireq6->pktopts = skb;
+	}
+
+	ireq6->iif = sk->sk_bound_dev_if;
+	/* So that link locals have meaning */
+	if (!sk->sk_bound_dev_if &&
+	    ipv6_addr_type(&ireq6->rmt_addr) & IPV6_ADDR_LINKLOCAL)
+		ireq6->iif = inet6_iif(skb);
+
+	req->expires = 0UL;
+	req->retrans = 0;
+	ireq->snd_wscale = ireq->rcv_wscale = ireq->tstamp_ok = 0;
+	ireq->wscale_ok = ireq->sack_ok = 0;
+	treq->rcv_isn = ntohl(th->seq) - 1;
+	treq->snt_isn = cookie;
+
+	/*
+	 * We need to lookup the dst_entry to get the correct window size.
+	 * This is taken from tcp_v6_syn_recv_sock.  Somebody please enlighten
+	 * me if there is a preferred way.
+	 */
+	{
+		struct in6_addr *final_p = NULL, final;
+		struct flowi fl;
+		memset(&fl, 0, sizeof(fl));
+		fl.proto = IPPROTO_TCP;
+		ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr);
+		if (np->opt && np->opt->srcrt) {
+			struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt;
+			ipv6_addr_copy(&final, &fl.fl6_dst);
+			ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
+			final_p = &final;
+		}
+		ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr);
+		fl.oif = sk->sk_bound_dev_if;
+		fl.fl_ip_dport = inet_rsk(req)->rmt_port;
+		fl.fl_ip_sport = inet_sk(sk)->sport;
+		security_req_classify_flow(req, &fl);
+		if (ip6_dst_lookup(sk, &dst, &fl)) {
+			reqsk_free(req);
+			goto out;
+		}
+		if (final_p)
+			ipv6_addr_copy(&fl.fl6_dst, final_p);
+		if ((xfrm_lookup(&dst, &fl, sk, 0)) < 0)
+			goto out;
+	}
+
+	req->window_clamp = dst_metric(dst, RTAX_WINDOW);
+	tcp_select_initial_window(tcp_full_space(sk), req->mss,
+				  &req->rcv_wnd, &req->window_clamp,
+				  0, &rcv_wscale);
+
+	ireq->rcv_wscale = rcv_wscale;
+
+	ret = get_cookie_sock(sk, skb, req, dst);
+
+out:	return ret;
+}
+
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 93980c3..ad39bd1 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -520,6 +520,20 @@ done:
 	return err;
 }
 
+static inline void syn_flood_warning(struct sk_buff *skb)
+{
+#ifdef CONFIG_SYN_COOKIES
+	if (sysctl_tcp_syncookies)
+		printk(KERN_INFO
+		       "TCPv6: Possible SYN flooding on port %d. "
+		       "Sending cookies.\n", ntohs(tcp_hdr(skb)->dest));
+	else
+#endif
+		printk(KERN_INFO
+		       "TCPv6: Possible SYN flooding on port %d. "
+		       "Dropping request.\n", ntohs(tcp_hdr(skb)->dest));
+}
+
 static void tcp_v6_reqsk_destructor(struct request_sock *req)
 {
 	if (inet6_rsk(req)->pktopts)
@@ -923,7 +937,7 @@ done_opts:
 }
 #endif
 
-static struct request_sock_ops tcp6_request_sock_ops __read_mostly = {
+struct request_sock_ops tcp6_request_sock_ops __read_mostly = {
 	.family		=	AF_INET6,
 	.obj_size	=	sizeof(struct tcp6_request_sock),
 	.rtx_syn_ack	=	tcp_v6_send_synack,
@@ -1221,9 +1235,9 @@ static struct sock *tcp_v6_hnd_req(struct sock *sk,struct sk_buff *skb)
 		return NULL;
 	}
 
-#if 0 /*def CONFIG_SYN_COOKIES*/
+#ifdef CONFIG_SYN_COOKIES
 	if (!th->rst && !th->syn && th->ack)
-		sk = cookie_v6_check(sk, skb, &(IPCB(skb)->opt));
+		sk = cookie_v6_check(sk, skb);
 #endif
 	return sk;
 }
@@ -1239,6 +1253,11 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
 	struct tcp_sock *tp = tcp_sk(sk);
 	struct request_sock *req = NULL;
 	__u32 isn = TCP_SKB_CB(skb)->when;
+#ifdef CONFIG_SYN_COOKIES
+	int want_cookie = 0;
+#else
+#define want_cookie 0
+#endif
 
 	if (skb->protocol == htons(ETH_P_IP))
 		return tcp_v4_conn_request(sk, skb);
@@ -1246,12 +1265,14 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
 	if (!ipv6_unicast_destination(skb))
 		goto drop;
 
-	/*
-	 *	There are no SYN attacks on IPv6, yet...
-	 */
 	if (inet_csk_reqsk_queue_is_full(sk) && !isn) {
 		if (net_ratelimit())
-			printk(KERN_INFO "TCPv6: dropping request, synflood is possible\n");
+			syn_flood_warning(skb);
+#ifdef CONFIG_SYN_COOKIES
+		if (sysctl_tcp_syncookies)
+			want_cookie = 1;
+		else
+#endif
 		goto drop;
 	}
 
@@ -1272,29 +1293,39 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
 
 	tcp_parse_options(skb, &tmp_opt, 0);
 
+	if (want_cookie) {
+		tcp_clear_options(&tmp_opt);
+		tmp_opt.saw_tstamp = 0;
+	}
+
 	tmp_opt.tstamp_ok = tmp_opt.saw_tstamp;
 	tcp_openreq_init(req, &tmp_opt, skb);
 
 	treq = inet6_rsk(req);
 	ipv6_addr_copy(&treq->rmt_addr, &ipv6_hdr(skb)->saddr);
 	ipv6_addr_copy(&treq->loc_addr, &ipv6_hdr(skb)->daddr);
-	TCP_ECN_create_request(req, tcp_hdr(skb));
 	treq->pktopts = NULL;
-	if (ipv6_opt_accepted(sk, skb) ||
-	    np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo ||
-	    np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) {
-		atomic_inc(&skb->users);
-		treq->pktopts = skb;
-	}
-	treq->iif = sk->sk_bound_dev_if;
+	if (!want_cookie)
+		TCP_ECN_create_request(req, tcp_hdr(skb));
+
+	if (want_cookie) {
+		isn = cookie_v6_init_sequence(sk, skb, &req->mss);
+	} else if (!isn) {
+		if (ipv6_opt_accepted(sk, skb) ||
+		    np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo ||
+		    np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) {
+			atomic_inc(&skb->users);
+			treq->pktopts = skb;
+		}
+		treq->iif = sk->sk_bound_dev_if;
 
-	/* So that link locals have meaning */
-	if (!sk->sk_bound_dev_if &&
-	    ipv6_addr_type(&treq->rmt_addr) & IPV6_ADDR_LINKLOCAL)
-		treq->iif = inet6_iif(skb);
+		/* So that link locals have meaning */
+		if (!sk->sk_bound_dev_if &&
+		    ipv6_addr_type(&treq->rmt_addr) & IPV6_ADDR_LINKLOCAL)
+			treq->iif = inet6_iif(skb);
 
-	if (isn == 0)
 		isn = tcp_v6_init_sequence(skb);
+	}
 
 	tcp_rsk(req)->snt_isn = isn;
 
@@ -1303,8 +1334,10 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
 	if (tcp_v6_send_synack(sk, req, NULL))
 		goto drop;
 
-	inet6_csk_reqsk_queue_hash_add(sk, req, TCP_TIMEOUT_INIT);
-	return 0;
+	if (!want_cookie) {
+		inet6_csk_reqsk_queue_hash_add(sk, req, TCP_TIMEOUT_INIT);
+		return 0;
+	}
 
 drop:
 	if (req)
-- 
1.5.3.4


^ permalink raw reply related

* Re: [PATCH 1/2] Remove unnecessary locks from rtnetlink
From: David Miller @ 2008-02-06  1:53 UTC (permalink / raw)
  To: panther; +Cc: netdev
In-Reply-To: <12018820542721-git-send-email-panther@balabit.hu>

From: Laszlo Attila Toth <panther@balabit.hu>
Date: Fri,  1 Feb 2008 17:07:33 +0100

> The do_setlink() function is protected by rtnl, additional locks are unnecessary.
> and the set_operstate() function is called from protected parts. Locks removed
> from both functions.
> 
> The set_operstate() is also called from rtnl_create_link() and from no other places.
> In rtnl_create_link() none of the changes is protected by set_lock_bh() except
> inside set_operstate(), different locking scheme is not necessary
> for the operstate.
> 
> Signed-off-by: Laszlo Attila Toth <panther@balabit.hu>

The protection using dev_base_lock() is needed.

When analyzing cases like this you need to also look at other code
paths outside of rtnetlink that access ->operstate and ->link_mode,
you obviously didn't do this.

For example, net/core/net-sysfs.c takes a read lock on dev_base_lock
in order to fetch a stable copy of both netif_running() and
dev->operstate at the same time.

Similar write locking to protect dev->operstate is made by
net/core/link_watch.c:rfc2863_policy(), for the same reason rtnetlink
has to make this locking.

You therefore cannot remove it.

This invalidates your second patch so I'm dropping that as well.

^ permalink raw reply

* Re: [patch 2/4] forcedeth: fix MAC address detection on network card (regression in 2.6.23)  
From: Michael Pyne @ 2008-02-06  2:06 UTC (permalink / raw)
  To: Ayaz Abdulla; +Cc: Jeff Garzik, Andrew Morton, netdev, michael.pyne, LKML
In-Reply-To: <47A751F6.3030007@nvidia.com>

[-- Attachment #1: Type: text/plain, Size: 1163 bytes --]

On Monday 04 February 2008, Ayaz Abdulla wrote:
> Jeff Garzik wrote:
> > Ayaz Abdulla wrote:
> >> I believe Michael determined that a newer BIOS fixes this issue.
> >
> > That's a solution that makes vendors happy... but we still have to deal
> > with it in Linux.  There are plenty of the old broken BIOS still out in
> > the field...
> >
> >     Jeff
>
> Michael, can you provide which BIOS version had this issue and which
> version fixed the issue?

Ayaz,

One of my earlier messages to the list was from BIOS revision F3 from what I 
can tell (which matches pretty well with what I remember having).  I am 
currently on F8.

I may go back to F3 if I can get booting from USB to work just to verify 
because I could have sworn it was still broken after going to F8.  But since 
unpatched Linux 2.6.23.12 apparently works fine and I'm not sure when exactly 
that happened (I use Ketchup to maintain the sources and somewhere it 
unpatched my forcedeth.c :) I want to double-check that a simple BIOS upgrade 
will solve it.

But I also don't have a lot of time before I go underway for a few months. :-/

Regards,
 - Michael Pyne

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: [PATCH] ipvs: Make wrr "no available servers" error message rate-limited
From: Simon Horman @ 2008-02-06  2:19 UTC (permalink / raw)
  To: Sven Wegener; +Cc: netdev, linux-kernel
In-Reply-To: <1202243421-2774-1-git-send-email-sven.wegener@stealer.net>

On Tue, Feb 05, 2008 at 09:30:21PM +0100, Sven Wegener wrote:
> No available servers is more an error message than something informational. It
> should also be rate-limited, else we're going to flood our logs on a busy
> director, if all real servers are out of order with a weight of zero.
> 
> Signed-off-by: Sven Wegener <sven.wegener@stealer.net>

Hi Sven,

this looks good to me.

Acked-by: Simon Horman <horms@verge.net.au>

> ---
> 
> Actually, do we need this message at all? The wrr scheduler is the only one
> printing an error message in such a case.

I was wondering about that too. Though I'd err on the side of adding
it to the other schedulers as neccessary rather than removing it here.
But if you'd rather just get rid of it, I have no strong objections.

-- 
Horms


^ permalink raw reply

* pull request: wireless-2.6 'fixes' 2008-02-05
From: John W. Linville @ 2008-02-06  2:59 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA

Dave,

Some fixes intended for 2.6.25, especially some ports to b43legacy of
some b43 fixes that are already merged.  Please let me know if there are
problems.

Thanks!

John

---

Individual patches are available here:

	http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/fixes

---

The following changes since commit 9ef9dc69d4167276c04590d67ee55de8380bc1ad:
  Linus Torvalds (1):
        Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git fixes

Adrian Bunk (1):
      iwl3945-base.c: fix off-by-one errors

Andrew Morton (1):
      b43: fix build with CONFIG_SSB_PCIHOST=n

Michael Buesch (2):
      mac80211: Is not EXPERIMENTAL anymore
      b43: Fix DMA for 30/32-bit DMA engines

Stefano Brivio (4):
      b43legacy: fix PIO crash
      b43legacy: fix suspend/resume
      b43legacy: drop packets we are not able to encrypt
      b43legacy: fix DMA slot resource leakage

 drivers/net/wireless/b43/dma.c              |  137 ++++++++++++++++++---------
 drivers/net/wireless/b43/dma.h              |   20 ++--
 drivers/net/wireless/b43legacy/dma.c        |   23 ++++-
 drivers/net/wireless/b43legacy/main.c       |    9 ++-
 drivers/net/wireless/b43legacy/pio.c        |   21 ++++-
 drivers/net/wireless/b43legacy/xmit.c       |   15 +++-
 drivers/net/wireless/b43legacy/xmit.h       |    2 +-
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    8 +-
 include/linux/ssb/ssb.h                     |    9 ++
 net/mac80211/Kconfig                        |    1 -
 10 files changed, 171 insertions(+), 74 deletions(-)

diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index 8a708b7..3dfb28a 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -337,7 +337,7 @@ static inline int txring_to_priority(struct b43_dmaring *ring)
 	return idx_to_prio[index];
 }
 
-u16 b43_dmacontroller_base(int dma64bit, int controller_idx)
+static u16 b43_dmacontroller_base(enum b43_dmatype type, int controller_idx)
 {
 	static const u16 map64[] = {
 		B43_MMIO_DMA64_BASE0,
@@ -356,7 +356,7 @@ u16 b43_dmacontroller_base(int dma64bit, int controller_idx)
 		B43_MMIO_DMA32_BASE5,
 	};
 
-	if (dma64bit) {
+	if (type == B43_DMA_64BIT) {
 		B43_WARN_ON(!(controller_idx >= 0 &&
 			      controller_idx < ARRAY_SIZE(map64)));
 		return map64[controller_idx];
@@ -437,7 +437,7 @@ static int alloc_ringmemory(struct b43_dmaring *ring)
 	 * 02, which uses 64-bit DMA, needs the ring buffer in very low memory,
 	 * which accounts for the GFP_DMA flag below.
 	 */
-	if (ring->dma64)
+	if (ring->type == B43_DMA_64BIT)
 		flags |= GFP_DMA;
 	ring->descbase = dma_alloc_coherent(dev, B43_DMA_RINGMEMSIZE,
 					    &(ring->dmabase), flags);
@@ -459,7 +459,8 @@ static void free_ringmemory(struct b43_dmaring *ring)
 }
 
 /* Reset the RX DMA channel */
-int b43_dmacontroller_rx_reset(struct b43_wldev *dev, u16 mmio_base, int dma64)
+static int b43_dmacontroller_rx_reset(struct b43_wldev *dev, u16 mmio_base,
+				      enum b43_dmatype type)
 {
 	int i;
 	u32 value;
@@ -467,12 +468,13 @@ int b43_dmacontroller_rx_reset(struct b43_wldev *dev, u16 mmio_base, int dma64)
 
 	might_sleep();
 
-	offset = dma64 ? B43_DMA64_RXCTL : B43_DMA32_RXCTL;
+	offset = (type == B43_DMA_64BIT) ? B43_DMA64_RXCTL : B43_DMA32_RXCTL;
 	b43_write32(dev, mmio_base + offset, 0);
 	for (i = 0; i < 10; i++) {
-		offset = dma64 ? B43_DMA64_RXSTATUS : B43_DMA32_RXSTATUS;
+		offset = (type == B43_DMA_64BIT) ? B43_DMA64_RXSTATUS :
+						   B43_DMA32_RXSTATUS;
 		value = b43_read32(dev, mmio_base + offset);
-		if (dma64) {
+		if (type == B43_DMA_64BIT) {
 			value &= B43_DMA64_RXSTAT;
 			if (value == B43_DMA64_RXSTAT_DISABLED) {
 				i = -1;
@@ -496,7 +498,8 @@ int b43_dmacontroller_rx_reset(struct b43_wldev *dev, u16 mmio_base, int dma64)
 }
 
 /* Reset the TX DMA channel */
-int b43_dmacontroller_tx_reset(struct b43_wldev *dev, u16 mmio_base, int dma64)
+static int b43_dmacontroller_tx_reset(struct b43_wldev *dev, u16 mmio_base,
+				      enum b43_dmatype type)
 {
 	int i;
 	u32 value;
@@ -505,9 +508,10 @@ int b43_dmacontroller_tx_reset(struct b43_wldev *dev, u16 mmio_base, int dma64)
 	might_sleep();
 
 	for (i = 0; i < 10; i++) {
-		offset = dma64 ? B43_DMA64_TXSTATUS : B43_DMA32_TXSTATUS;
+		offset = (type == B43_DMA_64BIT) ? B43_DMA64_TXSTATUS :
+						   B43_DMA32_TXSTATUS;
 		value = b43_read32(dev, mmio_base + offset);
-		if (dma64) {
+		if (type == B43_DMA_64BIT) {
 			value &= B43_DMA64_TXSTAT;
 			if (value == B43_DMA64_TXSTAT_DISABLED ||
 			    value == B43_DMA64_TXSTAT_IDLEWAIT ||
@@ -522,12 +526,13 @@ int b43_dmacontroller_tx_reset(struct b43_wldev *dev, u16 mmio_base, int dma64)
 		}
 		msleep(1);
 	}
-	offset = dma64 ? B43_DMA64_TXCTL : B43_DMA32_TXCTL;
+	offset = (type == B43_DMA_64BIT) ? B43_DMA64_TXCTL : B43_DMA32_TXCTL;
 	b43_write32(dev, mmio_base + offset, 0);
 	for (i = 0; i < 10; i++) {
-		offset = dma64 ? B43_DMA64_TXSTATUS : B43_DMA32_TXSTATUS;
+		offset = (type == B43_DMA_64BIT) ? B43_DMA64_TXSTATUS :
+						   B43_DMA32_TXSTATUS;
 		value = b43_read32(dev, mmio_base + offset);
-		if (dma64) {
+		if (type == B43_DMA_64BIT) {
 			value &= B43_DMA64_TXSTAT;
 			if (value == B43_DMA64_TXSTAT_DISABLED) {
 				i = -1;
@@ -552,6 +557,33 @@ int b43_dmacontroller_tx_reset(struct b43_wldev *dev, u16 mmio_base, int dma64)
 	return 0;
 }
 
+/* Check if a DMA mapping address is invalid. */
+static bool b43_dma_mapping_error(struct b43_dmaring *ring,
+				  dma_addr_t addr,
+				  size_t buffersize)
+{
+	if (unlikely(dma_mapping_error(addr)))
+		return 1;
+
+	switch (ring->type) {
+	case B43_DMA_30BIT:
+		if ((u64)addr + buffersize > (1ULL << 30))
+			return 1;
+		break;
+	case B43_DMA_32BIT:
+		if ((u64)addr + buffersize > (1ULL << 32))
+			return 1;
+		break;
+	case B43_DMA_64BIT:
+		/* Currently we can't have addresses beyond
+		 * 64bit in the kernel. */
+		break;
+	}
+
+	/* The address is OK. */
+	return 0;
+}
+
 static int setup_rx_descbuffer(struct b43_dmaring *ring,
 			       struct b43_dmadesc_generic *desc,
 			       struct b43_dmadesc_meta *meta, gfp_t gfp_flags)
@@ -567,7 +599,7 @@ static int setup_rx_descbuffer(struct b43_dmaring *ring,
 	if (unlikely(!skb))
 		return -ENOMEM;
 	dmaaddr = map_descbuffer(ring, skb->data, ring->rx_buffersize, 0);
-	if (dma_mapping_error(dmaaddr)) {
+	if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize)) {
 		/* ugh. try to realloc in zone_dma */
 		gfp_flags |= GFP_DMA;
 
@@ -580,7 +612,7 @@ static int setup_rx_descbuffer(struct b43_dmaring *ring,
 					 ring->rx_buffersize, 0);
 	}
 
-	if (dma_mapping_error(dmaaddr)) {
+	if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize)) {
 		dev_kfree_skb_any(skb);
 		return -EIO;
 	}
@@ -645,7 +677,7 @@ static int dmacontroller_setup(struct b43_dmaring *ring)
 	u32 trans = ssb_dma_translation(ring->dev->dev);
 
 	if (ring->tx) {
-		if (ring->dma64) {
+		if (ring->type == B43_DMA_64BIT) {
 			u64 ringbase = (u64) (ring->dmabase);
 
 			addrext = ((ringbase >> 32) & SSB_DMA_TRANSLATION_MASK)
@@ -677,7 +709,7 @@ static int dmacontroller_setup(struct b43_dmaring *ring)
 		err = alloc_initial_descbuffers(ring);
 		if (err)
 			goto out;
-		if (ring->dma64) {
+		if (ring->type == B43_DMA_64BIT) {
 			u64 ringbase = (u64) (ring->dmabase);
 
 			addrext = ((ringbase >> 32) & SSB_DMA_TRANSLATION_MASK)
@@ -722,16 +754,16 @@ static void dmacontroller_cleanup(struct b43_dmaring *ring)
 {
 	if (ring->tx) {
 		b43_dmacontroller_tx_reset(ring->dev, ring->mmio_base,
-					   ring->dma64);
-		if (ring->dma64) {
+					   ring->type);
+		if (ring->type == B43_DMA_64BIT) {
 			b43_dma_write(ring, B43_DMA64_TXRINGLO, 0);
 			b43_dma_write(ring, B43_DMA64_TXRINGHI, 0);
 		} else
 			b43_dma_write(ring, B43_DMA32_TXRING, 0);
 	} else {
 		b43_dmacontroller_rx_reset(ring->dev, ring->mmio_base,
-					   ring->dma64);
-		if (ring->dma64) {
+					   ring->type);
+		if (ring->type == B43_DMA_64BIT) {
 			b43_dma_write(ring, B43_DMA64_RXRINGLO, 0);
 			b43_dma_write(ring, B43_DMA64_RXRINGHI, 0);
 		} else
@@ -786,7 +818,8 @@ static u64 supported_dma_mask(struct b43_wldev *dev)
 static
 struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
 				      int controller_index,
-				      int for_tx, int dma64)
+				      int for_tx,
+				      enum b43_dmatype type)
 {
 	struct b43_dmaring *ring;
 	int err;
@@ -796,6 +829,7 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
 	ring = kzalloc(sizeof(*ring), GFP_KERNEL);
 	if (!ring)
 		goto out;
+	ring->type = type;
 
 	nr_slots = B43_RXRING_SLOTS;
 	if (for_tx)
@@ -818,7 +852,7 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
 					  b43_txhdr_size(dev),
 					  DMA_TO_DEVICE);
 
-		if (dma_mapping_error(dma_test)) {
+		if (b43_dma_mapping_error(ring, dma_test, b43_txhdr_size(dev))) {
 			/* ugh realloc */
 			kfree(ring->txhdr_cache);
 			ring->txhdr_cache = kcalloc(nr_slots,
@@ -832,7 +866,8 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
 						  b43_txhdr_size(dev),
 						  DMA_TO_DEVICE);
 
-			if (dma_mapping_error(dma_test))
+			if (b43_dma_mapping_error(ring, dma_test,
+						  b43_txhdr_size(dev)))
 				goto err_kfree_txhdr_cache;
 		}
 
@@ -843,10 +878,9 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
 
 	ring->dev = dev;
 	ring->nr_slots = nr_slots;
-	ring->mmio_base = b43_dmacontroller_base(dma64, controller_index);
+	ring->mmio_base = b43_dmacontroller_base(type, controller_index);
 	ring->index = controller_index;
-	ring->dma64 = !!dma64;
-	if (dma64)
+	if (type == B43_DMA_64BIT)
 		ring->ops = &dma64_ops;
 	else
 		ring->ops = &dma32_ops;
@@ -896,8 +930,8 @@ static void b43_destroy_dmaring(struct b43_dmaring *ring)
 	if (!ring)
 		return;
 
-	b43dbg(ring->dev->wl, "DMA-%s 0x%04X (%s) max used slots: %d/%d\n",
-	       (ring->dma64) ? "64" : "32",
+	b43dbg(ring->dev->wl, "DMA-%u 0x%04X (%s) max used slots: %d/%d\n",
+	       (unsigned int)(ring->type),
 	       ring->mmio_base,
 	       (ring->tx) ? "TX" : "RX", ring->max_used_slots, ring->nr_slots);
 	/* Device IRQs are disabled prior entering this function,
@@ -941,12 +975,22 @@ int b43_dma_init(struct b43_wldev *dev)
 	struct b43_dmaring *ring;
 	int err;
 	u64 dmamask;
-	int dma64 = 0;
+	enum b43_dmatype type;
 
 	dmamask = supported_dma_mask(dev);
-	if (dmamask == DMA_64BIT_MASK)
-		dma64 = 1;
-
+	switch (dmamask) {
+	default:
+		B43_WARN_ON(1);
+	case DMA_30BIT_MASK:
+		type = B43_DMA_30BIT;
+		break;
+	case DMA_32BIT_MASK:
+		type = B43_DMA_32BIT;
+		break;
+	case DMA_64BIT_MASK:
+		type = B43_DMA_64BIT;
+		break;
+	}
 	err = ssb_dma_set_mask(dev->dev, dmamask);
 	if (err) {
 		b43err(dev->wl, "The machine/kernel does not support "
@@ -958,52 +1002,51 @@ int b43_dma_init(struct b43_wldev *dev)
 
 	err = -ENOMEM;
 	/* setup TX DMA channels. */
-	ring = b43_setup_dmaring(dev, 0, 1, dma64);
+	ring = b43_setup_dmaring(dev, 0, 1, type);
 	if (!ring)
 		goto out;
 	dma->tx_ring0 = ring;
 
-	ring = b43_setup_dmaring(dev, 1, 1, dma64);
+	ring = b43_setup_dmaring(dev, 1, 1, type);
 	if (!ring)
 		goto err_destroy_tx0;
 	dma->tx_ring1 = ring;
 
-	ring = b43_setup_dmaring(dev, 2, 1, dma64);
+	ring = b43_setup_dmaring(dev, 2, 1, type);
 	if (!ring)
 		goto err_destroy_tx1;
 	dma->tx_ring2 = ring;
 
-	ring = b43_setup_dmaring(dev, 3, 1, dma64);
+	ring = b43_setup_dmaring(dev, 3, 1, type);
 	if (!ring)
 		goto err_destroy_tx2;
 	dma->tx_ring3 = ring;
 
-	ring = b43_setup_dmaring(dev, 4, 1, dma64);
+	ring = b43_setup_dmaring(dev, 4, 1, type);
 	if (!ring)
 		goto err_destroy_tx3;
 	dma->tx_ring4 = ring;
 
-	ring = b43_setup_dmaring(dev, 5, 1, dma64);
+	ring = b43_setup_dmaring(dev, 5, 1, type);
 	if (!ring)
 		goto err_destroy_tx4;
 	dma->tx_ring5 = ring;
 
 	/* setup RX DMA channels. */
-	ring = b43_setup_dmaring(dev, 0, 0, dma64);
+	ring = b43_setup_dmaring(dev, 0, 0, type);
 	if (!ring)
 		goto err_destroy_tx5;
 	dma->rx_ring0 = ring;
 
 	if (dev->dev->id.revision < 5) {
-		ring = b43_setup_dmaring(dev, 3, 0, dma64);
+		ring = b43_setup_dmaring(dev, 3, 0, type);
 		if (!ring)
 			goto err_destroy_rx0;
 		dma->rx_ring3 = ring;
 	}
 
-	b43dbg(dev->wl, "%d-bit DMA initialized\n",
-	       (dmamask == DMA_64BIT_MASK) ? 64 :
-	       (dmamask == DMA_32BIT_MASK) ? 32 : 30);
+	b43dbg(dev->wl, "%u-bit DMA initialized\n",
+	       (unsigned int)type);
 	err = 0;
       out:
 	return err;
@@ -1146,7 +1189,7 @@ static int dma_tx_fragment(struct b43_dmaring *ring,
 
 	meta_hdr->dmaaddr = map_descbuffer(ring, (unsigned char *)header,
 					   hdrsize, 1);
-	if (dma_mapping_error(meta_hdr->dmaaddr)) {
+	if (b43_dma_mapping_error(ring, meta_hdr->dmaaddr, hdrsize)) {
 		ring->current_slot = old_top_slot;
 		ring->used_slots = old_used_slots;
 		return -EIO;
@@ -1165,7 +1208,7 @@ static int dma_tx_fragment(struct b43_dmaring *ring,
 
 	meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
 	/* create a bounce buffer in zone_dma on mapping failure. */
-	if (dma_mapping_error(meta->dmaaddr)) {
+	if (b43_dma_mapping_error(ring, meta->dmaaddr, skb->len)) {
 		bounce_skb = __dev_alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA);
 		if (!bounce_skb) {
 			ring->current_slot = old_top_slot;
@@ -1179,7 +1222,7 @@ static int dma_tx_fragment(struct b43_dmaring *ring,
 		skb = bounce_skb;
 		meta->skb = skb;
 		meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
-		if (dma_mapping_error(meta->dmaaddr)) {
+		if (b43_dma_mapping_error(ring, meta->dmaaddr, skb->len)) {
 			ring->current_slot = old_top_slot;
 			ring->used_slots = old_used_slots;
 			err = -EIO;
diff --git a/drivers/net/wireless/b43/dma.h b/drivers/net/wireless/b43/dma.h
index 58db03a..c0d6b69 100644
--- a/drivers/net/wireless/b43/dma.h
+++ b/drivers/net/wireless/b43/dma.h
@@ -203,6 +203,12 @@ struct b43_dma_ops {
 	void (*set_current_rxslot) (struct b43_dmaring * ring, int slot);
 };
 
+enum b43_dmatype {
+	B43_DMA_30BIT	= 30,
+	B43_DMA_32BIT	= 32,
+	B43_DMA_64BIT	= 64,
+};
+
 struct b43_dmaring {
 	/* Lowlevel DMA ops. */
 	const struct b43_dma_ops *ops;
@@ -235,8 +241,8 @@ struct b43_dmaring {
 	int index;
 	/* Boolean. Is this a TX ring? */
 	bool tx;
-	/* Boolean. 64bit DMA if true, 32bit DMA otherwise. */
-	bool dma64;
+	/* The type of DMA engine used. */
+	enum b43_dmatype type;
 	/* Boolean. Is this ring stopped at ieee80211 level? */
 	bool stopped;
 	/* Lock, only used for TX. */
@@ -255,8 +261,7 @@ static inline u32 b43_dma_read(struct b43_dmaring *ring, u16 offset)
 	return b43_read32(ring->dev, ring->mmio_base + offset);
 }
 
-static inline
-    void b43_dma_write(struct b43_dmaring *ring, u16 offset, u32 value)
+static inline void b43_dma_write(struct b43_dmaring *ring, u16 offset, u32 value)
 {
 	b43_write32(ring->dev, ring->mmio_base + offset, value);
 }
@@ -264,13 +269,6 @@ static inline
 int b43_dma_init(struct b43_wldev *dev);
 void b43_dma_free(struct b43_wldev *dev);
 
-int b43_dmacontroller_rx_reset(struct b43_wldev *dev,
-			       u16 dmacontroller_mmio_base, int dma64);
-int b43_dmacontroller_tx_reset(struct b43_wldev *dev,
-			       u16 dmacontroller_mmio_base, int dma64);
-
-u16 b43_dmacontroller_base(int dma64bit, int dmacontroller_idx);
-
 void b43_dma_tx_suspend(struct b43_wldev *dev);
 void b43_dma_tx_resume(struct b43_wldev *dev);
 
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c
index 83161d9..6e08405 100644
--- a/drivers/net/wireless/b43legacy/dma.c
+++ b/drivers/net/wireless/b43legacy/dma.c
@@ -1164,7 +1164,7 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring,
 {
 	const struct b43legacy_dma_ops *ops = ring->ops;
 	u8 *header;
-	int slot;
+	int slot, old_top_slot, old_used_slots;
 	int err;
 	struct b43legacy_dmadesc_generic *desc;
 	struct b43legacy_dmadesc_meta *meta;
@@ -1174,6 +1174,9 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring,
 #define SLOTS_PER_PACKET  2
 	B43legacy_WARN_ON(skb_shinfo(skb)->nr_frags != 0);
 
+	old_top_slot = ring->current_slot;
+	old_used_slots = ring->used_slots;
+
 	/* Get a slot for the header. */
 	slot = request_slot(ring);
 	desc = ops->idx2desc(ring, slot, &meta_hdr);
@@ -1181,9 +1184,14 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring,
 
 	header = &(ring->txhdr_cache[slot * sizeof(
 			       struct b43legacy_txhdr_fw3)]);
-	b43legacy_generate_txhdr(ring->dev, header,
+	err = b43legacy_generate_txhdr(ring->dev, header,
 				 skb->data, skb->len, ctl,
 				 generate_cookie(ring, slot));
+	if (unlikely(err)) {
+		ring->current_slot = old_top_slot;
+		ring->used_slots = old_used_slots;
+		return err;
+	}
 
 	meta_hdr->dmaaddr = map_descbuffer(ring, (unsigned char *)header,
 				       sizeof(struct b43legacy_txhdr_fw3), 1);
@@ -1206,6 +1214,8 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring,
 	if (dma_mapping_error(meta->dmaaddr)) {
 		bounce_skb = __dev_alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA);
 		if (!bounce_skb) {
+			ring->current_slot = old_top_slot;
+			ring->used_slots = old_used_slots;
 			err = -ENOMEM;
 			goto out_unmap_hdr;
 		}
@@ -1216,6 +1226,8 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring,
 		meta->skb = skb;
 		meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
 		if (dma_mapping_error(meta->dmaaddr)) {
+			ring->current_slot = old_top_slot;
+			ring->used_slots = old_used_slots;
 			err = -EIO;
 			goto out_free_bounce;
 		}
@@ -1282,6 +1294,13 @@ int b43legacy_dma_tx(struct b43legacy_wldev *dev,
 	B43legacy_BUG_ON(ring->stopped);
 
 	err = dma_tx_fragment(ring, skb, ctl);
+	if (unlikely(err == -ENOKEY)) {
+		/* Drop this packet, as we don't have the encryption key
+		 * anymore and must not transmit it unencrypted. */
+		dev_kfree_skb_any(skb);
+		err = 0;
+		goto out_unlock;
+	}
 	if (unlikely(err)) {
 		b43legacyerr(dev->wl, "DMA tx mapping failure\n");
 		goto out_unlock;
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index aa20d5d..53f7f2e 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -3160,8 +3160,6 @@ static int b43legacy_wireless_core_init(struct b43legacy_wldev *dev)
 	b43legacy_shm_write16(dev, B43legacy_SHM_SHARED, 0x0414, 0x01F4);
 
 	ssb_bus_powerup(bus, 1); /* Enable dynamic PCTL */
-	memset(wl->bssid, 0, ETH_ALEN);
-	memset(wl->mac_addr, 0, ETH_ALEN);
 	b43legacy_upload_card_macaddress(dev);
 	b43legacy_security_init(dev);
 	b43legacy_rng_init(wl);
@@ -3263,6 +3261,13 @@ static int b43legacy_op_start(struct ieee80211_hw *hw)
 	 * LEDs that are registered later depend on it. */
 	b43legacy_rfkill_init(dev);
 
+	/* Kill all old instance specific information to make sure
+	 * the card won't use it in the short timeframe between start
+	 * and mac80211 reconfiguring it. */
+	memset(wl->bssid, 0, ETH_ALEN);
+	memset(wl->mac_addr, 0, ETH_ALEN);
+	wl->filter_flags = 0;
+
 	mutex_lock(&wl->mutex);
 
 	if (b43legacy_status(dev) < B43legacy_STAT_INITIALIZED) {
diff --git a/drivers/net/wireless/b43legacy/pio.c b/drivers/net/wireless/b43legacy/pio.c
index e4f4c5c..bcdd54e 100644
--- a/drivers/net/wireless/b43legacy/pio.c
+++ b/drivers/net/wireless/b43legacy/pio.c
@@ -181,7 +181,7 @@ union txhdr_union {
 	struct b43legacy_txhdr_fw3 txhdr_fw3;
 };
 
-static void pio_tx_write_fragment(struct b43legacy_pioqueue *queue,
+static int pio_tx_write_fragment(struct b43legacy_pioqueue *queue,
 				  struct sk_buff *skb,
 				  struct b43legacy_pio_txpacket *packet,
 				  size_t txhdr_size)
@@ -189,14 +189,17 @@ static void pio_tx_write_fragment(struct b43legacy_pioqueue *queue,
 	union txhdr_union txhdr_data;
 	u8 *txhdr = NULL;
 	unsigned int octets;
+	int err;
 
 	txhdr = (u8 *)(&txhdr_data.txhdr_fw3);
 
 	B43legacy_WARN_ON(skb_shinfo(skb)->nr_frags != 0);
-	b43legacy_generate_txhdr(queue->dev,
+	err = b43legacy_generate_txhdr(queue->dev,
 				 txhdr, skb->data, skb->len,
 				 &packet->txstat.control,
 				 generate_cookie(queue, packet));
+	if (err)
+		return err;
 
 	tx_start(queue);
 	octets = skb->len + txhdr_size;
@@ -204,6 +207,8 @@ static void pio_tx_write_fragment(struct b43legacy_pioqueue *queue,
 		octets--;
 	tx_data(queue, txhdr, (u8 *)skb->data, octets);
 	tx_complete(queue, skb);
+
+	return 0;
 }
 
 static void free_txpacket(struct b43legacy_pio_txpacket *packet,
@@ -226,6 +231,7 @@ static int pio_tx_packet(struct b43legacy_pio_txpacket *packet)
 	struct b43legacy_pioqueue *queue = packet->queue;
 	struct sk_buff *skb = packet->skb;
 	u16 octets;
+	int err;
 
 	octets = (u16)skb->len + sizeof(struct b43legacy_txhdr_fw3);
 	if (queue->tx_devq_size < octets) {
@@ -247,8 +253,14 @@ static int pio_tx_packet(struct b43legacy_pio_txpacket *packet)
 	if (queue->tx_devq_used + octets > queue->tx_devq_size)
 		return -EBUSY;
 	/* Now poke the device. */
-	pio_tx_write_fragment(queue, skb, packet,
+	err = pio_tx_write_fragment(queue, skb, packet,
 			      sizeof(struct b43legacy_txhdr_fw3));
+	if (unlikely(err == -ENOKEY)) {
+		/* Drop this packet, as we don't have the encryption key
+		 * anymore and must not transmit it unencrypted. */
+		free_txpacket(packet, 1);
+		return 0;
+	}
 
 	/* Account for the packet size.
 	 * (We must not overflow the device TX queue)
@@ -486,6 +498,9 @@ void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev,
 	queue = parse_cookie(dev, status->cookie, &packet);
 	B43legacy_WARN_ON(!queue);
 
+	if (!packet->skb)
+		return;
+
 	queue->tx_devq_packets--;
 	queue->tx_devq_used -= (packet->skb->len +
 				sizeof(struct b43legacy_txhdr_fw3));
diff --git a/drivers/net/wireless/b43legacy/xmit.c b/drivers/net/wireless/b43legacy/xmit.c
index e20c552..d84408a 100644
--- a/drivers/net/wireless/b43legacy/xmit.c
+++ b/drivers/net/wireless/b43legacy/xmit.c
@@ -181,7 +181,7 @@ static u8 b43legacy_calc_fallback_rate(u8 bitrate)
 	return 0;
 }
 
-static void generate_txhdr_fw3(struct b43legacy_wldev *dev,
+static int generate_txhdr_fw3(struct b43legacy_wldev *dev,
 			       struct b43legacy_txhdr_fw3 *txhdr,
 			       const unsigned char *fragment_data,
 			       unsigned int fragment_len,
@@ -252,6 +252,13 @@ static void generate_txhdr_fw3(struct b43legacy_wldev *dev,
 			iv_len = min((size_t)txctl->iv_len,
 				     ARRAY_SIZE(txhdr->iv));
 			memcpy(txhdr->iv, ((u8 *)wlhdr) + wlhdr_len, iv_len);
+		} else {
+			/* This key is invalid. This might only happen
+			 * in a short timeframe after machine resume before
+			 * we were able to reconfigure keys.
+			 * Drop this packet completely. Do not transmit it
+			 * unencrypted to avoid leaking information. */
+			return -ENOKEY;
 		}
 	}
 	b43legacy_generate_plcp_hdr((struct b43legacy_plcp_hdr4 *)
@@ -345,16 +352,18 @@ static void generate_txhdr_fw3(struct b43legacy_wldev *dev,
 	/* Apply the bitfields */
 	txhdr->mac_ctl = cpu_to_le32(mac_ctl);
 	txhdr->phy_ctl = cpu_to_le16(phy_ctl);
+
+	return 0;
 }
 
-void b43legacy_generate_txhdr(struct b43legacy_wldev *dev,
+int b43legacy_generate_txhdr(struct b43legacy_wldev *dev,
 			      u8 *txhdr,
 			      const unsigned char *fragment_data,
 			      unsigned int fragment_len,
 			      const struct ieee80211_tx_control *txctl,
 			      u16 cookie)
 {
-	generate_txhdr_fw3(dev, (struct b43legacy_txhdr_fw3 *)txhdr,
+	return generate_txhdr_fw3(dev, (struct b43legacy_txhdr_fw3 *)txhdr,
 			   fragment_data, fragment_len,
 			   txctl, cookie);
 }
diff --git a/drivers/net/wireless/b43legacy/xmit.h b/drivers/net/wireless/b43legacy/xmit.h
index 8a155d0..bab4792 100644
--- a/drivers/net/wireless/b43legacy/xmit.h
+++ b/drivers/net/wireless/b43legacy/xmit.h
@@ -76,7 +76,7 @@ struct b43legacy_txhdr_fw3 {
 
 
 
-void b43legacy_generate_txhdr(struct b43legacy_wldev *dev,
+int b43legacy_generate_txhdr(struct b43legacy_wldev *dev,
 			      u8 *txhdr,
 			      const unsigned char *fragment_data,
 			      unsigned int fragment_len,
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index f55c757..5ee1ad6 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -4207,13 +4207,13 @@ static u8 ratio2dB[100] = {
  * Conversion assumes that levels are voltages (20*log), not powers (10*log). */
 int iwl3945_calc_db_from_ratio(int sig_ratio)
 {
-	/* Anything above 1000:1 just report as 60 dB */
-	if (sig_ratio > 1000)
+	/* 1000:1 or higher just report as 60 dB */
+	if (sig_ratio >= 1000)
 		return 60;
 
-	/* Above 100:1, divide by 10 and use table,
+	/* 100:1 or higher, divide by 10 and use table,
 	 *   add 20 dB to make up for divide by 10 */
-	if (sig_ratio > 100)
+	if (sig_ratio >= 100)
 		return (20 + (int)ratio2dB[sig_ratio/10]);
 
 	/* We shouldn't see this */
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index e18f5c2..9d5da8b 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -373,6 +373,15 @@ void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state)
 	if (sdev->bus->bustype == SSB_BUSTYPE_PCI)
 		pci_set_power_state(sdev->bus->host_pci, state);
 }
+#else
+static inline void ssb_pcihost_unregister(struct pci_driver *driver)
+{
+}
+
+static inline
+void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state)
+{
+}
 #endif /* CONFIG_SSB_PCIHOST */
 
 
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
index e77592d..45c7c0c 100644
--- a/net/mac80211/Kconfig
+++ b/net/mac80211/Kconfig
@@ -1,6 +1,5 @@
 config MAC80211
 	tristate "Generic IEEE 802.11 Networking Stack (mac80211)"
-	depends on EXPERIMENTAL
 	select CRYPTO
 	select CRYPTO_ECB
 	select CRYPTO_ARC4
-- 
John W. Linville
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org

^ permalink raw reply related

* Re: pull request: wireless-2.6 'fixes' 2008-02-05
From: David Miller @ 2008-02-06  3:58 UTC (permalink / raw)
  To: linville-2XuSBdqkA4R54TAoqtyWWQ
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20080206025902.GM4252-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>

From: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
Date: Tue, 5 Feb 2008 21:59:02 -0500

> Some fixes intended for 2.6.25, especially some ports to b43legacy of
> some b43 fixes that are already merged.  Please let me know if there are
> problems.

Pulled, thanks a lot John.

^ permalink raw reply

* Re: [PATCH] ipvs: Make wrr "no available servers" error message rate-limited
From: David Miller @ 2008-02-06  4:00 UTC (permalink / raw)
  To: horms; +Cc: sven.wegener, netdev, linux-kernel
In-Reply-To: <20080206021909.GA32678@verge.net.au>

From: Simon Horman <horms@verge.net.au>
Date: Wed, 6 Feb 2008 11:19:09 +0900

> On Tue, Feb 05, 2008 at 09:30:21PM +0100, Sven Wegener wrote:
> > No available servers is more an error message than something informational. It
> > should also be rate-limited, else we're going to flood our logs on a busy
> > director, if all real servers are out of order with a weight of zero.
> > 
> > Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
> 
> Hi Sven,
> 
> this looks good to me.
> 
> Acked-by: Simon Horman <horms@verge.net.au>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] virtio_net: Fix open <-> interrupt race
From: Rusty Russell @ 2008-02-06  4:00 UTC (permalink / raw)
  To: Christian Borntraeger; +Cc: netdev, dor.laor, Anthony Liguori, virtualization
In-Reply-To: <200802051436.10841.borntraeger@de.ibm.com>

On Wednesday 06 February 2008 00:36:10 Christian Borntraeger wrote:
> I got the following oops during interface ifup. Unfortunately its not
> easily reproducable so I cant say for sure that my fix fixes this
> problem, but I am confident and I think its correct anyway:

Looks fine, and certainly shouldn't hurt.  Please push this out.

Acked-by: Rusty Russell <rusty@rustcorp.com.au>

Thanks,
Rusty.

^ permalink raw reply

* Re: [PATCH][RFC] race in generic address resolution
From: David Miller @ 2008-02-06  4:51 UTC (permalink / raw)
  To: frank.blaschka; +Cc: netdev
In-Reply-To: <20080204142717.GA11020@tuxmaker.boeblingen.de.ibm.com>

From: Blaschka <frank.blaschka@de.ibm.com>
Date: Mon, 4 Feb 2008 15:27:17 +0100

> I'm running a SMP maschine (2 CPUs) configured as a router. During heavy
> traffic kernel dies with following message: 
> 
>     <2>kernel BUG at /home/autobuild/BUILD/linux-2.6.23-20080125/net/core/skbuff.c:648!
 ...
> Following patch fixes the problem but I do not know if it is a good sollution.
> 
> From: Frank Blaschka <frank.blaschka@de.ibm.com>
> 
> neigh_update sends skb from neigh->arp_queue while
> neigh_timer_handler has increased skbs refcount and calls
> solicit with the skb. Do not send neighbour skbs
> marked for solicit (skb_shared).
> 
> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>

Thanks for finding this bug.

I'm fine with your approach as a temporary fix, but there is a slight
problem with your patch.  If the skb is shared we have to free it if
we don't pass it on to ->output(), otherwise this creates a leak.

In the longer term, this is an unfortunate limitation.  The
->solicit() code just wants to look at a few header fields to
determine how to construct the solicitation request.

What's funny is that we added these skb_get() calls for
the solications exactly to deal with this race condition.

I considered various ways to fix this.  The simplest is probably just
to skb_copy() in the ->solicit() case.  Solicitation is a rare event
so it's not big deal to copy the packet until the neighbour is
resolved.

The other option is holding the write lock on neigh->lock during the
->solicit() call.  I looked at all of the ndisc_ops implementations
and this seems workable.  The only case that needs special care is the
IPV4 ARP implementation of arp_solicit().  It wants to take
neigh->lock as a reader to protect the header entry in neigh->ha
during the emission of the soliciation.  We can simply remove the read
lock calls to take care of that since holding the lock as a writer at
the caller providers a superset of the protection afforded by the
existing read locking.

The rest of the ->solicit() implementations don't care whether
the neigh is locked or not.

Can you see if this version of the patch fixes your problem?

Thanks!

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index a16cf1e..7bb6a9a 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -834,18 +834,12 @@ static void neigh_timer_handler(unsigned long arg)
 	}
 	if (neigh->nud_state & (NUD_INCOMPLETE | NUD_PROBE)) {
 		struct sk_buff *skb = skb_peek(&neigh->arp_queue);
-		/* keep skb alive even if arp_queue overflows */
-		if (skb)
-			skb_get(skb);
-		write_unlock(&neigh->lock);
+
 		neigh->ops->solicit(neigh, skb);
 		atomic_inc(&neigh->probes);
-		if (skb)
-			kfree_skb(skb);
-	} else {
-out:
-		write_unlock(&neigh->lock);
 	}
+out:
+	write_unlock(&neigh->lock);
 
 	if (notify)
 		neigh_update_notify(neigh);
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 8e17f65..c663fa5 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -368,7 +368,6 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb)
 		if (!(neigh->nud_state&NUD_VALID))
 			printk(KERN_DEBUG "trying to ucast probe in NUD_INVALID\n");
 		dst_ha = neigh->ha;
-		read_lock_bh(&neigh->lock);
 	} else if ((probes -= neigh->parms->app_probes) < 0) {
 #ifdef CONFIG_ARPD
 		neigh_app_ns(neigh);
@@ -378,8 +377,6 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb)
 
 	arp_send(ARPOP_REQUEST, ETH_P_ARP, target, dev, saddr,
 		 dst_ha, dev->dev_addr, NULL);
-	if (dst_ha)
-		read_unlock_bh(&neigh->lock);
 }
 
 static int arp_ignore(struct in_device *in_dev, __be32 sip, __be32 tip)

^ permalink raw reply related

* Re: [e1000][net-2.6 tree] Regression: driver doesn't detect card on my node.
From: Pavel Emelyanov @ 2008-02-06  7:10 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Kok, Auke, e1000-devel, Linux Netdev List, jesse.brandeburg,
	john.ronciak, Thomas Gleixner, jeffrey.t.kirsher, Denis Lunev,
	Ingo Molnar, David Miller, Justin Piszcz
In-Reply-To: <200802050943.01652.yinghai.lu@sun.com>

[-- Attachment #1: Type: text/plain, Size: 7854 bytes --]

[snip]

>>> What other info from me is required?
> 
> boot log please. with the patch and reverting the patch.

Here they are (attached).
BTW, I found, that the sky2 adapter is broken by this patch as well.
To simplify the analysis, here's their diff:

--- bad-log	2008-02-06 10:06:40.000000000 +0300
+++ good-log	2008-02-06 10:06:40.000000000 +0300
@@ -1,4 +1,4 @@
-Linux version 2.6.24 (pavel@xemulnb) (gcc version 4.1.3 20070724 (prerelease) (SUSE Linux)) #22 SMP Tue Feb 5 20:09:11 MSK 2008
+Linux version 2.6.24 (pavel@xemulnb) (gcc version 4.1.3 20070724 (prerelease) (SUSE Linux)) #23 SMP Wed Feb 6 10:03:53 MSK 2008
 BIOS-provided physical RAM map:
  BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
  BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
@@ -19,29 +19,6 @@ Scan SMP from c0000000 for 1024 bytes.
 Scan SMP from c009fc00 for 1024 bytes.
 Scan SMP from c00f0000 for 65536 bytes.
 found SMP MP-table at [c00ff780] 000ff780
-***************
-**** WARNING: likely BIOS bug
-**** MTRRs don't cover all of memory, trimmed 786432 pages
-***************
-update e820 for mtrr
-modified physical RAM map:
- modified: 0000000000000000 - 000000000009f800 (usable)
- modified: 000000000009f800 - 00000000000a0000 (reserved)
- modified: 00000000000e0000 - 0000000000100000 (reserved)
- modified: 0000000000100000 - 0000000040000000 (usable)
- modified: 0000000040000000 - 00000000bfff0000 (reserved)
- modified: 00000000bfff0000 - 00000000bffff000 (ACPI data)
- modified: 00000000bffff000 - 00000000c0000000 (ACPI NVS)
- modified: 00000000c0000000 - 0000000100000000 (reserved)
- modified: 0000000100000000 - 0000000140000000 (usable)
-Warning only 4GB will be used.
-Use a HIGHMEM64G enabled kernel.
-3200MB HIGHMEM available.
-896MB LOWMEM available.
-Scan SMP from c0000000 for 1024 bytes.
-Scan SMP from c009fc00 for 1024 bytes.
-Scan SMP from c00f0000 for 65536 bytes.
-found SMP MP-table at [c00ff780] 000ff780
 Entering add_active_range(0, 0, 1048576) 0 entries of 256 used
 Zone PFN ranges:
   DMA             0 ->     4096
@@ -69,7 +46,7 @@ I/O APIC #7 Version 32 at 0xFEC00000.
 I/O APIC #8 Version 32 at 0xFEC10000.
 Enabling APIC mode:  Flat.  Using 2 I/O APICs
 Processors: 2
-Allocating PCI resources starting at 10100000 (gap: 10000000:00400000)
+Allocating PCI resources starting at c4000000 (gap: c0000000:3ec00000)
 Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 1040384
 Kernel command line: ro root=08:02 ignore_loglevel
 debug: ignoring loglevel setting.
@@ -80,22 +57,22 @@ Enabling fast FPU save and restore... do
 Enabling unmasked SIMD FPU exception support... done.
 Initializing CPU#0
 PID hash table entries: 4096 (order: 12, 16384 bytes)
-Detected 3192.350 MHz processor.
+Detected 3192.343 MHz processor.
 Console: colour VGA+ 80x25
 console [tty0] enabled
 Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
 Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
-Memory: 1011264k/4194304k available (1357k kernel code, 36260k reserved, 594k data, 168k init, 131072k highmem)
+Memory: 3108104k/4194304k available (1357k kernel code, 36260k reserved, 594k data, 168k init, 2228024k highmem)
 virtual kernel memory layout:
     fixmap  : 0xfffa0000 - 0xfffff000   ( 380 kB)
     pkmap   : 0xff800000 - 0xffc00000   (4096 kB)
     vmalloc : 0xf8800000 - 0xff7fe000   ( 111 MB)
     lowmem  : 0xc0000000 - 0xf8000000   ( 896 MB)
       .init : 0xc05f0000 - 0xc061a000   ( 168 kB)
-      .data : 0xc055375e - 0xc05e8088   ( 594 kB)
-      .text : 0xc0400000 - 0xc055375e   (1357 kB)
+      .data : 0xc0553754 - 0xc05e8088   ( 594 kB)
+      .text : 0xc0400000 - 0xc0553754   (1357 kB)
 Checking if this processor honours the WP bit even in supervisor mode... Ok.
-Calibrating delay using timer specific routine.. 6387.02 BogoMIPS (lpj=3193513)
+Calibrating delay using timer specific routine.. 6387.05 BogoMIPS (lpj=3193528)
 Mount-cache hash table entries: 512
 CPU: Trace cache: 12K uops, L1 D cache: 16K
 CPU: L2 cache: 1024K
@@ -119,7 +96,7 @@ Intel machine check reporting enabled on
 CPU1: Intel P4/Xeon Extended MCE MSRs (24) available
 CPU1: Thermal monitoring enabled
 CPU1: Intel(R) Xeon(TM) CPU 3.20GHz stepping 01
-Total of 2 processors activated (12770.19 BogoMIPS).
+Total of 2 processors activated (12770.22 BogoMIPS).
 ExtINT not setup in hardware but reported by MP table
 ENABLING IO-APIC IRQs
 ..TIMER: vector=0x31 apic1=0 pin1=2 apic2=0 pin2=0
@@ -153,41 +130,22 @@ PCI->APIC IRQ transform: 0000:00:1f.3[B]
 PCI->APIC IRQ transform: 0000:02:00.0[A] -> IRQ 16
 PCI->APIC IRQ transform: 0000:04:02.0[A] -> IRQ 17
 PCI->APIC IRQ transform: 0000:04:03.0[A] -> IRQ 16
-PCI: Cannot allocate resource region 8 of bridge 0000:00:03.0
-PCI: Cannot allocate resource region 8 of bridge 0000:00:1e.0
-PCI: Cannot allocate resource region 0 of device 0000:00:1d.4
-PCI: Cannot allocate resource region 0 of device 0000:00:1d.7
-PCI: Cannot allocate resource region 0 of device 0000:02:00.0
-PCI: Cannot allocate resource region 0 of device 0000:04:02.0
-PCI: Cannot allocate resource region 2 of device 0000:04:02.0
-PCI: Cannot allocate resource region 0 of device 0000:04:03.0
-PCI: Failed to allocate mem resource #8:100000@10100000 for 0000:00:03.0
-PCI: Failed to allocate mem resource #9:100000@10100000 for 0000:00:03.0
-PCI: Failed to allocate mem resource #0:400@10100000 for 0000:00:1d.7
-PCI: Failed to allocate mem resource #5:400@10100000 for 0000:00:1f.1
-PCI: Failed to allocate mem resource #0:10@10100000 for 0000:00:1d.4
 PCI: Bridge: 0000:00:02.0
-Time: tsc clocksource has been installed.
   IO window: disabled.
   MEM window: disabled.
   PREFETCH window: disabled.
-PCI: Failed to allocate mem resource #6:20000@0 for 0000:02:00.0
-PCI: Failed to allocate mem resource #0:4000@0 for 0000:02:00.0
 PCI: Bridge: 0000:00:03.0
   IO window: d000-dfff
-  MEM window: disabled.
+Time: tsc clocksource has been installed.
+  MEM window: dee00000-deefffff
   PREFETCH window: disabled.
 PCI: Bridge: 0000:00:1c.0
   IO window: disabled.
   MEM window: disabled.
   PREFETCH window: disabled.
-PCI: Failed to allocate mem resource #0:1000000@11000000 for 0000:04:02.0
-PCI: Failed to allocate mem resource #6:20000@10100000 for 0000:04:02.0
-PCI: Failed to allocate mem resource #0:20000@10100000 for 0000:04:03.0
-PCI: Failed to allocate mem resource #2:1000@10100000 for 0000:04:02.0
 PCI: Bridge: 0000:00:1e.0
   IO window: e000-efff
-  MEM window: disabled.
+  MEM window: def00000-dfffffff
   PREFETCH window: disabled.
 PCI: Setting latency timer of device 0000:00:02.0 to 64
 PCI: Setting latency timer of device 0000:00:03.0 to 64
@@ -254,10 +212,11 @@ Freeing unused kernel memory: 168k freed
 warning: process `kmodule' used the deprecated sysctl system call with 1.23.
 Intel(R) PRO/1000 Network Driver - version 7.3.20-k2-NAPI
 Copyright (c) 1999-2006 Intel Corporation.
-e1000: probe of 0000:04:03.0 failed with error -5
+e1000: 0000:04:03.0: e1000_probe: (PCI:33MHz:32-bit) 00:0e:0c:3b:d8:8b
+e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
 PCI: Setting latency timer of device 0000:02:00.0 to 64
-sky2 0000:02:00.0: unsupported chip type 0xe0
-sky2: probe of 0000:02:00.0 failed with error -95
+sky2 0000:02:00.0: v1.21 addr 0xdeefc000 irq 16 Yukon-EC (0xb6) rev 2
+sky2 eth1: addr 00:0e:0c:3b:d8:8a
 intel_rng: FWH not detected
 EXT3 FS on sda2, internal journal
 kjournald starting.  Commit interval 5 seconds
@@ -266,3 +225,4 @@ EXT3-fs: mounted filesystem with ordered
 warning: process `kudzu' used the deprecated sysctl system call with 1.23.
 warning: process `kudzu' used the deprecated sysctl system call with 1.49.
 warning: process `kudzu' used the deprecated sysctl system call with 1.49.
+e1000: eth0: e1000_watchdog: NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX

> Thanks
> 
> YH
> 


[-- Attachment #2: bad-log --]
[-- Type: text/plain, Size: 12269 bytes --]

Linux version 2.6.24 (pavel@xemulnb) (gcc version 4.1.3 20070724 (prerelease) (SUSE Linux)) #22 SMP Tue Feb 5 20:09:11 MSK 2008
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
 BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 00000000bffce0e5 (usable)
 BIOS-e820: 00000000bffce0e5 - 00000000bfff0000 (reserved)
 BIOS-e820: 00000000bfff0000 - 00000000bffff000 (ACPI data)
 BIOS-e820: 00000000bffff000 - 00000000c0000000 (ACPI NVS)
 BIOS-e820: 00000000fec00000 - 00000000fec86000 (reserved)
 BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
 BIOS-e820: 00000000ffb00000 - 0000000100000000 (reserved)
 BIOS-e820: 0000000100000000 - 0000000140000000 (usable)
Warning only 4GB will be used.
Use a HIGHMEM64G enabled kernel.
3200MB HIGHMEM available.
896MB LOWMEM available.
Scan SMP from c0000000 for 1024 bytes.
Scan SMP from c009fc00 for 1024 bytes.
Scan SMP from c00f0000 for 65536 bytes.
found SMP MP-table at [c00ff780] 000ff780
***************
**** WARNING: likely BIOS bug
**** MTRRs don't cover all of memory, trimmed 786432 pages
***************
update e820 for mtrr
modified physical RAM map:
 modified: 0000000000000000 - 000000000009f800 (usable)
 modified: 000000000009f800 - 00000000000a0000 (reserved)
 modified: 00000000000e0000 - 0000000000100000 (reserved)
 modified: 0000000000100000 - 0000000040000000 (usable)
 modified: 0000000040000000 - 00000000bfff0000 (reserved)
 modified: 00000000bfff0000 - 00000000bffff000 (ACPI data)
 modified: 00000000bffff000 - 00000000c0000000 (ACPI NVS)
 modified: 00000000c0000000 - 0000000100000000 (reserved)
 modified: 0000000100000000 - 0000000140000000 (usable)
Warning only 4GB will be used.
Use a HIGHMEM64G enabled kernel.
3200MB HIGHMEM available.
896MB LOWMEM available.
Scan SMP from c0000000 for 1024 bytes.
Scan SMP from c009fc00 for 1024 bytes.
Scan SMP from c00f0000 for 65536 bytes.
found SMP MP-table at [c00ff780] 000ff780
Entering add_active_range(0, 0, 1048576) 0 entries of 256 used
Zone PFN ranges:
  DMA             0 ->     4096
  Normal       4096 ->   229376
  HighMem    229376 ->  1048576
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0:        0 ->  1048576
On node 0 totalpages: 1048576
  DMA zone: 32 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 4064 pages, LIFO batch:0
  Normal zone: 1760 pages used for memmap
  Normal zone: 223520 pages, LIFO batch:31
  HighMem zone: 6400 pages used for memmap
  HighMem zone: 812800 pages, LIFO batch:31
  Movable zone: 0 pages used for memmap
DMI 2.3 present.
Intel MultiProcessor Specification v1.4
    Virtual Wire compatibility mode.
OEM ID: INTEL    Product ID: SE7320EP20   APIC at: 0xFEE00000
Processor #0 15:4 APIC version 20
Processor #6 15:4 APIC version 20
I/O APIC #7 Version 32 at 0xFEC00000.
I/O APIC #8 Version 32 at 0xFEC10000.
Enabling APIC mode:  Flat.  Using 2 I/O APICs
Processors: 2
Allocating PCI resources starting at 10100000 (gap: 10000000:00400000)
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 1040384
Kernel command line: ro root=08:02 ignore_loglevel
debug: ignoring loglevel setting.
mapped APIC to ffffb000 (fee00000)
mapped IOAPIC to ffffa000 (fec00000)
mapped IOAPIC to ffff9000 (fec10000)
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
PID hash table entries: 4096 (order: 12, 16384 bytes)
Detected 3192.350 MHz processor.
Console: colour VGA+ 80x25
console [tty0] enabled
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 1011264k/4194304k available (1357k kernel code, 36260k reserved, 594k data, 168k init, 131072k highmem)
virtual kernel memory layout:
    fixmap  : 0xfffa0000 - 0xfffff000   ( 380 kB)
    pkmap   : 0xff800000 - 0xffc00000   (4096 kB)
    vmalloc : 0xf8800000 - 0xff7fe000   ( 111 MB)
    lowmem  : 0xc0000000 - 0xf8000000   ( 896 MB)
      .init : 0xc05f0000 - 0xc061a000   ( 168 kB)
      .data : 0xc055375e - 0xc05e8088   ( 594 kB)
      .text : 0xc0400000 - 0xc055375e   (1357 kB)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay using timer specific routine.. 6387.02 BogoMIPS (lpj=3193513)
Mount-cache hash table entries: 512
CPU: Trace cache: 12K uops, L1 D cache: 16K
CPU: L2 cache: 1024K
CPU: Hyper-Threading is disabled
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
CPU0: Intel P4/Xeon Extended MCE MSRs (24) available
CPU0: Thermal monitoring enabled
Compat vDSO mapped to ffffe000.
Checking 'hlt' instruction... OK.
Freeing SMP alternatives: 15k freed
CPU0: Intel(R) Xeon(TM) CPU 3.20GHz stepping 01
Booting processor 1/6 ip 2000
Initializing CPU#1
Calibrating delay using timer specific routine.. 6383.16 BogoMIPS (lpj=3191582)
CPU: Trace cache: 12K uops, L1 D cache: 16K
CPU: L2 cache: 1024K
CPU: Hyper-Threading is disabled
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#1.
CPU1: Intel P4/Xeon Extended MCE MSRs (24) available
CPU1: Thermal monitoring enabled
CPU1: Intel(R) Xeon(TM) CPU 3.20GHz stepping 01
Total of 2 processors activated (12770.19 BogoMIPS).
ExtINT not setup in hardware but reported by MP table
ENABLING IO-APIC IRQs
..TIMER: vector=0x31 apic1=0 pin1=2 apic2=0 pin2=0
checking TSC synchronization [CPU#0 -> CPU#1]: passed.
Brought up 2 CPUs
net_namespace: 164 bytes
NET: Registered protocol family 16
PCI: PCI BIOS revision 2.10 entry at 0xf0031, last bus=4
PCI: Using configuration type 1
Setting up standard PCI resources
SCSI subsystem initialized
libata version 3.00 loaded.
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PCI: Probing PCI hardware
PCI: Probing PCI hardware (bus 00)
PCI quirk: region 0800-087f claimed by ICH4 ACPI/GPIO/TCO
PCI quirk: region 0480-04bf claimed by ICH4 GPIO
PCI: Transparent bridge - 0000:00:1e.0
PCI: Discovered primary peer bus ff [IRQ]
PCI: Using IRQ router PIIX/ICH [8086/25a1] at 0000:00:1f.0
PCI->APIC IRQ transform: 0000:00:02.0[A] -> IRQ 16
PCI->APIC IRQ transform: 0000:00:03.0[A] -> IRQ 16
PCI->APIC IRQ transform: 0000:00:1d.0[A] -> IRQ 16
PCI->APIC IRQ transform: 0000:00:1d.1[B] -> IRQ 19
PCI->APIC IRQ transform: 0000:00:1d.7[D] -> IRQ 23
PCI->APIC IRQ transform: 0000:00:1f.1[A] -> IRQ 18
PCI->APIC IRQ transform: 0000:00:1f.2[A] -> IRQ 18
PCI->APIC IRQ transform: 0000:00:1f.3[B] -> IRQ 17
PCI->APIC IRQ transform: 0000:02:00.0[A] -> IRQ 16
PCI->APIC IRQ transform: 0000:04:02.0[A] -> IRQ 17
PCI->APIC IRQ transform: 0000:04:03.0[A] -> IRQ 16
PCI: Cannot allocate resource region 8 of bridge 0000:00:03.0
PCI: Cannot allocate resource region 8 of bridge 0000:00:1e.0
PCI: Cannot allocate resource region 0 of device 0000:00:1d.4
PCI: Cannot allocate resource region 0 of device 0000:00:1d.7
PCI: Cannot allocate resource region 0 of device 0000:02:00.0
PCI: Cannot allocate resource region 0 of device 0000:04:02.0
PCI: Cannot allocate resource region 2 of device 0000:04:02.0
PCI: Cannot allocate resource region 0 of device 0000:04:03.0
PCI: Failed to allocate mem resource #8:100000@10100000 for 0000:00:03.0
PCI: Failed to allocate mem resource #9:100000@10100000 for 0000:00:03.0
PCI: Failed to allocate mem resource #0:400@10100000 for 0000:00:1d.7
PCI: Failed to allocate mem resource #5:400@10100000 for 0000:00:1f.1
PCI: Failed to allocate mem resource #0:10@10100000 for 0000:00:1d.4
PCI: Bridge: 0000:00:02.0
Time: tsc clocksource has been installed.
  IO window: disabled.
  MEM window: disabled.
  PREFETCH window: disabled.
PCI: Failed to allocate mem resource #6:20000@0 for 0000:02:00.0
PCI: Failed to allocate mem resource #0:4000@0 for 0000:02:00.0
PCI: Bridge: 0000:00:03.0
  IO window: d000-dfff
  MEM window: disabled.
  PREFETCH window: disabled.
PCI: Bridge: 0000:00:1c.0
  IO window: disabled.
  MEM window: disabled.
  PREFETCH window: disabled.
PCI: Failed to allocate mem resource #0:1000000@11000000 for 0000:04:02.0
PCI: Failed to allocate mem resource #6:20000@10100000 for 0000:04:02.0
PCI: Failed to allocate mem resource #0:20000@10100000 for 0000:04:03.0
PCI: Failed to allocate mem resource #2:1000@10100000 for 0000:04:02.0
PCI: Bridge: 0000:00:1e.0
  IO window: e000-efff
  MEM window: disabled.
  PREFETCH window: disabled.
PCI: Setting latency timer of device 0000:00:02.0 to 64
PCI: Setting latency timer of device 0000:00:03.0 to 64
PCI: Setting latency timer of device 0000:00:1e.0 to 64
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 7, 524288 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
highmem bounce pool size: 64 pages
io scheduler noop registered
io scheduler anticipatory registered (default)
Boot video device is 0000:04:02.0
Real Time Clock Driver v1.12ac
Non-volatile memory driver v1.2
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
loop: module loaded
Driver 'sd' needs updating - please use bus_type methods
ata_piix 0000:00:1f.1: version 2.12
PCI: Setting latency timer of device 0000:00:1f.1 to 64
scsi0 : ata_piix
scsi1 : ata_piix
ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0xfc00 irq 14
ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0xfc08 irq 15
ata1.00: ATAPI: TEAC DV-516G, F4S6, max UDMA/33
ata1.00: configured for UDMA/33
scsi 0:0:0:0: CD-ROM            TEAC     DV-516G          F4S6 PQ: 0 ANSI: 5
ata_piix 0000:00:1f.2: MAP [ P0 -- P1 -- ]
PCI: Setting latency timer of device 0000:00:1f.2 to 64
scsi2 : ata_piix
scsi3 : ata_piix
ata3: SATA max UDMA/133 cmd 0xc800 ctl 0xc480 bmdma 0xc000 irq 18
ata4: SATA max UDMA/133 cmd 0xc400 ctl 0xc080 bmdma 0xc008 irq 18
ata4.00: ATA-7: ST3200826AS, 3.03, max UDMA/133
ata4.00: 390721968 sectors, multi 16: LBA48 NCQ (depth 0/32)
ata4.00: configured for UDMA/133
scsi 3:0:0:0: Direct-Access     ATA      ST3200826AS      3.03 PQ: 0 ANSI: 5
sd 3:0:0:0: [sda] 390721968 512-byte hardware sectors (200050 MB)
sd 3:0:0:0: [sda] Write Protect is off
sd 3:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 3:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sd 3:0:0:0: [sda] 390721968 512-byte hardware sectors (200050 MB)
sd 3:0:0:0: [sda] Write Protect is off
sd 3:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 3:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1 sda2 sda3 sda4 < sda5 >
sd 3:0:0:0: [sda] Attached SCSI disk
serio: i8042 KBD port at 0x60,0x64 irq 1
serio: i8042 AUX port at 0x60,0x64 irq 12
usbcore: registered new interface driver usbhid
drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Using IPI Shortcut mode
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 168k freed
warning: process `kmodule' used the deprecated sysctl system call with 1.23.
Intel(R) PRO/1000 Network Driver - version 7.3.20-k2-NAPI
Copyright (c) 1999-2006 Intel Corporation.
e1000: probe of 0000:04:03.0 failed with error -5
PCI: Setting latency timer of device 0000:02:00.0 to 64
sky2 0000:02:00.0: unsupported chip type 0xe0
sky2: probe of 0000:02:00.0 failed with error -95
intel_rng: FWH not detected
EXT3 FS on sda2, internal journal
kjournald starting.  Commit interval 5 seconds
EXT3 FS on sda1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
warning: process `kudzu' used the deprecated sysctl system call with 1.23.
warning: process `kudzu' used the deprecated sysctl system call with 1.49.
warning: process `kudzu' used the deprecated sysctl system call with 1.49.

[-- Attachment #3: good-log --]
[-- Type: text/plain, Size: 10232 bytes --]

Linux version 2.6.24 (pavel@xemulnb) (gcc version 4.1.3 20070724 (prerelease) (SUSE Linux)) #23 SMP Wed Feb 6 10:03:53 MSK 2008
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
 BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 00000000bffce0e5 (usable)
 BIOS-e820: 00000000bffce0e5 - 00000000bfff0000 (reserved)
 BIOS-e820: 00000000bfff0000 - 00000000bffff000 (ACPI data)
 BIOS-e820: 00000000bffff000 - 00000000c0000000 (ACPI NVS)
 BIOS-e820: 00000000fec00000 - 00000000fec86000 (reserved)
 BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
 BIOS-e820: 00000000ffb00000 - 0000000100000000 (reserved)
 BIOS-e820: 0000000100000000 - 0000000140000000 (usable)
Warning only 4GB will be used.
Use a HIGHMEM64G enabled kernel.
3200MB HIGHMEM available.
896MB LOWMEM available.
Scan SMP from c0000000 for 1024 bytes.
Scan SMP from c009fc00 for 1024 bytes.
Scan SMP from c00f0000 for 65536 bytes.
found SMP MP-table at [c00ff780] 000ff780
Entering add_active_range(0, 0, 1048576) 0 entries of 256 used
Zone PFN ranges:
  DMA             0 ->     4096
  Normal       4096 ->   229376
  HighMem    229376 ->  1048576
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0:        0 ->  1048576
On node 0 totalpages: 1048576
  DMA zone: 32 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 4064 pages, LIFO batch:0
  Normal zone: 1760 pages used for memmap
  Normal zone: 223520 pages, LIFO batch:31
  HighMem zone: 6400 pages used for memmap
  HighMem zone: 812800 pages, LIFO batch:31
  Movable zone: 0 pages used for memmap
DMI 2.3 present.
Intel MultiProcessor Specification v1.4
    Virtual Wire compatibility mode.
OEM ID: INTEL    Product ID: SE7320EP20   APIC at: 0xFEE00000
Processor #0 15:4 APIC version 20
Processor #6 15:4 APIC version 20
I/O APIC #7 Version 32 at 0xFEC00000.
I/O APIC #8 Version 32 at 0xFEC10000.
Enabling APIC mode:  Flat.  Using 2 I/O APICs
Processors: 2
Allocating PCI resources starting at c4000000 (gap: c0000000:3ec00000)
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 1040384
Kernel command line: ro root=08:02 ignore_loglevel
debug: ignoring loglevel setting.
mapped APIC to ffffb000 (fee00000)
mapped IOAPIC to ffffa000 (fec00000)
mapped IOAPIC to ffff9000 (fec10000)
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
PID hash table entries: 4096 (order: 12, 16384 bytes)
Detected 3192.343 MHz processor.
Console: colour VGA+ 80x25
console [tty0] enabled
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 3108104k/4194304k available (1357k kernel code, 36260k reserved, 594k data, 168k init, 2228024k highmem)
virtual kernel memory layout:
    fixmap  : 0xfffa0000 - 0xfffff000   ( 380 kB)
    pkmap   : 0xff800000 - 0xffc00000   (4096 kB)
    vmalloc : 0xf8800000 - 0xff7fe000   ( 111 MB)
    lowmem  : 0xc0000000 - 0xf8000000   ( 896 MB)
      .init : 0xc05f0000 - 0xc061a000   ( 168 kB)
      .data : 0xc0553754 - 0xc05e8088   ( 594 kB)
      .text : 0xc0400000 - 0xc0553754   (1357 kB)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay using timer specific routine.. 6387.05 BogoMIPS (lpj=3193528)
Mount-cache hash table entries: 512
CPU: Trace cache: 12K uops, L1 D cache: 16K
CPU: L2 cache: 1024K
CPU: Hyper-Threading is disabled
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
CPU0: Intel P4/Xeon Extended MCE MSRs (24) available
CPU0: Thermal monitoring enabled
Compat vDSO mapped to ffffe000.
Checking 'hlt' instruction... OK.
Freeing SMP alternatives: 15k freed
CPU0: Intel(R) Xeon(TM) CPU 3.20GHz stepping 01
Booting processor 1/6 ip 2000
Initializing CPU#1
Calibrating delay using timer specific routine.. 6383.16 BogoMIPS (lpj=3191582)
CPU: Trace cache: 12K uops, L1 D cache: 16K
CPU: L2 cache: 1024K
CPU: Hyper-Threading is disabled
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#1.
CPU1: Intel P4/Xeon Extended MCE MSRs (24) available
CPU1: Thermal monitoring enabled
CPU1: Intel(R) Xeon(TM) CPU 3.20GHz stepping 01
Total of 2 processors activated (12770.22 BogoMIPS).
ExtINT not setup in hardware but reported by MP table
ENABLING IO-APIC IRQs
..TIMER: vector=0x31 apic1=0 pin1=2 apic2=0 pin2=0
checking TSC synchronization [CPU#0 -> CPU#1]: passed.
Brought up 2 CPUs
net_namespace: 164 bytes
NET: Registered protocol family 16
PCI: PCI BIOS revision 2.10 entry at 0xf0031, last bus=4
PCI: Using configuration type 1
Setting up standard PCI resources
SCSI subsystem initialized
libata version 3.00 loaded.
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PCI: Probing PCI hardware
PCI: Probing PCI hardware (bus 00)
PCI quirk: region 0800-087f claimed by ICH4 ACPI/GPIO/TCO
PCI quirk: region 0480-04bf claimed by ICH4 GPIO
PCI: Transparent bridge - 0000:00:1e.0
PCI: Discovered primary peer bus ff [IRQ]
PCI: Using IRQ router PIIX/ICH [8086/25a1] at 0000:00:1f.0
PCI->APIC IRQ transform: 0000:00:02.0[A] -> IRQ 16
PCI->APIC IRQ transform: 0000:00:03.0[A] -> IRQ 16
PCI->APIC IRQ transform: 0000:00:1d.0[A] -> IRQ 16
PCI->APIC IRQ transform: 0000:00:1d.1[B] -> IRQ 19
PCI->APIC IRQ transform: 0000:00:1d.7[D] -> IRQ 23
PCI->APIC IRQ transform: 0000:00:1f.1[A] -> IRQ 18
PCI->APIC IRQ transform: 0000:00:1f.2[A] -> IRQ 18
PCI->APIC IRQ transform: 0000:00:1f.3[B] -> IRQ 17
PCI->APIC IRQ transform: 0000:02:00.0[A] -> IRQ 16
PCI->APIC IRQ transform: 0000:04:02.0[A] -> IRQ 17
PCI->APIC IRQ transform: 0000:04:03.0[A] -> IRQ 16
PCI: Bridge: 0000:00:02.0
  IO window: disabled.
  MEM window: disabled.
  PREFETCH window: disabled.
PCI: Bridge: 0000:00:03.0
  IO window: d000-dfff
Time: tsc clocksource has been installed.
  MEM window: dee00000-deefffff
  PREFETCH window: disabled.
PCI: Bridge: 0000:00:1c.0
  IO window: disabled.
  MEM window: disabled.
  PREFETCH window: disabled.
PCI: Bridge: 0000:00:1e.0
  IO window: e000-efff
  MEM window: def00000-dfffffff
  PREFETCH window: disabled.
PCI: Setting latency timer of device 0000:00:02.0 to 64
PCI: Setting latency timer of device 0000:00:03.0 to 64
PCI: Setting latency timer of device 0000:00:1e.0 to 64
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 7, 524288 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
highmem bounce pool size: 64 pages
io scheduler noop registered
io scheduler anticipatory registered (default)
Boot video device is 0000:04:02.0
Real Time Clock Driver v1.12ac
Non-volatile memory driver v1.2
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
loop: module loaded
Driver 'sd' needs updating - please use bus_type methods
ata_piix 0000:00:1f.1: version 2.12
PCI: Setting latency timer of device 0000:00:1f.1 to 64
scsi0 : ata_piix
scsi1 : ata_piix
ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0xfc00 irq 14
ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0xfc08 irq 15
ata1.00: ATAPI: TEAC DV-516G, F4S6, max UDMA/33
ata1.00: configured for UDMA/33
scsi 0:0:0:0: CD-ROM            TEAC     DV-516G          F4S6 PQ: 0 ANSI: 5
ata_piix 0000:00:1f.2: MAP [ P0 -- P1 -- ]
PCI: Setting latency timer of device 0000:00:1f.2 to 64
scsi2 : ata_piix
scsi3 : ata_piix
ata3: SATA max UDMA/133 cmd 0xc800 ctl 0xc480 bmdma 0xc000 irq 18
ata4: SATA max UDMA/133 cmd 0xc400 ctl 0xc080 bmdma 0xc008 irq 18
ata4.00: ATA-7: ST3200826AS, 3.03, max UDMA/133
ata4.00: 390721968 sectors, multi 16: LBA48 NCQ (depth 0/32)
ata4.00: configured for UDMA/133
scsi 3:0:0:0: Direct-Access     ATA      ST3200826AS      3.03 PQ: 0 ANSI: 5
sd 3:0:0:0: [sda] 390721968 512-byte hardware sectors (200050 MB)
sd 3:0:0:0: [sda] Write Protect is off
sd 3:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 3:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sd 3:0:0:0: [sda] 390721968 512-byte hardware sectors (200050 MB)
sd 3:0:0:0: [sda] Write Protect is off
sd 3:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 3:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1 sda2 sda3 sda4 < sda5 >
sd 3:0:0:0: [sda] Attached SCSI disk
serio: i8042 KBD port at 0x60,0x64 irq 1
serio: i8042 AUX port at 0x60,0x64 irq 12
usbcore: registered new interface driver usbhid
drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Using IPI Shortcut mode
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 168k freed
warning: process `kmodule' used the deprecated sysctl system call with 1.23.
Intel(R) PRO/1000 Network Driver - version 7.3.20-k2-NAPI
Copyright (c) 1999-2006 Intel Corporation.
e1000: 0000:04:03.0: e1000_probe: (PCI:33MHz:32-bit) 00:0e:0c:3b:d8:8b
e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
PCI: Setting latency timer of device 0000:02:00.0 to 64
sky2 0000:02:00.0: v1.21 addr 0xdeefc000 irq 16 Yukon-EC (0xb6) rev 2
sky2 eth1: addr 00:0e:0c:3b:d8:8a
intel_rng: FWH not detected
EXT3 FS on sda2, internal journal
kjournald starting.  Commit interval 5 seconds
EXT3 FS on sda1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
warning: process `kudzu' used the deprecated sysctl system call with 1.23.
warning: process `kudzu' used the deprecated sysctl system call with 1.49.
warning: process `kudzu' used the deprecated sysctl system call with 1.49.
e1000: eth0: e1000_watchdog: NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX

[-- Attachment #4: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #5: Type: text/plain, Size: 164 bytes --]

_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel

^ permalink raw reply

* Re: [PATCH] Add IPv6 support to TCP SYN cookies
From: Andi Kleen @ 2008-02-06  7:50 UTC (permalink / raw)
  To: Glenn Griffin
  Cc: Alan Cox, Evgeniy Polyakov, Andi Kleen, netdev, linux-kernel
In-Reply-To: <47a91136.24528c0a.1f6d.ffffa476@mx.google.com>

> +static __init int init_syncookies(void)
> +{
> +	get_random_bytes(syncookie_secret, sizeof(syncookie_secret));
> +	return 0;
> +}
> +module_init(init_syncookies);

I didn't think a module could have multiple module_inits. Are you
sure that works?

-Andi


^ permalink raw reply

* Re: [e1000][net-2.6 tree] Regression: driver doesn't detect card on my node.
From: Pavel Emelyanov @ 2008-02-06  7:27 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Kok, Auke, e1000-devel, Linux Netdev List, jesse.brandeburg,
	john.ronciak, Thomas Gleixner, jeffrey.t.kirsher, Denis Lunev,
	Ingo Molnar, David Miller, Justin Piszcz
In-Reply-To: <200802050943.01652.yinghai.lu@sun.com>

Yinghai Lu wrote:
> On Tuesday 05 February 2008 09:24:17 am Kok, Auke wrote:
>> [Added Ingo, Thomas, Justin who signed off on the patch/tested it]
>>
>> Pavel Emelyanov wrote:
>>> The commit
>>>
>>> 	093af8d7f0ba3c6be1485973508584ef081e9f93
>>> 	x86_32: trim memory by updating e820
>>>
>>> broke my e1000 card: on loading driver says that
>>>
>>> 	e1000: probe of 0000:04:03.0 failed with error -5
>>>
>>> and the interface doesn't appear.
>>>
>>> With this commit reset everything is OK.
>>>
>>> lspci output:
>>> 04:03.0 Ethernet controller: Intel Corporation 82541GI Gigabit Ethernet Controller (rev 05)
>>> lspci -n output:
>>> 04:03.0 Class 0200: 8086:1076 (rev 05)
>>>
>>> My colleague Denis Lunev has e1000 adapter too, but doesn't
>>> experience such problems.
>>>
>>> What other info from me is required?

Upd: booting with disable_mtrr_trim option helps.

> 
> boot log please. with the patch and reverting the patch.
> 
> Thanks
> 
> YH
> 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply

* [BUG][AX25] Fwd: SMP with AX.25
From: Jarek Poplawski @ 2008-02-06  7:45 UTC (permalink / raw)
  To: netdev; +Cc: Ralf Baechle, Jann Traschewski

[-- Attachment #1: Type: text/plain, Size: 66 bytes --]

Hi,

Here is attached a message I got with AX25 oopses.

Jarek P.

[-- Attachment #2: Type: message/rfc822, Size: 73123 bytes --]

[-- Attachment #2.1.1.1: Type: text/plain, Size: 599 bytes --]

Witam Jarek,

my name is Jann Traschewski, DG8NGN and I run the AMPR-Gateway and heavy
used Packet Radio Node DB0FHN on a HP Netserver Dual CPU Server. I'm in
contact with Ralf, DL5RB in WW-Convers talking about the Kernel AX.25 stuff.
Maybe you are also interested on my problems using SMP on my big machine
(see Attachment) with Kernel 2.6.24. Do you want to have an account on the
machine?

73,
Jann


--
Jann Traschewski, Drosselstr.1, D-90513 Zirndorf, Germany
Tel.: +49-911-696971, Mobile: +49-170-1045937, EMail: jann@gmx.de
Ham: DG8NGN / DB0VOX, http://www.qsl.net/db0fhn, ICQ UIN: 4130182 

[-- Attachment #2.1.1.2: db0fhn3.png --]
[-- Type: image/png, Size: 16778 bytes --]

[-- Attachment #2.1.1.3: db0fhn.png --]
[-- Type: image/png, Size: 14364 bytes --]

[-- Attachment #2.1.1.4: db0fhn2.png --]
[-- Type: image/png, Size: 17395 bytes --]

[-- Attachment #2.1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3161 bytes --]

^ permalink raw reply

* [PATCH] virtio_net: Fix open <-> interrupt race
From: Christian Borntraeger @ 2008-02-06  7:50 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Rusty Russell, netdev, virtualization
In-Reply-To: <200802061500.04138.rusty@rustcorp.com.au>

Jeff,

Rusty is (supposed to be) on vacation. Can you send this fix against
virtio_net with your next network driver fixes for 2.6.25? 

Thank you

-

I got the following oops during interface ifup. Unfortunately its not 
easily reproducable so I cant say for sure that my fix fixes this
problem, but I am confident and I think its correct anyway:

   <2>kernel BUG at /space/kvm/drivers/virtio/virtio_ring.c:234!
    <4>illegal operation: 0001 [#1] PREEMPT SMP
    <4>Modules linked in:
    <4>CPU: 0 Not tainted 2.6.24zlive-guest-07293-gf1ca151-dirty #91
    <4>Process swapper (pid: 0, task: 0000000000800938, ksp: 000000000084ddb8)
    <4>Krnl PSW : 0404300180000000 0000000000466374 (vring_disable_cb+0x30/0x34)
    <4>           R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:0 CC:3 PM:0 EA:3
    <4>Krnl GPRS: 0000000000000001 0000000000000001 0000000010003800 0000000000466344
    <4>           000000000e980900 00000000008848b0 000000000084e748 0000000000000000
    <4>           000000000087b300 0000000000001237 0000000000001237 000000000f85bdd8
    <4>           000000000e980920 00000000001137c0 0000000000464754 000000000f85bdd8
    <4>Krnl Code: 0000000000466368: e3b0b0700004        lg      %r11,112(%r11)
    <4>           000000000046636e: 07fe                bcr     15,%r14
    <4>           0000000000466370: a7f40001            brc     15,466372
    <4>          >0000000000466374: a7f4fff6            brc     15,466360
    <4>           0000000000466378: eb7ff0500024        stmg    %r7,%r15,80(%r15)
    <4>           000000000046637e: a7f13e00            tmll    %r15,15872
    <4>           0000000000466382: b90400ef            lgr     %r14,%r15
    <4>           0000000000466386: a7840001            brc     8,466388
    <4>Call Trace:
    <4>([<000201500f85c000>] 0x201500f85c000)
    <4> [<0000000000466556>] vring_interrupt+0x72/0x88
    <4> [<00000000004801a0>] kvm_extint_handler+0x34/0x44
    <4> [<000000000010d22c>] do_extint+0xbc/0xf8
    <4> [<0000000000113f98>] ext_no_vtime+0x16/0x1a
    <4> [<000000000010a182>] cpu_idle+0x216/0x238
    <4>([<000000000010a162>] cpu_idle+0x1f6/0x238)
    <4> [<0000000000568656>] rest_init+0xaa/0xb8
    <4> [<000000000084ee2c>] start_kernel+0x3fc/0x490
    <4> [<0000000000100020>] _stext+0x20/0x80
    <4>
    <4> <0>Kernel panic - not syncing: Fatal exception in interrupt
    <4>

After looking at the code and the dump I think the following scenario
happened: Ifup was running on cpu2 and the interrupt arrived on cpu0.
Now virtnet_open on cpu 2 managed to execute napi_enable and disable_cb
but did not execute rx_schedule. Meanwhile on cpu 0 skb_recv_done was
called by vring_interrupt, executed netif_rx_schedule_prep, which
succeeded and therefore called disable_cb. This triggered the BUG_ON,
as interrupts were already disabled by cpu 2.

I think the proper solution is to make the call to disable_cb depend on
the atomic update of NAPI_STATE_SCHED by using netif_rx_schedule_prep
in the same way as skb_recv_done. 


Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>

---
 drivers/net/virtio_net.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Index: kvm/drivers/net/virtio_net.c
===================================================================
--- kvm.orig/drivers/net/virtio_net.c
+++ kvm/drivers/net/virtio_net.c
@@ -321,10 +321,12 @@ static int virtnet_open(struct net_devic
 
 	/* If all buffers were filled by other side before we napi_enabled, we
 	 * won't get another interrupt, so process any outstanding packets
-	 * now.  virtnet_poll wants re-enable the queue, so we disable here. */
-	vi->rvq->vq_ops->disable_cb(vi->rvq);
-	netif_rx_schedule(vi->dev, &vi->napi);
-
+	 * now.  virtnet_poll wants re-enable the queue, so we disable here.
+	 * We synchronize against interrupts via NAPI_STATE_SCHED */
+	if (netif_rx_schedule_prep(dev, &vi->napi)) {
+		vi->rvq->vq_ops->disable_cb(vi->rvq);
+		__netif_rx_schedule(dev, &vi->napi);
+	}
 	return 0;
 }
 

^ permalink raw reply

* [PATCH][AX25] Fwd: SMP with AX.25
From: Jarek Poplawski @ 2008-02-06  8:15 UTC (permalink / raw)
  To: netdev; +Cc: Ralf Baechle, Jann Traschewski, David Miller
In-Reply-To: <20080206074529.GC4496@ff.dom.local>

On Wed, Feb 06, 2008 at 07:45:29AM +0000, Jarek Poplawski wrote:
...
> From: Jann Traschewski <jann@gmx.de>
> Subject: SMP with AX.25


[AX25] ax25_timer: use mod_timer instead of add_timer

According to one of Jann's OOPS reports it looks like
BUG_ON(timer_pending(timer)) triggers during add_timer()
in ax25_start_t1timer(). This patch changes current use
of: init_timer(), add_timer() and del_timer() to
setup_timer() with mod_timer(), which should be safer
anyway.


Reported-by: Jann Traschewski <jann@gmx.de>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>

---

 include/net/ax25.h    |    1 +
 net/ax25/af_ax25.c    |    6 +----
 net/ax25/ax25_timer.c |   60 +++++++++++++++++-------------------------------
 3 files changed, 23 insertions(+), 44 deletions(-)

diff --git a/include/net/ax25.h b/include/net/ax25.h
index 32a57e1..3f0236f 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -416,6 +416,7 @@ extern void ax25_calculate_rtt(ax25_cb *);
 extern void ax25_disconnect(ax25_cb *, int);
 
 /* ax25_timer.c */
+extern void ax25_setup_timers(ax25_cb *);
 extern void ax25_start_heartbeat(ax25_cb *);
 extern void ax25_start_t1timer(ax25_cb *);
 extern void ax25_start_t2timer(ax25_cb *);
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index 8fc64e3..94b2b1b 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -510,11 +510,7 @@ ax25_cb *ax25_create_cb(void)
 	skb_queue_head_init(&ax25->ack_queue);
 	skb_queue_head_init(&ax25->reseq_queue);
 
-	init_timer(&ax25->timer);
-	init_timer(&ax25->t1timer);
-	init_timer(&ax25->t2timer);
-	init_timer(&ax25->t3timer);
-	init_timer(&ax25->idletimer);
+	ax25_setup_timers(ax25);
 
 	ax25_fillin_cb(ax25, NULL);
 
diff --git a/net/ax25/ax25_timer.c b/net/ax25/ax25_timer.c
index 7259486..db29ea7 100644
--- a/net/ax25/ax25_timer.c
+++ b/net/ax25/ax25_timer.c
@@ -40,63 +40,45 @@ static void ax25_t2timer_expiry(unsigned long);
 static void ax25_t3timer_expiry(unsigned long);
 static void ax25_idletimer_expiry(unsigned long);
 
-void ax25_start_heartbeat(ax25_cb *ax25)
+void ax25_setup_timers(ax25_cb *ax25)
 {
-	del_timer(&ax25->timer);
-
-	ax25->timer.data     = (unsigned long)ax25;
-	ax25->timer.function = &ax25_heartbeat_expiry;
-	ax25->timer.expires  = jiffies + 5 * HZ;
+	setup_timer(&ax25->timer, ax25_heartbeat_expiry, (unsigned long)ax25);
+	setup_timer(&ax25->t1timer, ax25_t1timer_expiry, (unsigned long)ax25);
+	setup_timer(&ax25->t2timer, ax25_t2timer_expiry, (unsigned long)ax25);
+	setup_timer(&ax25->t3timer, ax25_t3timer_expiry, (unsigned long)ax25);
+	setup_timer(&ax25->idletimer, ax25_idletimer_expiry,
+		    (unsigned long)ax25);
+}
 
-	add_timer(&ax25->timer);
+void ax25_start_heartbeat(ax25_cb *ax25)
+{
+	mod_timer(&ax25->timer, jiffies + 5 * HZ);
 }
 
 void ax25_start_t1timer(ax25_cb *ax25)
 {
-	del_timer(&ax25->t1timer);
-
-	ax25->t1timer.data     = (unsigned long)ax25;
-	ax25->t1timer.function = &ax25_t1timer_expiry;
-	ax25->t1timer.expires  = jiffies + ax25->t1;
-
-	add_timer(&ax25->t1timer);
+	mod_timer(&ax25->t1timer, jiffies + ax25->t1);
 }
 
 void ax25_start_t2timer(ax25_cb *ax25)
 {
-	del_timer(&ax25->t2timer);
-
-	ax25->t2timer.data     = (unsigned long)ax25;
-	ax25->t2timer.function = &ax25_t2timer_expiry;
-	ax25->t2timer.expires  = jiffies + ax25->t2;
-
-	add_timer(&ax25->t2timer);
+	mod_timer(&ax25->t2timer, jiffies + ax25->t2);
 }
 
 void ax25_start_t3timer(ax25_cb *ax25)
 {
-	del_timer(&ax25->t3timer);
-
-	if (ax25->t3 > 0) {
-		ax25->t3timer.data     = (unsigned long)ax25;
-		ax25->t3timer.function = &ax25_t3timer_expiry;
-		ax25->t3timer.expires  = jiffies + ax25->t3;
-
-		add_timer(&ax25->t3timer);
-	}
+	if (ax25->t3 > 0)
+		mod_timer(&ax25->t3timer, jiffies + ax25->t3);
+	else
+		del_timer(&ax25->t3timer);
 }
 
 void ax25_start_idletimer(ax25_cb *ax25)
 {
-	del_timer(&ax25->idletimer);
-
-	if (ax25->idle > 0) {
-		ax25->idletimer.data     = (unsigned long)ax25;
-		ax25->idletimer.function = &ax25_idletimer_expiry;
-		ax25->idletimer.expires  = jiffies + ax25->idle;
-
-		add_timer(&ax25->idletimer);
-	}
+	if (ax25->idle > 0)
+		mod_timer(&ax25->idletimer, jiffies + ax25->idle);
+	else
+		del_timer(&ax25->idletimer);
 }
 
 void ax25_stop_heartbeat(ax25_cb *ax25)

^ permalink raw reply related

* Re: [e1000][net-2.6 tree] Regression: driver doesn't detect card on my node.
From: Yinghai Lu @ 2008-02-06  8:20 UTC (permalink / raw)
  To: Pavel Emelyanov
  Cc: Kok, Auke, jesse.brandeburg, jeffrey.t.kirsher, john.ronciak,
	David Miller, Linux Netdev List, e1000-devel, Denis Lunev,
	Justin Piszcz, Ingo Molnar, Thomas Gleixner
In-Reply-To: <47A95D60.5090203@openvz.org>

On Tuesday 05 February 2008 11:10:24 pm Pavel Emelyanov wrote:
> [snip]
> 
> >>> What other info from me is required?
> > 
> > boot log please. with the patch and reverting the patch.
> 
> Here they are (attached).
> BTW, I found, that the sky2 adapter is broken by this patch as well.
> To simplify the analysis, here's their diff:
> 
> --- bad-log	2008-02-06 10:06:40.000000000 +0300
> +++ good-log	2008-02-06 10:06:40.000000000 +0300
> @@ -1,4 +1,4 @@
> -Linux version 2.6.24 (pavel@xemulnb) (gcc version 4.1.3 20070724 (prerelease) (SUSE Linux)) #22 SMP Tue Feb 5 20:09:11 MSK 2008
> +Linux version 2.6.24 (pavel@xemulnb) (gcc version 4.1.3 20070724 (prerelease) (SUSE Linux)) #23 SMP Wed Feb 6 10:03:53 MSK 2008
>  BIOS-provided physical RAM map:
>   BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
>   BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
> @@ -19,29 +19,6 @@ Scan SMP from c0000000 for 1024 bytes.
>  Scan SMP from c009fc00 for 1024 bytes.
>  Scan SMP from c00f0000 for 65536 bytes.
>  found SMP MP-table at [c00ff780] 000ff780
> -***************
> -**** WARNING: likely BIOS bug
> -**** MTRRs don't cover all of memory, trimmed 786432 pages
> -***************
> -update e820 for mtrr
> -modified physical RAM map:
> - modified: 0000000000000000 - 000000000009f800 (usable)
> - modified: 000000000009f800 - 00000000000a0000 (reserved)
> - modified: 00000000000e0000 - 0000000000100000 (reserved)
> - modified: 0000000000100000 - 0000000040000000 (usable)
> - modified: 0000000040000000 - 00000000bfff0000 (reserved)
> - modified: 00000000bfff0000 - 00000000bffff000 (ACPI data)
> - modified: 00000000bffff000 - 00000000c0000000 (ACPI NVS)
> - modified: 00000000c0000000 - 0000000100000000 (reserved)
> - modified: 0000000100000000 - 0000000140000000 (usable)

the root cause could be your mtrr last entry for RAM has strange type

please apply the following line to print the mtrr before trimming to current linus tree.

Thanks

YH

diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index 1e27b69..c0c44e0 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -680,6 +680,7 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
 	/* Find highest cached pfn */
 	for (i = 0; i < num_var_ranges; i++) {
 		mtrr_if->get(i, &base, &size, &type);
+		printk(KERN_INFO "i=%d %lx - %lx %d\n", i, base, base + size, type);
 		if (type != MTRR_TYPE_WRBACK)
 			continue;
 		base <<= PAGE_SHIFT;

^ permalink raw reply related

* Re: [PATCH] Add IPv6 support to TCP SYN cookies
From: Andi Kleen @ 2008-02-06  8:53 UTC (permalink / raw)
  To: Ross Vandegrift; +Cc: Andi Kleen, Glenn Griffin, netdev, linux-kernel
In-Reply-To: <20080205212335.GA11287@kallisti.us>

> I work at a hosting company and we see these kinds of issues in the
> real world fairly frequently.  I would guess maybe a monthly basis.
> The servers where we have seen this are typically running RHEL 4 or 5
> kernels, so I can't really speak to how recent the kernel is in this
> specific term.

RHEL5 should be recent enough.

> 
> If I can find a box that we could temporary get a kernel.org kernel
> on, I'll see if I can get a real comparison together.  We have
> collected a few of the more effective attack tools that have been left
> on compromised systems, so it wouldn't be too difficult to get some
> numbers.

That would be useful yes -- for different bandwidths.

If the young/old heuristics do not work well enough anymore most likely we should
try readding RED to the syn queue again. That used to be pretty effective
in the early days. I don't quite remember why Linux didn't end up using it
in fact.

-Andi


^ permalink raw reply

* Re: locking api self-test hanging
From: Andrew Morton @ 2008-02-06  8:34 UTC (permalink / raw)
  To: netdev, Ingo Molnar, linux-kernel, Stephen Hemminger
In-Reply-To: <20080204044304.d244e761.akpm@linux-foundation.org>

On Mon, 4 Feb 2008 04:43:04 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:

> On Sun, 3 Feb 2008 15:07:44 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> > On Sun, 3 Feb 2008 15:02:46 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
> > 
> > > 
> > > With current mainline I'm getting intermittent hangs here:
> > > 
> > > 	http://userweb.kernel.org/~akpm/p2033590.jpg
> > > 
> > > with this config:
> > > 
> > > 	http://userweb.kernel.org/~akpm/config-sony.txt
> > > 
> > > on the Vaio.  Sometimes it boots (then hits another different hang),
> > > sometimes it gets stuck there.
> 
> CONFIG_DEBUG_LOCKING_API_SELFTESTS=n fixed that up.
> 
> > 
> > The second hang is in kobject_uevent_init().  All that function does is call
> > netlink_kernel_create().
> 
> And I've fully bisected this hang twice and both times came up with
> 
> commit 33f807ba0d9259e7c75c7a2ce8bd2787e5b540c7
> Author: Stephen Hemminger <shemminger@linux-foundation.org>
> Date:   Mon Nov 19 19:24:52 2007 -0800
> 
>     [NETPOLL]: Kill NETPOLL_RX_DROP, set but never tested.
> 
> which is stupid because that patch doesn't do anything.
> 
> However I am using netconsole-over-e100 and the hang does go away when I
> disable netconsole on the kernel boot command line.
> 
> I'd say it's some timing thing in netpoll/netconsole/napi/etc.
> 

I'm seeing this netconsole hang on a second machine now.  Current
mainline.  It also has e100.  This one is SMP ancient PIII.

Config: http://userweb.kernel.org/~akpm/config-vmm.txt


^ permalink raw reply

* Re: [e1000][net-2.6 tree] Regression: driver doesn't detect card on my node.
From: Pavel Emelyanov @ 2008-02-06  8:41 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Kok, Auke, e1000-devel, Linux Netdev List, jesse.brandeburg,
	john.ronciak, Thomas Gleixner, jeffrey.t.kirsher, Denis Lunev,
	Ingo Molnar, David Miller, Justin Piszcz
In-Reply-To: <200802060020.25492.yinghai.lu@sun.com>

Yinghai Lu wrote:
> On Tuesday 05 February 2008 11:10:24 pm Pavel Emelyanov wrote:
>> [snip]
>>
>>>>> What other info from me is required?
>>> boot log please. with the patch and reverting the patch.
>> Here they are (attached).
>> BTW, I found, that the sky2 adapter is broken by this patch as well.
>> To simplify the analysis, here's their diff:
>>
>> --- bad-log	2008-02-06 10:06:40.000000000 +0300
>> +++ good-log	2008-02-06 10:06:40.000000000 +0300
>> @@ -1,4 +1,4 @@
>> -Linux version 2.6.24 (pavel@xemulnb) (gcc version 4.1.3 20070724 (prerelease) (SUSE Linux)) #22 SMP Tue Feb 5 20:09:11 MSK 2008
>> +Linux version 2.6.24 (pavel@xemulnb) (gcc version 4.1.3 20070724 (prerelease) (SUSE Linux)) #23 SMP Wed Feb 6 10:03:53 MSK 2008
>>  BIOS-provided physical RAM map:
>>   BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
>>   BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
>> @@ -19,29 +19,6 @@ Scan SMP from c0000000 for 1024 bytes.
>>  Scan SMP from c009fc00 for 1024 bytes.
>>  Scan SMP from c00f0000 for 65536 bytes.
>>  found SMP MP-table at [c00ff780] 000ff780
>> -***************
>> -**** WARNING: likely BIOS bug
>> -**** MTRRs don't cover all of memory, trimmed 786432 pages
>> -***************
>> -update e820 for mtrr
>> -modified physical RAM map:
>> - modified: 0000000000000000 - 000000000009f800 (usable)
>> - modified: 000000000009f800 - 00000000000a0000 (reserved)
>> - modified: 00000000000e0000 - 0000000000100000 (reserved)
>> - modified: 0000000000100000 - 0000000040000000 (usable)
>> - modified: 0000000040000000 - 00000000bfff0000 (reserved)
>> - modified: 00000000bfff0000 - 00000000bffff000 (ACPI data)
>> - modified: 00000000bffff000 - 00000000c0000000 (ACPI NVS)
>> - modified: 00000000c0000000 - 0000000100000000 (reserved)
>> - modified: 0000000100000000 - 0000000140000000 (usable)
> 
> the root cause could be your mtrr last entry for RAM has strange type
> 
> please apply the following line to print the mtrr before trimming to current linus tree.

OK, here's the dmesg diff:
--- bad-log     2008-02-06 10:01:21.000000000 +0300
+++ bad-log-info        2008-02-06 11:37:51.000000000 +0300
@@ -19,6 +19,14 @@ Scan SMP from c0000000 for 1024 bytes.
 Scan SMP from c009fc00 for 1024 bytes.
 Scan SMP from c00f0000 for 65536 bytes.
 found SMP MP-table at [c00ff780] 000ff780
+i=0 c0000 - 100000 0
+i=1 0 - 100000 6
+i=2 100000 - 140000 6
+i=3 0 - 0 0
+i=4 0 - 0 0
+i=5 0 - 0 0
+i=6 0 - 0 0
+i=7 0 - 0 0
 ***************
 **** WARNING: likely BIOS bug
 **** MTRRs don't cover all of memory, trimmed 786432 pages


> Thanks
> 
> YH
> 
> diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
> index 1e27b69..c0c44e0 100644
> --- a/arch/x86/kernel/cpu/mtrr/main.c
> +++ b/arch/x86/kernel/cpu/mtrr/main.c
> @@ -680,6 +680,7 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
>  	/* Find highest cached pfn */
>  	for (i = 0; i < num_var_ranges; i++) {
>  		mtrr_if->get(i, &base, &size, &type);
> +		printk(KERN_INFO "i=%d %lx - %lx %d\n", i, base, base + size, type);
>  		if (type != MTRR_TYPE_WRBACK)
>  			continue;
>  		base <<= PAGE_SHIFT;
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply

* [PATCH][AX25] ax25_ds_timer: use mod_timer instead of add_timer
From: Jarek Poplawski @ 2008-02-06  9:14 UTC (permalink / raw)
  To: netdev; +Cc: Ralf Baechle, Jann Traschewski, David Miller
In-Reply-To: <20080206081509.GD4496@ff.dom.local>

On Wed, Feb 06, 2008 at 08:15:09AM +0000, Jarek Poplawski wrote:
> On Wed, Feb 06, 2008 at 07:45:29AM +0000, Jarek Poplawski wrote:
> ...
> > From: Jann Traschewski <jann@gmx.de>
> > Subject: SMP with AX.25
...


[AX25] ax25_ds_timer: use mod_timer instead of add_timer

This patch changes current use of: init_timer(), add_timer()
and del_timer() to setup_timer() with mod_timer(), which
should be safer anyway.


Reported-by: Jann Traschewski <jann@gmx.de>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>

---

 include/net/ax25.h       |    1 +
 net/ax25/ax25_dev.c      |    2 +-
 net/ax25/ax25_ds_timer.c |   12 ++++--------
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/include/net/ax25.h b/include/net/ax25.h
index 3f0236f..717e219 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -324,6 +324,7 @@ extern void ax25_dama_on(ax25_cb *);
 extern void ax25_dama_off(ax25_cb *);
 
 /* ax25_ds_timer.c */
+extern void ax25_ds_setup_timer(ax25_dev *);
 extern void ax25_ds_set_timer(ax25_dev *);
 extern void ax25_ds_del_timer(ax25_dev *);
 extern void ax25_ds_timer(ax25_cb *);
diff --git a/net/ax25/ax25_dev.c b/net/ax25/ax25_dev.c
index 528c874..a7a0e0c 100644
--- a/net/ax25/ax25_dev.c
+++ b/net/ax25/ax25_dev.c
@@ -82,7 +82,7 @@ void ax25_dev_device_up(struct net_device *dev)
 	ax25_dev->values[AX25_VALUES_DS_TIMEOUT]= AX25_DEF_DS_TIMEOUT;
 
 #if defined(CONFIG_AX25_DAMA_SLAVE) || defined(CONFIG_AX25_DAMA_MASTER)
-	init_timer(&ax25_dev->dama.slave_timer);
+	ax25_ds_setup_timer(ax25_dev);
 #endif
 
 	spin_lock_bh(&ax25_dev_lock);
diff --git a/net/ax25/ax25_ds_timer.c b/net/ax25/ax25_ds_timer.c
index c4e3b02..2ce79df 100644
--- a/net/ax25/ax25_ds_timer.c
+++ b/net/ax25/ax25_ds_timer.c
@@ -40,13 +40,10 @@ static void ax25_ds_timeout(unsigned long);
  *	1/10th of a second.
  */
 
-static void ax25_ds_add_timer(ax25_dev *ax25_dev)
+void ax25_ds_setup_timer(ax25_dev *ax25_dev)
 {
-	struct timer_list *t = &ax25_dev->dama.slave_timer;
-	t->data		= (unsigned long) ax25_dev;
-	t->function	= &ax25_ds_timeout;
-	t->expires	= jiffies + HZ;
-	add_timer(t);
+	setup_timer(&ax25_dev->dama.slave_timer, ax25_ds_timeout,
+		    (unsigned long)ax25_dev);
 }
 
 void ax25_ds_del_timer(ax25_dev *ax25_dev)
@@ -60,10 +57,9 @@ void ax25_ds_set_timer(ax25_dev *ax25_dev)
 	if (ax25_dev == NULL)		/* paranoia */
 		return;
 
-	del_timer(&ax25_dev->dama.slave_timer);
 	ax25_dev->dama.slave_timeout =
 		msecs_to_jiffies(ax25_dev->values[AX25_VALUES_DS_TIMEOUT]) / 10;
-	ax25_ds_add_timer(ax25_dev);
+	mod_timer(&ax25_dev->dama.slave_timer, jiffies + HZ);
 }
 
 /*

^ permalink raw reply related

* Re: [PATCH] Add IPv6 support to TCP SYN cookies
From: Evgeniy Polyakov @ 2008-02-06  9:13 UTC (permalink / raw)
  To: Glenn Griffin; +Cc: Alan Cox, Andi Kleen, netdev, linux-kernel
In-Reply-To: <47a91136.24528c0a.1f6d.ffffa476@mx.google.com>

On Tue, Feb 05, 2008 at 05:52:31PM -0800, Glenn Griffin (ggriffin.kernel@gmail.com) wrote:
> +static u32 cookie_hash(struct in6_addr *saddr, struct in6_addr *daddr,
> +		       __be16 sport, __be16 dport, u32 count, int c)
> +{
> +	__u32 tmp[16 + 5 + SHA_WORKSPACE_WORDS];

This huge buffer should not be allocated on stack.


-- 
	Evgeniy Polyakov

^ permalink raw reply

* Re: locking api self-test hanging
From: Andrew Morton @ 2008-02-06  9:16 UTC (permalink / raw)
  To: netdev, Ingo Molnar, linux-kernel, Stephen Hemminger
In-Reply-To: <20080206003412.dca555d4.akpm@linux-foundation.org>

On Wed, 6 Feb 2008 00:34:12 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:

> On Mon, 4 Feb 2008 04:43:04 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> > On Sun, 3 Feb 2008 15:07:44 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
> > 
> > > On Sun, 3 Feb 2008 15:02:46 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
> > > 
> > > > 
> > > > With current mainline I'm getting intermittent hangs here:
> > > > 
> > > > 	http://userweb.kernel.org/~akpm/p2033590.jpg
> > > > 
> > > > with this config:
> > > > 
> > > > 	http://userweb.kernel.org/~akpm/config-sony.txt
> > > > 
> > > > on the Vaio.  Sometimes it boots (then hits another different hang),
> > > > sometimes it gets stuck there.
> > 
> > CONFIG_DEBUG_LOCKING_API_SELFTESTS=n fixed that up.
> > 
> > > 
> > > The second hang is in kobject_uevent_init().  All that function does is call
> > > netlink_kernel_create().
> > 
> > And I've fully bisected this hang twice and both times came up with
> > 
> > commit 33f807ba0d9259e7c75c7a2ce8bd2787e5b540c7
> > Author: Stephen Hemminger <shemminger@linux-foundation.org>
> > Date:   Mon Nov 19 19:24:52 2007 -0800
> > 
> >     [NETPOLL]: Kill NETPOLL_RX_DROP, set but never tested.
> > 
> > which is stupid because that patch doesn't do anything.
> > 
> > However I am using netconsole-over-e100 and the hang does go away when I
> > disable netconsole on the kernel boot command line.
> > 
> > I'd say it's some timing thing in netpoll/netconsole/napi/etc.
> > 
> 
> I'm seeing this netconsole hang on a second machine now.  Current
> mainline.  It also has e100.  This one is SMP ancient PIII.
> 
> Config: http://userweb.kernel.org/~akpm/config-vmm.txt
> 

I can reproduce this on a third machine: the t61p laptop: dual x86_64 with
e1000.

It seems to need quite a lot of printk activity to make it happen.  Turning
on initcall_debug is a suitable way of triggering it.


^ permalink raw reply

* Re: [e1000][net-2.6 tree] Regression: driver doesn't detect card on my node.
From: Yinghai Lu @ 2008-02-06  9:19 UTC (permalink / raw)
  To: Pavel Emelyanov
  Cc: Kok, Auke, e1000-devel, Linux Netdev List, jesse.brandeburg,
	john.ronciak, Thomas Gleixner, jeffrey.t.kirsher, Denis Lunev,
	Ingo Molnar, David Miller, Justin Piszcz
In-Reply-To: <47A972AB.5060107@openvz.org>

On Wednesday 06 February 2008 12:41:15 am Pavel Emelyanov wrote:
> Yinghai Lu wrote:
> > On Tuesday 05 February 2008 11:10:24 pm Pavel Emelyanov wrote:
> >> [snip]
> >>
> >>>>> What other info from me is required?
> >>> boot log please. with the patch and reverting the patch.
> >> Here they are (attached).
> >> BTW, I found, that the sky2 adapter is broken by this patch as well.
> >> To simplify the analysis, here's their diff:
> >>
> >> --- bad-log	2008-02-06 10:06:40.000000000 +0300
> >> +++ good-log	2008-02-06 10:06:40.000000000 +0300
> >> @@ -1,4 +1,4 @@
> >> -Linux version 2.6.24 (pavel@xemulnb) (gcc version 4.1.3 20070724 (prerelease) (SUSE Linux)) #22 SMP Tue Feb 5 20:09:11 MSK 2008
> >> +Linux version 2.6.24 (pavel@xemulnb) (gcc version 4.1.3 20070724 (prerelease) (SUSE Linux)) #23 SMP Wed Feb 6 10:03:53 MSK 2008
> >>  BIOS-provided physical RAM map:
> >>   BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
> >>   BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
> >> @@ -19,29 +19,6 @@ Scan SMP from c0000000 for 1024 bytes.
> >>  Scan SMP from c009fc00 for 1024 bytes.
> >>  Scan SMP from c00f0000 for 65536 bytes.
> >>  found SMP MP-table at [c00ff780] 000ff780
> >> -***************
> >> -**** WARNING: likely BIOS bug
> >> -**** MTRRs don't cover all of memory, trimmed 786432 pages
> >> -***************
> >> -update e820 for mtrr
> >> -modified physical RAM map:
> >> - modified: 0000000000000000 - 000000000009f800 (usable)
> >> - modified: 000000000009f800 - 00000000000a0000 (reserved)
> >> - modified: 00000000000e0000 - 0000000000100000 (reserved)
> >> - modified: 0000000000100000 - 0000000040000000 (usable)
> >> - modified: 0000000040000000 - 00000000bfff0000 (reserved)
> >> - modified: 00000000bfff0000 - 00000000bffff000 (ACPI data)
> >> - modified: 00000000bffff000 - 00000000c0000000 (ACPI NVS)
> >> - modified: 00000000c0000000 - 0000000100000000 (reserved)
> >> - modified: 0000000100000000 - 0000000140000000 (usable)
> > 
> > the root cause could be your mtrr last entry for RAM has strange type
> > 
> > please apply the following line to print the mtrr before trimming to current linus tree.
> 
> OK, here's the dmesg diff:
> --- bad-log     2008-02-06 10:01:21.000000000 +0300
> +++ bad-log-info        2008-02-06 11:37:51.000000000 +0300
> @@ -19,6 +19,14 @@ Scan SMP from c0000000 for 1024 bytes.
>  Scan SMP from c009fc00 for 1024 bytes.
>  Scan SMP from c00f0000 for 65536 bytes.
>  found SMP MP-table at [c00ff780] 000ff780
> +i=0 c0000 - 100000 0
> +i=1 0 - 100000 6
> +i=2 100000 - 140000 6
> +i=3 0 - 0 0
> +i=4 0 - 0 0
> +i=5 0 - 0 0
> +i=6 0 - 0 0
> +i=7 0 - 0 0
>  ***************
>  **** WARNING: likely BIOS bug
>  **** MTRRs don't cover all of memory, trimmed 786432 pages

please try following patch

diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index 1e27b69..4e7490f 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -659,7 +659,7 @@ static __init int amd_special_default_mtrr(void)
  */
 int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
 {
-	unsigned long i, base, size, highest_addr = 0, def, dummy;
+	unsigned long i, base, size, highest_pfn = 0, def, dummy;
 	mtrr_type type;
 	u64 trim_start, trim_size;
 
@@ -682,28 +682,27 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
 		mtrr_if->get(i, &base, &size, &type);
 		if (type != MTRR_TYPE_WRBACK)
 			continue;
-		base <<= PAGE_SHIFT;
-		size <<= PAGE_SHIFT;
-		if (highest_addr < base + size)
-			highest_addr = base + size;
+		if (highest_pfn < base + size)
+			highest_pfn = base + size;
 	}
 
 	/* kvm/qemu doesn't have mtrr set right, don't trim them all */
-	if (!highest_addr) {
+	if (!highest_pfn) {
 		printk(KERN_WARNING "WARNING: strange, CPU MTRRs all blank?\n");
 		WARN_ON(1);
 		return 0;
 	}
 
-	if ((highest_addr >> PAGE_SHIFT) < end_pfn) {
+	if (highest_pfn < end_pfn) {
 		printk(KERN_WARNING "WARNING: BIOS bug: CPU MTRRs don't cover"
 			" all of memory, losing %LdMB of RAM.\n",
-			(((u64)end_pfn << PAGE_SHIFT) - highest_addr) >> 20);
+			(end_pfn - highest_pfn) >> (20 - PAGE_SHIFT));
 
 		WARN_ON(1);
 
 		printk(KERN_INFO "update e820 for mtrr\n");
-		trim_start = highest_addr;
+		trim_start = highest_pfn;
+		trim_start <<= PAGE_SHIFT;
 		trim_size = end_pfn;
 		trim_size <<= PAGE_SHIFT;
 		trim_size -= trim_start;

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox