Re: Unable to install 8.x on a PowerEdge R810

2010-07-29 Thread Sean Bruno
> Kind of a large patch, but in order to make an omlette, you need to
> break a few servers.
> 
> This is a diff against -CURRENT, not stable-8 as I didn't get a chance
> to test it.  It is directly based off of changes that peter@ made to the
> Yahoo FreeBSD 7 tree.
> 
> I have compile and boot tested this on my local machines, but I don't
> have 64 CPU machines to test upon.
> 
> Sean

Here is a patch version that applies to stable-8 at the moment.

I changed 2 more cases where the data types were wrong, one in a printf
and a case where a negative truth value was being used.

Sea

Index: sys/kern/subr_smp.c
===
--- sys/kern/subr_smp.c	(revision 210622)
+++ sys/kern/subr_smp.c	(working copy)
@@ -181,7 +181,7 @@
 	id = td->td_oncpu;
 	if (id == NOCPU)
 		return;
-	ipi_selected(1 << id, IPI_AST);
+	ipi_selected(cputomask(id), IPI_AST);
 }
 
 /*
@@ -318,7 +318,7 @@
 	CTR1(KTR_SMP, "restart_cpus(%x)", map);
 
 	/* signal other cpus to restart */
-	atomic_store_rel_int(&started_cpus, map);
+	atomic_store_rel_long(&started_cpus, map);
 
 	/* wait for each to clear its bit */
 	while ((stopped_cpus & map) != 0)
@@ -399,7 +399,7 @@
 		if (((1 << i) & map) != 0 && !CPU_ABSENT(i))
 			ncpus++;
 	if (ncpus == 0)
-		panic("ncpus is 0 with map=0x%x", map);
+		panic("ncpus is 0 with map=0x%lx", map);
 
 	/* obtain rendezvous lock */
 	mtx_lock_spin(&smp_ipi_mtx);
@@ -415,10 +415,10 @@
 	atomic_store_rel_int(&smp_rv_waiters[0], 0);
 
 	/* signal other processors, which will enter the IPI with interrupts off */
-	ipi_selected(map & ~(1 << curcpu), IPI_RENDEZVOUS);
+	ipi_selected(map & ~cputomask(curcpu), IPI_RENDEZVOUS);
 
 	/* Check if the current CPU is in the map */
-	if ((map & (1 << curcpu)) != 0)
+	if ((map & cputomask(curcpu)) != 0)
 		smp_rendezvous_action();
 
 	if (teardown_func == smp_no_rendevous_barrier)
@@ -490,7 +490,7 @@
 		panic("Built bad topology at %p.  CPU count %d != %d",
 		top, top->cg_count, mp_ncpus);
 	if (top->cg_mask != all_cpus)
-		panic("Built bad topology at %p.  CPU mask 0x%X != 0x%X",
+		panic("Built bad topology at %p.  CPU mask 0x%lX != 0x%lX",
 		top, top->cg_mask, all_cpus);
 	return (top);
 }
@@ -531,7 +531,7 @@
 	parent->cg_children++;
 	for (; parent != NULL; parent = parent->cg_parent) {
 		if ((parent->cg_mask & child->cg_mask) != 0)
-			panic("Duplicate children in %p.  mask 0x%X child 0x%X",
+			panic("Duplicate children in %p.  mask 0x%lX child 0x%lX",
 			parent, parent->cg_mask, child->cg_mask);
 		parent->cg_mask |= child->cg_mask;
 		parent->cg_count += child->cg_count;
Index: sys/kern/sched_ule.c
===
--- sys/kern/sched_ule.c	(revision 210622)
+++ sys/kern/sched_ule.c	(working copy)
@@ -851,7 +851,7 @@
 		 * IPI the target cpu to force it to reschedule with the new
 		 * workload.
 		 */
-		ipi_selected(1 << TDQ_ID(low), IPI_PREEMPT);
+		ipi_cpu(TDQ_ID(low), IPI_PREEMPT);
 	}
 	tdq_unlock_pair(high, low);
 	return (moved);
@@ -974,7 +974,7 @@
 			return;
 	}
 	tdq->tdq_ipipending = 1;
-	ipi_selected(1 << cpu, IPI_PREEMPT);
+	ipi_cpu(cpu, IPI_PREEMPT);
 }
 
 /*
@@ -2413,7 +2413,7 @@
 	cpu = ts->ts_cpu;
 	ts->ts_cpu = sched_pickcpu(td, 0);
 	if (cpu != PCPU_GET(cpuid))
-		ipi_selected(1 << cpu, IPI_PREEMPT);
+		ipi_cpu(cpu, IPI_PREEMPT);
 #endif
 }
 
@@ -2644,11 +2644,11 @@
 
 	sbuf_printf(sb, "%*s\n", indent,
 	"", indent, cg->cg_level);
-	sbuf_printf(sb, "%*s ", indent, "",
+	sbuf_printf(sb, "%*s ", indent, "",
 	cg->cg_count, cg->cg_mask);
 	first = TRUE;
 	for (i = 0; i < MAXCPU; i++) {
-		if ((cg->cg_mask & (1 << i)) != 0) {
+		if ((cg->cg_mask & cputomask(i)) != 0) {
 			if (!first)
 sbuf_printf(sb, ", ");
 			else
Index: sys/kern/kern_ktr.c
===
--- sys/kern/kern_ktr.c	(revision 210622)
+++ sys/kern/kern_ktr.c	(working copy)
@@ -207,7 +207,7 @@
 	if ((ktr_mask & mask) == 0)
 		return;
 	cpu = KTR_CPU;
-	if (((1 << cpu) & ktr_cpumask) == 0)
+	if ((cputomask(cpu) & ktr_cpumask) == 0)
 		return;
 #if defined(KTR_VERBOSE) || defined(KTR_ALQ)
 	td = curthread;
Index: sys/kern/kern_pmc.c
===
--- sys/kern/kern_pmc.c	(revision 210622)
+++ sys/kern/kern_pmc.c	(working copy)
@@ -34,6 +34,7 @@
 #include "opt_hwpmc_hooks.h"
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -110,7 +111,7 @@
 {
 #ifdef	SMP
 	return (pmc_cpu_is_present(cpu) &&
-	(hlt_cpus_mask & (1 << cpu)) == 0);
+	(hlt_cpus_mask & cputomask(cpu)) == 0);
 #else
 	return (1);
 #endif
@@ -137,7 +138,7 @@
 pmc_cpu_is_primary(int cpu)
 {
 #ifdef	SMP
-	return ((logical_cpus_mask & (1 << cpu)) == 0);
+	return ((logical_cpus_mask & cputomask(cpu)) == 0);
 #else
 	return (1);
 #endif
Index: sys/kern/subr_pcpu.c
===
--- sys/kern/subr_pcpu.c	(revision 210622)
+++ sys/ke

Re: Unable to install 8.x on a PowerEdge R810

2010-07-29 Thread Sean Bruno

> Kind of a large patch, but in order to make an omlette, you need to
> break a few servers.
> 
> This is a diff against -CURRENT, not stable-8 as I didn't get a chance
> to test it.  It is directly based off of changes that peter@ made to the
> Yahoo FreeBSD 7 tree.
> 
> I have compile and boot tested this on my local machines, but I don't
> have 64 CPU machines to test upon.
> 
> Sean

Here is a patch version that applies to stable-8 at the moment.

I changed 2 more cases where the data types were wrong, one in a printf
and a case where a negative truth value was being used.

Sea
Index: sys/kern/subr_smp.c
===
--- sys/kern/subr_smp.c	(revision 210622)
+++ sys/kern/subr_smp.c	(working copy)
@@ -181,7 +181,7 @@
 	id = td->td_oncpu;
 	if (id == NOCPU)
 		return;
-	ipi_selected(1 << id, IPI_AST);
+	ipi_selected(cputomask(id), IPI_AST);
 }
 
 /*
@@ -318,7 +318,7 @@
 	CTR1(KTR_SMP, "restart_cpus(%x)", map);
 
 	/* signal other cpus to restart */
-	atomic_store_rel_int(&started_cpus, map);
+	atomic_store_rel_long(&started_cpus, map);
 
 	/* wait for each to clear its bit */
 	while ((stopped_cpus & map) != 0)
@@ -399,7 +399,7 @@
 		if (((1 << i) & map) != 0 && !CPU_ABSENT(i))
 			ncpus++;
 	if (ncpus == 0)
-		panic("ncpus is 0 with map=0x%x", map);
+		panic("ncpus is 0 with map=0x%lx", map);
 
 	/* obtain rendezvous lock */
 	mtx_lock_spin(&smp_ipi_mtx);
@@ -415,10 +415,10 @@
 	atomic_store_rel_int(&smp_rv_waiters[0], 0);
 
 	/* signal other processors, which will enter the IPI with interrupts off */
-	ipi_selected(map & ~(1 << curcpu), IPI_RENDEZVOUS);
+	ipi_selected(map & ~cputomask(curcpu), IPI_RENDEZVOUS);
 
 	/* Check if the current CPU is in the map */
-	if ((map & (1 << curcpu)) != 0)
+	if ((map & cputomask(curcpu)) != 0)
 		smp_rendezvous_action();
 
 	if (teardown_func == smp_no_rendevous_barrier)
@@ -490,7 +490,7 @@
 		panic("Built bad topology at %p.  CPU count %d != %d",
 		top, top->cg_count, mp_ncpus);
 	if (top->cg_mask != all_cpus)
-		panic("Built bad topology at %p.  CPU mask 0x%X != 0x%X",
+		panic("Built bad topology at %p.  CPU mask 0x%lX != 0x%lX",
 		top, top->cg_mask, all_cpus);
 	return (top);
 }
@@ -531,7 +531,7 @@
 	parent->cg_children++;
 	for (; parent != NULL; parent = parent->cg_parent) {
 		if ((parent->cg_mask & child->cg_mask) != 0)
-			panic("Duplicate children in %p.  mask 0x%X child 0x%X",
+			panic("Duplicate children in %p.  mask 0x%lX child 0x%lX",
 			parent, parent->cg_mask, child->cg_mask);
 		parent->cg_mask |= child->cg_mask;
 		parent->cg_count += child->cg_count;
Index: sys/kern/sched_ule.c
===
--- sys/kern/sched_ule.c	(revision 210622)
+++ sys/kern/sched_ule.c	(working copy)
@@ -851,7 +851,7 @@
 		 * IPI the target cpu to force it to reschedule with the new
 		 * workload.
 		 */
-		ipi_selected(1 << TDQ_ID(low), IPI_PREEMPT);
+		ipi_cpu(TDQ_ID(low), IPI_PREEMPT);
 	}
 	tdq_unlock_pair(high, low);
 	return (moved);
@@ -974,7 +974,7 @@
 			return;
 	}
 	tdq->tdq_ipipending = 1;
-	ipi_selected(1 << cpu, IPI_PREEMPT);
+	ipi_cpu(cpu, IPI_PREEMPT);
 }
 
 /*
@@ -2413,7 +2413,7 @@
 	cpu = ts->ts_cpu;
 	ts->ts_cpu = sched_pickcpu(td, 0);
 	if (cpu != PCPU_GET(cpuid))
-		ipi_selected(1 << cpu, IPI_PREEMPT);
+		ipi_cpu(cpu, IPI_PREEMPT);
 #endif
 }
 
@@ -2644,11 +2644,11 @@
 
 	sbuf_printf(sb, "%*s\n", indent,
 	"", indent, cg->cg_level);
-	sbuf_printf(sb, "%*s ", indent, "",
+	sbuf_printf(sb, "%*s ", indent, "",
 	cg->cg_count, cg->cg_mask);
 	first = TRUE;
 	for (i = 0; i < MAXCPU; i++) {
-		if ((cg->cg_mask & (1 << i)) != 0) {
+		if ((cg->cg_mask & cputomask(i)) != 0) {
 			if (!first)
 sbuf_printf(sb, ", ");
 			else
Index: sys/kern/kern_ktr.c
===
--- sys/kern/kern_ktr.c	(revision 210622)
+++ sys/kern/kern_ktr.c	(working copy)
@@ -207,7 +207,7 @@
 	if ((ktr_mask & mask) == 0)
 		return;
 	cpu = KTR_CPU;
-	if (((1 << cpu) & ktr_cpumask) == 0)
+	if ((cputomask(cpu) & ktr_cpumask) == 0)
 		return;
 #if defined(KTR_VERBOSE) || defined(KTR_ALQ)
 	td = curthread;
Index: sys/kern/kern_pmc.c
===
--- sys/kern/kern_pmc.c	(revision 210622)
+++ sys/kern/kern_pmc.c	(working copy)
@@ -34,6 +34,7 @@
 #include "opt_hwpmc_hooks.h"
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -110,7 +111,7 @@
 {
 #ifdef	SMP
 	return (pmc_cpu_is_present(cpu) &&
-	(hlt_cpus_mask & (1 << cpu)) == 0);
+	(hlt_cpus_mask & cputomask(cpu)) == 0);
 #else
 	return (1);
 #endif
@@ -137,7 +138,7 @@
 pmc_cpu_is_primary(int cpu)
 {
 #ifdef	SMP
-	return ((logical_cpus_mask & (1 << cpu)) == 0);
+	return ((logical_cpus_mask & cputomask(cpu)) == 0);
 #else
 	return (1);
 #endif
Index: sys/kern/subr_pcpu.c
===
--- sys/kern/subr_pcpu.c	(revision 210622)
+++ sys/ke

Re: 8.1 stable ar9285 ath0 problem

2010-07-29 Thread Troye Johnson
well i just patched recompiled. Its evwn worse now. Now the
var,log,messages log is even more flooded with the said messages.

/Sent from Nokia 5800

On 7/29/10, Kurt Jaeger  wrote:
> Hi!
>
>> UPDATE: Oh, one more thing. Upon loading the ath driver a couple of days
>> ago
>> I got a kernel panic and freeze. It panicked and then the system froze.
>> The
>> driver can scan for access points and associates to the AP, but then the
>> kernl delivers the message in /var/log/message ("kernel: ath0: bb hang
>> detected, resetting) that the ath driver froze.
>
> I disabled the reset, and used the 9285 (asus eeepc 1015PE) sucessfully,
> while still a bit flakey. I'm in a conference right now, so a bit busy.
>
> See
>
> http://opsec.eu/backup/patch-ath-reset
>
> And if you see 'unknown subtype' messages if doing ifconfig -m wlan0,
> maybe
>
> http://opsec.eu/backup/patch-ifmedia
>
> will help as well.
>
> --
> p...@opsec.eu+49 171 310137210 years to go
> !
>
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: 8.x grudges

2010-07-29 Thread Oliver Fromme
Mikhail T.  wrote:
 > The motherboard version -- I'm not sure still. Something like
 > nVidia nForce2 -- does that identify it enough?

Install ports/sysutils/dmidecode and type (as root):

# dmidecode -t system -t baseboard

It will tell you the vendor and product name, among
other things.

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"If Java had true garbage collection, most programs
would delete themselves upon execution."
-- Robert Sewell
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re : ath(4) hostap with fake MAC/BSSID results in station dropping packets when associated

2010-07-29 Thread Alexandre L.
Hi Martin,

I got similar problem from my PC using a Netgear WG311T PCI wireless card.

ath0:  mem 0x4010-0x4010 irq 11 at device 8.0 on pci1
ath0: AR2413 mac 7.9 RF2413 phy 4.5

I have joined all my config files, and the results of the commands : 
# dmesg
# ifconfig
# dhclient wlan0

Also, I have opened before your mail to the list, a thread on FreeBSD Forums 
http://forums.freebsd.org/showthread.php?t=16373 

--- En date de : Mer 28.7.10, Martin  a écrit :

> De: Martin 
> Objet: ath(4) hostap with fake MAC/BSSID results in station dropping packets 
> when associated
> À: freebsd-stable@freebsd.org
> Date: Mercredi 28 juillet 2010, 22h24
> 
> Hi,
> 
> I noticed a bug that was introduced somewhere in the
> Atheros 9280
> support in 8.1-RELEASE when used as a station. I had this
> already
> running correctly with 7.x releases.
> 
> What happens:
> 
> I cannot connect to a hostap ath(4) (Atheros 2413) when
> using a fake
> MAC/BSSID (on the hostap!).
> 
> How to reproduce it:
> 
> 1) Put this into your rc.local on your hostap machine and
> replace xx's
> by an address of your choice (first octet needs to have
> lowest bit "0"):
> 
> ifconfig ath0 ether xx:xx:xx:xx:xx:xx
> 
> 2) Start hostapd (must be configured, of course).
> Eventually you need
> to set BSSID also in hostapd.conf.
> 
> 3) Try to connect with an Atheros 9280. You don't need to
> fake MAC
> address here (I'm only talking about the hostap
> MAC/BSSID).
> 
> What you get:
> 
> - You get association. This is OK, so far.
> - Try DHCP. You won't see packets arriving at the station.
> They are not
>   recognized and filtered somewhere.
> - When you watch with tcpdump on the hostap interface
> you'll see DHCP
>   requests arriving and being answered.
> - I further noticed, even you don't have any IP (set to
> 0.0.0.0,
>   because of failed DHCP), you can see packets being
> sent to different
>   machines
> - You can try to setup a static address, but when you ping
> the station,
>   you don't see a ping arriving (watch tcpdump on the
> station wireless
>   interface and try to ping from the hostap machine).
> 
> Further information:
> 
> - This only affects ath(4) and I could only see this on
> Atheros 9280,
>   because I don't have any other ath(4) adapters at
> the moment.
> - I tried rum(4). It does not have any problems like this.
> DHCP and
>   everything else works with this driver (of course
> with a fake
>   MAC/BSSID!).
> - Running 8.1-RELEASE on all machines. Kernel is GENERIC,
> but on hostap
>   machine there is ALTQ added (should not affect
> anything, as I said,
>   I had this running already).
> - hostapd is configured with 11g, WPA2 and passwords in
> hostapd.wpapsk.
>   WME is switched off, because it does not work at all
> for me.
> 
> I can provide more information, if needed.
> 
> --
> Martin
> ___
> freebsd-stable@freebsd.org
> mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-stable
> To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
>


  

dhclient_wlan0
Description: Binary data


dmesg
Description: Binary data


ifconfig
Description: Binary data


wpa_supplicant.conf
Description: Binary data


rc.conf
Description: Binary data
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Re: 8.1 stable ar9285 ath0 problem

2010-07-29 Thread Kurt Jaeger
Hi!

> UPDATE: Oh, one more thing. Upon loading the ath driver a couple of days ago
> I got a kernel panic and freeze. It panicked and then the system froze. The
> driver can scan for access points and associates to the AP, but then the
> kernl delivers the message in /var/log/message ("kernel: ath0: bb hang
> detected, resetting) that the ath driver froze.

I disabled the reset, and used the 9285 (asus eeepc 1015PE) sucessfully,
while still a bit flakey. I'm in a conference right now, so a bit busy.

See

http://opsec.eu/backup/patch-ath-reset

And if you see 'unknown subtype' messages if doing ifconfig -m wlan0,
maybe 

http://opsec.eu/backup/patch-ifmedia

will help as well.

-- 
p...@opsec.eu+49 171 310137210 years to go !
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"