Re: En/disabling power button shutdown

2011-06-16 Thread Andrew Fresh
On Sat, Jun 11, 2011 at 10:58:17AM +0200, Mark Kettenis wrote:
 Like I asked on icb, why do we need a knob for this at all?

I don't need one yet, but someday when hybernate works I would like to
sysctl hw.powerbuttonaction=hybernate

In preparation for that, I don't see a reason not to support a disabled
setting.

l8rZ,
-- 
andrew - http://afresh1.com

Hey! It compiles! Ship it!



Re: Toshiba M30 ACPI support

2011-06-16 Thread Paul Irofti
People with Toshiba's should test now so that they don't cry later.

Or is there nobody using toshiba nowadays?! Come on people!

On Wed, Jun 15, 2011 at 09:35:24PM +0200, Javier Vazquez wrote:
 Hello,
   Sending toshiba patch file with the new changes. 
 
 Thanks,
 Javier.
 
 On Wed, Jun 15, 2011 at 11:03:49AM +0300, Paul Irofti wrote:
  On Tue, Jun 14, 2011 at 10:07:54PM +0200, Javier Vazquez wrote:
   Hello again,
 Sending toshiba acpi patch as Paul has suggested.
  
  Cool!
  
  [--snip--]
  
   Index: dev/acpi/acpi.c
   ===
   RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
   retrieving revision 1.224
   diff -u -p -r1.224 acpi.c
   --- dev/acpi/acpi.c   27 Apr 2011 20:55:42 -  1.224
   +++ dev/acpi/acpi.c   14 Jun 2011 20:02:44 -
   @@ -93,6 +93,7 @@ voidacpi_pbtn_task(void *, int);
#ifndef SMALL_KERNEL

int  acpi_thinkpad_enabled;
   +int  acpi_toshiba_enabled;
int  acpi_saved_spl;
int  acpi_enabled;

   @@ -781,8 +782,8 @@ acpi_attach(struct device *parent, struc
 /* check if we're running on a sony */
 aml_find_node(aml_root, GBRT, acpi_foundsony, sc);

   - /* attach video only if this is not a stinkpad */
   - if (!acpi_thinkpad_enabled)
   + /* attach video only if this is not a stinkpad or toshiba */
   + if (!acpi_thinkpad_enabled || !acpi_toshiba_enabled)
 aml_find_node(aml_root, _DOS, acpi_foundvideo, sc);
  
  You forgot to fix this into:
  +   if (!acpi_thinkpad_enabled  !acpi_toshiba_enabled)

 ? toshiba_acpi.patch
 Index: arch/amd64/conf/GENERIC
 ===
 RCS file: /cvs/src/sys/arch/amd64/conf/GENERIC,v
 retrieving revision 1.319
 diff -u -p -r1.319 GENERIC
 --- arch/amd64/conf/GENERIC   30 May 2011 22:03:47 -  1.319
 +++ arch/amd64/conf/GENERIC   15 Jun 2011 19:35:23 -
 @@ -52,6 +52,7 @@ acpimcfg*   at acpi?
  acpiasus*at acpi?
  acpisony*at acpi?
  acpithinkpad*at acpi?
 +acpitoshiba* at acpi?
  acpivideo*   at acpi?
  acpivout*at acpivideo?
  acpipwrres*  at acpi?
 Index: arch/i386/conf/GENERIC
 ===
 RCS file: /cvs/src/sys/arch/i386/conf/GENERIC,v
 retrieving revision 1.716
 diff -u -p -r1.716 GENERIC
 --- arch/i386/conf/GENERIC30 May 2011 22:03:47 -  1.716
 +++ arch/i386/conf/GENERIC15 Jun 2011 19:35:24 -
 @@ -62,6 +62,7 @@ acpitz* at acpi?
  acpiasus*at acpi?
  acpisony*at acpi?
  acpithinkpad*at acpi?
 +acpitoshiba* at acpi?
  acpivideo*   at acpi?
  acpivout*at acpivideo?
  acpipwrres*  at acpi?
 Index: dev/acpi/acpi.c
 ===
 RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
 retrieving revision 1.224
 diff -u -p -r1.224 acpi.c
 --- dev/acpi/acpi.c   27 Apr 2011 20:55:42 -  1.224
 +++ dev/acpi/acpi.c   15 Jun 2011 19:35:27 -
 @@ -93,6 +93,7 @@ voidacpi_pbtn_task(void *, int);
  #ifndef SMALL_KERNEL
  
  int  acpi_thinkpad_enabled;
 +int  acpi_toshiba_enabled;
  int  acpi_saved_spl;
  int  acpi_enabled;
  
 @@ -781,8 +782,8 @@ acpi_attach(struct device *parent, struc
   /* check if we're running on a sony */
   aml_find_node(aml_root, GBRT, acpi_foundsony, sc);
  
 - /* attach video only if this is not a stinkpad */
 - if (!acpi_thinkpad_enabled)
 + /* attach video only if this is not a stinkpad or toshiba */
 + if (!acpi_thinkpad_enabled  !acpi_toshiba_enabled)
   aml_find_node(aml_root, _DOS, acpi_foundvideo, sc);
  
   /* create list of devices we want to query when APM come in */
 @@ -2334,6 +2335,13 @@ acpi_foundhid(struct aml_node *node, voi
   acpi_thinkpad_enabled = 1;
   } else if (!strcmp(dev, ACPI_DEV_ASUSAIBOOSTER))
   aaa.aaa_name = aibs;
 + else if (!strcmp(dev, ACPI_DEV_TOSHIBA_LIBRETTO) ||
 + !strcmp(dev, ACPI_DEV_TOSHIBA_DYNABOOK) ||
 + !strcmp(dev, ACPI_DEV_TOSHIBA_SPA40)) {
 + aaa.aaa_name = acpitoshiba;
 + acpi_toshiba_enabled = 1;
 + }
 +
  
   if (aaa.aaa_name)
   config_found(self, aaa, acpi_print);
 Index: dev/acpi/acpireg.h
 ===
 RCS file: /cvs/src/sys/dev/acpi/acpireg.h,v
 retrieving revision 1.25
 diff -u -p -r1.25 acpireg.h
 --- dev/acpi/acpireg.h27 Apr 2011 20:55:42 -  1.25
 +++ dev/acpi/acpireg.h15 Jun 2011 19:35:27 -
 @@ -716,5 +716,8 @@ struct acpi_ivrs {
  #define ACPI_DEV_IBM IBM0068   /* IBM ThinkPad support */
  #define ACPI_DEV_LENOVO  LEN0068   /* Lenovo ThinkPad support */
  #define ACPI_DEV_ASUSAIBOOSTER   ATK0110   /* ASUSTeK AI Booster */
 +#define ACPI_DEV_TOSHIBA_LIBRETTOTOS6200   /* Toshiba Libretto 
 support */
 +#define ACPI_DEV_TOSHIBA_DYNABOOKTOS6207

Re: MSI for em(4)

2011-06-16 Thread LEVAI Daniel
 This is a fairly conservative diff that enables MSI on the newer em(4)
 parts, essentially everything handled by the Linux e1000e driver.

 Please test if you have anything that's vaguely recent.

It just works. Although, I only had a chance to test it with a 100Mbit
connection.


Daniel


OpenBSD 4.9-current (GENERIC.MP) #0: Wed Jun 15 15:37:55 CEST 2011
daniell@digidani:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: Genuine Intel(R) CPU T2400 @ 1.83GHz (GenuineIntel 686-class) 1.83 GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,VMX,EST,TM2,xTPR,PDCM
real mem  = 2145775616 (2046MB)
avail mem = 2100469760 (2003MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 08/27/09, BIOS32 rev. 0 @ 0xfd6b0, SMBIOS 
rev. 2.4 @ 0xe0010 (68 entries)
bios0: vendor LENOVO version 79ETE5WW (2.25 ) date 08/27/2009
bios0: LENOVO 2007FRG
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT ECDT TCPA APIC MCFG HPET BOOT SSDT SSDT SSDT SSDT
acpi0: wakeup devices LID_(S3) SLPB(S3) LURT(S3) DURT(S3) EXP0(S4) EXP1(S4) 
EXP2(S4) EXP3(S4) PCI1(S4) USB0(S3) USB1(S3) USB2(S3) USB7(S3) HDEF(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiec0 at acpi0
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 166MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Genuine Intel(R) CPU T2400 @ 1.83GHz (GenuineIntel 686-class) 1.83 GHz
cpu1: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,VMX,EST,TM2,xTPR,PDCM
ioapic0 at mainbus0: apid 1 pa 0xfec0, version 20, 24 pins
ioapic0: misconfigured as apic 2, remapped to apid 1
acpimcfg0 at acpi0 addr 0xf000, bus 0-63
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (AGP_)
acpiprt2 at acpi0: bus 2 (EXP0)
acpiprt3 at acpi0: bus 3 (EXP1)
acpiprt4 at acpi0: bus 4 (EXP2)
acpiprt5 at acpi0: bus 12 (EXP3)
acpiprt6 at acpi0: bus 21 (PCI1)
acpicpu0 at acpi0: C3, C2, C1, PSS
acpicpu1 at acpi0: C3, C2, C1, PSS
acpipwrres0 at acpi0: PUBS
acpitz0 at acpi0: critical temperature is 127 degC
acpitz1 at acpi0: critical temperature is 99 degC
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: SLPB
acpibat0 at acpi0: BAT0 model 93P5030 serial  2444 type LION oem SONY
acpibat1 at acpi0: BAT1 not present
acpiac0 at acpi0: AC unit online
acpithinkpad0 at acpi0
acpidock0 at acpi0: GDCK not docked (0)
bios0: ROM list: 0xc/0xfe00 0xd/0x1000 0xd1000/0x1000 0xdc000/0x4000! 
0xe/0x1!
cpu0: Enhanced SpeedStep 1829 MHz: speeds: 1833, 1333, 1000 MHz
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 Intel 82945GM Host rev 0x03
ppb0 at pci0 dev 1 function 0 Intel 82945GM PCIE rev 0x03: apic 1 int 16
pci1 at ppb0 bus 1
vga1 at pci1 dev 0 function 0 ATI Radeon Mobility X1400 rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
radeondrm0 at vga1: apic 1 int 16
drm0 at radeondrm0
azalia0 at pci0 dev 27 function 0 Intel 82801GB HD Audio rev 0x02: msi
azalia0: codecs: Analog Devices AD1981HD, 0x/0x, using Analog Devices 
AD1981HD
audio0 at azalia0
ppb1 at pci0 dev 28 function 0 Intel 82801GB PCIE rev 0x02: apic 1 int 20
pci2 at ppb1 bus 2
em0 at pci2 dev 0 function 0 Intel PRO/1000MT (82573L) rev 0x00: msi, address 
00:16:41:aa:d2:70
ppb2 at pci0 dev 28 function 1 Intel 82801GB PCIE rev 0x02: apic 1 int 21
pci3 at ppb2 bus 3
wpi0 at pci3 dev 0 function 0 Intel PRO/Wireless 3945ABG rev 0x02: msi, MoW2, 
address 00:18:de:65:2d:37
ppb3 at pci0 dev 28 function 2 Intel 82801GB PCIE rev 0x02: apic 1 int 22
pci4 at ppb3 bus 4
ppb4 at pci0 dev 28 function 3 Intel 82801GB PCIE rev 0x02: apic 1 int 23
pci5 at ppb4 bus 12
uhci0 at pci0 dev 29 function 0 Intel 82801GB USB rev 0x02: apic 1 int 16
uhci1 at pci0 dev 29 function 1 Intel 82801GB USB rev 0x02: apic 1 int 17
uhci2 at pci0 dev 29 function 2 Intel 82801GB USB rev 0x02: apic 1 int 18
uhci3 at pci0 dev 29 function 3 Intel 82801GB USB rev 0x02: apic 1 int 19
ehci0 at pci0 dev 29 function 7 Intel 82801GB USB rev 0x02: apic 1 int 19
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 Intel EHCI root hub rev 2.00/1.00 addr 1
ppb5 at pci0 dev 30 function 0 Intel 82801BAM Hub-to-PCI rev 0xe2
pci6 at ppb5 bus 21
cbb0 at pci6 dev 0 function 0 TI PCI1510 CardBus rev 0x00: apic 1 int 16
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 22 device 0 cacheline 0x8, lattimer 0xb0
pcmcia0 at cardslot0
ichpcib0 at pci0 dev 31 function 0 Intel 82801GBM LPC rev 0x02: PM disabled
pciide0 at pci0 dev 31 function 1 Intel 82801GB IDE rev 0x02: DMA, channel 0 
configured to compatibility, channel 1 configured to compatibility
atapiscsi0 at pciide0 channel 0 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: HL-DT-ST, DVDRAM GSA-4083N, 1.08 ATAPI 5/cdrom 

Re: Toshiba M30 ACPI support

2011-06-16 Thread Marco Peereboom
What Paul said!

I have been looking at the diff but don't have the gear to test with.
So please test this and report back.

On Thu, Jun 16, 2011 at 10:58:56AM +0300, Paul Irofti wrote:
 People with Toshiba's should test now so that they don't cry later.
 
 Or is there nobody using toshiba nowadays?! Come on people!
 
 On Wed, Jun 15, 2011 at 09:35:24PM +0200, Javier Vazquez wrote:
  Hello,
  Sending toshiba patch file with the new changes. 
  
  Thanks,
  Javier.
  
  On Wed, Jun 15, 2011 at 11:03:49AM +0300, Paul Irofti wrote:
   On Tue, Jun 14, 2011 at 10:07:54PM +0200, Javier Vazquez wrote:
Hello again,
Sending toshiba acpi patch as Paul has suggested.
   
   Cool!
   
   [--snip--]
   
Index: dev/acpi/acpi.c
===
RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.224
diff -u -p -r1.224 acpi.c
--- dev/acpi/acpi.c 27 Apr 2011 20:55:42 -  1.224
+++ dev/acpi/acpi.c 14 Jun 2011 20:02:44 -
@@ -93,6 +93,7 @@ void  acpi_pbtn_task(void *, int);
 #ifndef SMALL_KERNEL
 
 intacpi_thinkpad_enabled;
+intacpi_toshiba_enabled;
 intacpi_saved_spl;
 intacpi_enabled;
 
@@ -781,8 +782,8 @@ acpi_attach(struct device *parent, struc
/* check if we're running on a sony */
aml_find_node(aml_root, GBRT, acpi_foundsony, sc);
 
-   /* attach video only if this is not a stinkpad */
-   if (!acpi_thinkpad_enabled)
+   /* attach video only if this is not a stinkpad or toshiba */
+   if (!acpi_thinkpad_enabled || !acpi_toshiba_enabled)
aml_find_node(aml_root, _DOS, acpi_foundvideo, sc);
   
   You forgot to fix this into:
   + if (!acpi_thinkpad_enabled  !acpi_toshiba_enabled)
 
  ? toshiba_acpi.patch
  Index: arch/amd64/conf/GENERIC
  ===
  RCS file: /cvs/src/sys/arch/amd64/conf/GENERIC,v
  retrieving revision 1.319
  diff -u -p -r1.319 GENERIC
  --- arch/amd64/conf/GENERIC 30 May 2011 22:03:47 -  1.319
  +++ arch/amd64/conf/GENERIC 15 Jun 2011 19:35:23 -
  @@ -52,6 +52,7 @@ acpimcfg* at acpi?
   acpiasus*  at acpi?
   acpisony*  at acpi?
   acpithinkpad*  at acpi?
  +acpitoshiba*   at acpi?
   acpivideo* at acpi?
   acpivout*  at acpivideo?
   acpipwrres*at acpi?
  Index: arch/i386/conf/GENERIC
  ===
  RCS file: /cvs/src/sys/arch/i386/conf/GENERIC,v
  retrieving revision 1.716
  diff -u -p -r1.716 GENERIC
  --- arch/i386/conf/GENERIC  30 May 2011 22:03:47 -  1.716
  +++ arch/i386/conf/GENERIC  15 Jun 2011 19:35:24 -
  @@ -62,6 +62,7 @@ acpitz*   at acpi?
   acpiasus*  at acpi?
   acpisony*  at acpi?
   acpithinkpad*  at acpi?
  +acpitoshiba*   at acpi?
   acpivideo* at acpi?
   acpivout*  at acpivideo?
   acpipwrres*at acpi?
  Index: dev/acpi/acpi.c
  ===
  RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
  retrieving revision 1.224
  diff -u -p -r1.224 acpi.c
  --- dev/acpi/acpi.c 27 Apr 2011 20:55:42 -  1.224
  +++ dev/acpi/acpi.c 15 Jun 2011 19:35:27 -
  @@ -93,6 +93,7 @@ void  acpi_pbtn_task(void *, int);
   #ifndef SMALL_KERNEL
   
   intacpi_thinkpad_enabled;
  +intacpi_toshiba_enabled;
   intacpi_saved_spl;
   intacpi_enabled;
   
  @@ -781,8 +782,8 @@ acpi_attach(struct device *parent, struc
  /* check if we're running on a sony */
  aml_find_node(aml_root, GBRT, acpi_foundsony, sc);
   
  -   /* attach video only if this is not a stinkpad */
  -   if (!acpi_thinkpad_enabled)
  +   /* attach video only if this is not a stinkpad or toshiba */
  +   if (!acpi_thinkpad_enabled  !acpi_toshiba_enabled)
  aml_find_node(aml_root, _DOS, acpi_foundvideo, sc);
   
  /* create list of devices we want to query when APM come in */
  @@ -2334,6 +2335,13 @@ acpi_foundhid(struct aml_node *node, voi
  acpi_thinkpad_enabled = 1;
  } else if (!strcmp(dev, ACPI_DEV_ASUSAIBOOSTER))
  aaa.aaa_name = aibs;
  +   else if (!strcmp(dev, ACPI_DEV_TOSHIBA_LIBRETTO) ||
  +   !strcmp(dev, ACPI_DEV_TOSHIBA_DYNABOOK) ||
  +   !strcmp(dev, ACPI_DEV_TOSHIBA_SPA40)) {
  +   aaa.aaa_name = acpitoshiba;
  +   acpi_toshiba_enabled = 1;
  +   }
  +
   
  if (aaa.aaa_name)
  config_found(self, aaa, acpi_print);
  Index: dev/acpi/acpireg.h
  ===
  RCS file: /cvs/src/sys/dev/acpi/acpireg.h,v
  retrieving revision 1.25
  diff -u -p -r1.25 acpireg.h
  --- dev/acpi/acpireg.h  27 Apr 2011 20:55:42 -  1.25
  +++ dev/acpi/acpireg.h  15 Jun 2011 19:35:27 -
  @@ -716,5 +716,8 @@ struct acpi_ivrs {
   #define ACPI_DEV_IBM   IBM0068 

Re: iwn(4) MSI

2011-06-16 Thread Owain Ainsworth
On Thu, Jun 02, 2011 at 11:55:54PM +0200, Mark Kettenis wrote:
  Date: Thu, 2 Jun 2011 22:49:43 +0100
  From: Owain Ainsworth zer...@googlemail.com
  
  Been running with this for a couple of weeks, seems to work fine.
  
  ok?
  
  diff --git dev/pci/if_iwn.c dev/pci/if_iwn.c
  index 16765f4..a54556b 100644
  --- dev/pci/if_iwn.c
  +++ dev/pci/if_iwn.c
  @@ -338,7 +338,8 @@ iwn_attach(struct device *parent, struct device *self, 
  void *aux)
  }
   
  /* Install interrupt handler. */
  -   if (pci_intr_map(pa, ih) != 0) {
  +   if (pci_intr_map_msi(pa, ih) != 0 
  +   pci_intr_map(pa, ih) != 0) {
  printf(: can't map interrupt\n);
  return;
  }
 
 Please keep those calls on a single line, to keep this consistent with
 the other wireless drivers.

I forgot about this diff for a while, but sure:

ok?


diff --git dev/pci/if_iwn.c dev/pci/if_iwn.c
index 16765f4..4ebcb95 100644
--- dev/pci/if_iwn.c
+++ dev/pci/if_iwn.c
@@ -338,7 +338,7 @@ iwn_attach(struct device *parent, struct device *self, void 
*aux)
}
 
/* Install interrupt handler. */
-   if (pci_intr_map(pa, ih) != 0) {
+   if (pci_intr_map_msi(pa, ih) != 0  pci_intr_map(pa, ih) != 0) {
printf(: can't map interrupt\n);
return;
}

-- 
There is no such thing as fortune.  Try again.



Re: iwn(4) MSI

2011-06-16 Thread Mark Kettenis
 Date: Thu, 16 Jun 2011 17:07:51 +0100
 From: Owain Ainsworth zer...@googlemail.com
 
  Please keep those calls on a single line, to keep this consistent with
  the other wireless drivers.
 
 I forgot about this diff for a while, but sure:
 
 ok?

Fine

 diff --git dev/pci/if_iwn.c dev/pci/if_iwn.c
 index 16765f4..4ebcb95 100644
 --- dev/pci/if_iwn.c
 +++ dev/pci/if_iwn.c
 @@ -338,7 +338,7 @@ iwn_attach(struct device *parent, struct device *self, 
 void *aux)
   }
  
   /* Install interrupt handler. */
 - if (pci_intr_map(pa, ih) != 0) {
 + if (pci_intr_map_msi(pa, ih) != 0  pci_intr_map(pa, ih) != 0) {
   printf(: can't map interrupt\n);
   return;
   }
 
 -- 
 There is no such thing as fortune.  Try again.



blacklisting Intel 82441FX chipset for MSI on amd64.

2011-06-16 Thread Brad
At the moment its possible to have the same issue as VMware and end up with
an amd64 system with a prehistoric Intel host bridge so blacklist it as
well in amd64's pci_attach_hook() for the MSI check.

http://marc.info/?l=openbsd-miscm=130057771904424w=2
...
OpenBSD 4.9-current (GENERIC) #490: Fri Mar 18 21:01:23 MDT 2011
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
real mem = 535756800 (510MB)
avail mem = 507482112 (483MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xfbd3f (10 entries)
bios0: vendor QEMU version QEMU date 01/01/2007
acpi0 at bios0: rev 0
acpi0: sleep states S3 S4 S5
acpi0: tables DSDT FACP APIC
acpi0: wakeup devices
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
acpiprt0 at acpi0: bus 0 (PCI0)
acpicpu0 at acpi0
mpbios at bios0 not configured
vmt0 at mainbus0
vmware: open failed, eax=564d5868, ecx=001e, edx=5658
vmt0: failed to open backdoor RPC channel (TCLO protocol)
cpu0 at mainbus0: (uniprocessor)
cpu0: QEMU Virtual CPU version 0.9.1, 2667.09 MHz
cpu0:
FPU,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SS
 \
E,SSE2,SSE3,NXE,LONG
cpu0: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB
64b/line 16-way L2 cache
cpu0: ITLB 255 4KB entries direct-mapped, 255 4MB entries direct-mapped
cpu0: DTLB 255 4KB entries direct-mapped, 255 4MB entries direct-mapped
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 Intel 82441FX rev 0x02
pcib0 at pci0 dev 1 function 0 Intel 82371SB ISA rev 0x00
pciide0 at pci0 dev 1 function 1 Intel 82371SB IDE rev 0x00: DMA,
channel 0 wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: QEMU HARDDISK
wd0: 16-sector PIO, LBA48, 10240MB, 20971520 sectors
atapiscsi0 at pciide0 channel 0 drive 1
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: QEMU, QEMU DVD-ROM, 0.9. ATAPI 5/cdrom
removable
wd0(pciide0:0:0): using PIO mode 0, DMA mode 2
cd0(pciide0:0:1): using PIO mode 0
atapiscsi1 at pciide0 channel 1 drive 0
scsibus1 at atapiscsi1: 2 targets
cd1 at scsibus1 targ 0 lun 0: QEMU, QEMU DVD-ROM, 0.9. ATAPI 5/cdrom
removable
cd1(pciide0:1:0): using PIO mode 0
uhci0 at pci0 dev 1 function 2 Intel 82371SB USB rev 0x01: irq 11
piixpm0 at pci0 dev 1 function 3 Intel 82371AB Power rev 0x03: irq 10
iic0 at piixpm0
iic0: addr 0x4c 48=00 words 00= 01= 02= 03= 04=
05= 06= 07=
iic0: addr 0x4e 48=00 words 00= 01= 02= 03= 04=
05= 06= 07=
vga1 at pci0 dev 2 function 0 Cirrus Logic CL-GD5446 rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
em0 at pci0 dev 3 function 0 Intel PRO/1000MT (82540EM) rev 0x03: irq
11, address 52:54:00:27:24:25
Qumranet Virtio Memory rev 0x00 at pci0 dev 4 function 0 not configured
Qumranet Virtio Console rev 0x00 at pci0 dev 5 function 0 not configured
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com0: probed fifo depth: 0 bytes
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: density unknown
fd1 at fdc0 drive 1: density unknown
usb0 at uhci0: USB revision 1.0
uhub0 at usb0 Intel UHCI root hub rev 1.00/1.00 addr 1
nvram: invalid checksum
mtrr: Pentium Pro MTRR support
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
root on wd0a swap on wd0b dump on wd0b
clock: unknown CMOS layout


Index: pci_machdep.c
===
RCS file: /home/cvs/src/sys/arch/amd64/pci/pci_machdep.c,v
retrieving revision 1.49
diff -u -p -r1.49 pci_machdep.c
--- pci_machdep.c   5 Jun 2011 18:09:00 -   1.49
+++ pci_machdep.c   16 Jun 2011 18:25:12 -
@@ -178,11 +178,12 @@ pci_attach_hook(struct device *parent, s
switch (PCI_VENDOR(id)) {
case PCI_VENDOR_INTEL:
/*
-* In the land of VMWare you can have the latest
+* In the land of QEMU / VMWare you can have the latest
 * 64-bit AMD multicore CPU behind a prehistoric Intel
 * host bridge.  Give them what they deserve.
 */
switch (PCI_PRODUCT(id)) {
+   case PCI_PRODUCT_INTEL_82441FX:
case PCI_PRODUCT_INTEL_82443BX:
break;
default:

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: ld.so speedup for large binaries with many shared libraries

2011-06-16 Thread Stuart Henderson
On 2011/04/23 23:47, Dale Rahn wrote:
 Here is a diff that was originally hatched at c2k10 and finally implemented
 at k2k11. This has been tested lightly so needs to be tested on all systems
 with big and small programs.

This breaks 'doveadm' in the dovecot package; to test,
pkg_add dovecot, then just run 'doveadm', no need for any setup.

===
(gdb) r
Starting program: /usr/local/bin/doveadm 
(no debugging symbols found)

Program received signal SIGTRAP, Trace/breakpoint trap.
Cannot remove breakpoints because program is no longer writable.
It might be running in another process.
Further execution is probably impossible.
0x000202302470 in ?? ()
===

This is happening when it dlopen'()s a module. The following
code is equivalent to what doveadm is doing, and is enough
to show the problem.

Reverting to ld.so from before 2011/05/22 and things work ok.

===
#include dlfcn.h

main() {
dlopen(/usr/local/lib/dovecot/doveadm/lib10_doveadm_zlib_plugin.so,
RTLD_GLOBAL | RTLD_NOW);
}
===



Re: ospf6d crashes on interface add

2011-06-16 Thread Andre Keller
Hi Martin

thanks for your patch. This patch works for me on OpenBSD 4.9-stable and
-current. Still some issues left but at least ospf6d does not crash on
interface add...

it would be really nice if this gets into the tree...


Am 01.06.2011 22:46, schrieb Martin Pelikan:
 Hi!

 So my last attempt wasn't met with much appreciation, so I'll slow down:

 - when I add a vlan(4), vether(4) or something, my ospf6d dies
 - I don't like that
 - therefore, with new release comes new diff
 - this time I tried to make it as small as possible, in separate parts

 It doesn't fix departures (if_leave_group jumps on a non-existing
 interface), but I guess people don't remove interfaces that often. 
 I will rewrite and post the rest of the big one if someone shows
 interest in this bit.

 --
 Martin Pelikan


 Index: kroute.c
 ===
 RCS file: /cvs/src/usr.sbin/ospf6d/kroute.c,v
 retrieving revision 1.30
 diff -u -p -r1.30 kroute.c
 --- kroute.c  7 Mar 2011 07:43:02 -   1.30
 +++ kroute.c  1 Jun 2011 20:36:31 -
 @@ -973,15 +973,22 @@ if_announce(void *msg)
   if ((iface = if_new(ifan-ifan_index, ifan-ifan_name)) == NULL)
   fatal(if_announce failed);
   iface-cflags |= F_IFACE_AVAIL;
 + main_imsg_compose_rde(IMSG_IFADD, 0,
 + iface, sizeof(struct iface));
 + main_imsg_compose_ospfe(IMSG_IFADD, 0,
 + iface, sizeof(struct iface));
   break;
   case IFAN_DEPARTURE:
 - iface = if_find(ifan-ifan_index);
 - if (iface-cflags  F_IFACE_CONFIGURED) {
 - main_imsg_compose_rde(IMSG_IFDELETE, 0,
 - iface-ifindex, sizeof(iface-ifindex));
 - main_imsg_compose_ospfe(IMSG_IFDELETE, 0,
 - iface-ifindex, sizeof(iface-ifindex));
 + if ((iface = if_find(ifan-ifan_index)) == NULL)  {
 + log_warn(someone announced departure of non-existing 
 + interface %s - possible race condition?,
 + ifan-ifan_name);
 + return;
   }
 + main_imsg_compose_rde(IMSG_IFDELETE, 0,
 + iface-ifindex, sizeof(iface-ifindex));
 + main_imsg_compose_ospfe(IMSG_IFDELETE, 0,
 + iface-ifindex, sizeof(iface-ifindex));
   if_del(iface);
   break;
   }
 Index: ospfe.c
 ===
 RCS file: /cvs/src/usr.sbin/ospf6d/ospfe.c,v
 retrieving revision 1.34
 diff -u -p -r1.34 ospfe.c
 --- ospfe.c   2 May 2011 09:24:00 -   1.34
 +++ ospfe.c   1 Jun 2011 20:36:31 -
 @@ -299,16 +299,16 @@ ospfe_dispatch_main(int fd, short event,
   }
   break;
   case IMSG_IFADD:
 - if ((iface = malloc(sizeof(struct iface))) == NULL)
 - fatal(NULL);
 - memcpy(iface, imsg.data, sizeof(struct iface));
 + ifp = imsg.data;
 + if ((iface = if_new(ifp-ifindex, ifp-name)) == NULL)
 + fatalx(IFADD in ospfe);
  
 - LIST_INIT(iface-nbr_list);
 - TAILQ_INIT(iface-ls_ack_list);
 - RB_INIT(iface-lsa_tree);
 + /* ifaces from config belong to some area */
 + if ((iface-cflags  F_IFACE_CONFIGURED) 
 + (area = area_find(oeconf, iface-area_id)) != NULL)
 + LIST_INSERT_HEAD(area-iface_list, iface,
 + entry);
  
 - area = area_find(oeconf, iface-area_id);
 - LIST_INSERT_HEAD(area-iface_list, iface, entry);
   break;
   case IMSG_IFDELETE:
   if (imsg.hdr.len != IMSG_HEADER_SIZE +
 Index: rde.c
 ===
 RCS file: /cvs/src/usr.sbin/ospf6d/rde.c,v
 retrieving revision 1.52
 diff -u -p -r1.52 rde.c
 --- rde.c 5 May 2011 15:58:02 -   1.52
 +++ rde.c 1 Jun 2011 20:36:31 -
 @@ -623,7 +623,7 @@ rde_dispatch_parent(int fd, short event,
  {
   static struct area  *narea;
   struct area *area;
 - struct iface*iface;
 + struct iface*iface, *ifp;
   struct ifaddrchange *ifc;
   struct iface_addr   *ia, *nia;
   struct imsg  imsg;
 @@ -710,16 +710,16 @@ rde_dispatch_parent(int fd, short event,
   0, -1, kr, sizeof(kr));
   break;
   case IMSG_IFADD:
 - if ((iface = malloc(sizeof(struct iface))) == NULL)
 - fatal(NULL);
 - 

Re: pf cleanup diff

2011-06-16 Thread Claudio Jeker
On Wed, Jun 15, 2011 at 11:06:16PM -0400, Kenneth R Westerback wrote:
 On Wed, Jun 15, 2011 at 09:50:51PM -0400, Kenneth R Westerback wrote:
  On Tue, Jun 14, 2011 at 10:23:36PM +0200, Claudio Jeker wrote:
   On Wed, Jun 08, 2011 at 09:53:24AM +0200, Claudio Jeker wrote:
Next step on my quest to unify pf_test and pf_test6.
Move the fragment handling and some other protocol specific tests into
pf_setup_pdesc(). IPv6 already does this mostly but only IPv4 did not. 
So
this diff brings that more into sync. It also includes some additional
cleanups.

Works for me but needs some more testing.
   
   New version with fixes found by bluhm@ (mostly make sure that the right
   header and mbufs are used in all cases).
   
   -- 
   :wq Claudio
  
  Blows up REAL good on my 6xamd64 box. Within a minute or two.
  
  I put some debug in and pf_scrub() is being passed a NULL 'm' parameter
  from pf_test(). Hand transcribed trace:
  
  pf_scrub()+0x12
  pf_test()+0x93b
  ipv4_input()+0x22a
  ipintr()+0x51
  netintr()+0xda
  softintr_dispatch()+0x5d
  Xsoftnet()+0x2d
  
  This box is my nfs server and is using the default pf.conf file as far
  as I know. Also blew up on my firewall as soon as traffic started
  transitting it. Same trace as far as I can see.
  
   Ken
  
 
 panic'ing my way along the stack I find that the problem starts in
 pf_reassemble(), when the 'if (!pf_isfull_fragment(frag))' test
 leaves m0 as NULL and returns PF_PASS to pf_normalize_ip(). *m0 is
 tested and found to be NULL, so pf_normalize_ip() returns PF_PASS to
 pf_setup_pdesc(). Where *m0 is tested for NULL and causes *action to
 be set to PF_PASS and pf_setup_pdesc() to return -1 to pf_test. m is
 set to *m0 (i.e. NULL) and then pf_test goto's done:. action is PF_PASS
 and 'if (s)' fails so control passes to the first statement of the else,
 which is a pf_scrub() call with m being NULL. Boom.
 

Yes, very good analysis. I came to the same conclusion. I do not
understand why we do the goto done; case for PF_PASS in case of a
pf_setup_pdesc() failure. Since in that case *m0 is NULL and so we can
just return directly from there. I changed my diff to do exactly that. On
further inspection I think there is no other case where pf_setup_pdesc()
returns -1 but action is set to PF_PASS. IMO this is a lot saver then
trying to execute all that code after the done: label.

New diff below
-- 
:wq Claudio

Index: net/if_pflog.c
===
RCS file: /cvs/src/sys/net/if_pflog.c,v
retrieving revision 1.34
diff -u -p -r1.34 if_pflog.c
--- net/if_pflog.c  22 May 2011 13:21:24 -  1.34
+++ net/if_pflog.c  24 May 2011 15:56:53 -
@@ -334,7 +334,7 @@ pflog_bpfcopy(const void *src_arg, void 
/* rewrite addresses if needed */
memset(pd, 0, sizeof(pd));
pd.hdr.any = pf_hdrs;
-   if (pf_setup_pdesc(pfloghdr-af, pfloghdr-dir, pd, mfake, action,
+   if (pf_setup_pdesc(pfloghdr-af, pfloghdr-dir, pd, mfake, action,
reason, NULL, NULL, NULL, NULL, off, hdrlen) == -1)
return;
 
Index: net/pf.c
===
RCS file: /cvs/src/sys/net/pf.c,v
retrieving revision 1.748
diff -u -p -r1.748 pf.c
--- net/pf.c14 Jun 2011 10:14:01 -  1.748
+++ net/pf.c16 Jun 2011 21:10:32 -
@@ -5467,10 +5467,12 @@ pf_get_divert(struct mbuf *m)
 }
 
 int
-pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf *m,
+pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0,
 u_short *action, u_short *reason, struct pfi_kif *kif, struct pf_rule **a,
 struct pf_rule **r, struct pf_ruleset **ruleset, int *off, int *hdrlen)
 {
+   struct mbuf *m = *m0;
+
if (pd-hdr.any == NULL)
panic(pf_setup_pdesc: no storage for headers provided);
 
@@ -5480,13 +5482,23 @@ pf_setup_pdesc(sa_family_t af, int dir, 
case AF_INET: {
struct ip   *h;
 
+   /* Check for illegal packets */
+   if (m-m_pkthdr.len  (int)sizeof(struct ip)) {
+   *action = PF_DROP;
+   REASON_SET(reason, PFRES_SHORT);
+   return (-1);
+   }
+
h = mtod(m, struct ip *);
*off = h-ip_hl  2;
-   if (*off  (int)sizeof(*h)) {
+
+   if (*off  (int)sizeof(struct ip) ||
+   *off  ntohs(h-ip_len)) {
*action = PF_DROP;
REASON_SET(reason, PFRES_SHORT);
return (-1);
}
+
pd-src = (struct pf_addr *)h-ip_src;
pd-dst = (struct pf_addr *)h-ip_dst;
pd-sport = pd-dport = NULL;
@@ -5501,9 +5513,43 @@ pf_setup_pdesc(sa_family_t af, int dir, 
pd-tot_len = ntohs(h-ip_len);
pd-rdomain = 

Re: blacklisting Intel 82441FX chipset for MSI on amd64.

2011-06-16 Thread Mark Kettenis
 Date: Thu, 16 Jun 2011 14:41:51 -0400
 From: Brad b...@comstyle.com
 
 At the moment its possible to have the same issue as VMware and end up with
 an amd64 system with a prehistoric Intel host bridge so blacklist it as
 well in amd64's pci_attach_hook() for the MSI check.

Thanks; committed with a slightly rephrased the comment.



Re: Toshiba M30 ACPI support

2011-06-16 Thread Paul Irofti
I imported this just now and enabled it in the GENERIC kernel on i386
and amd64. Thank you for your effort and care of making this driver see
the light of day!

Now go write the damn man page! acpitoshiba(4) is missing! :-)



Re: pf cleanup diff

2011-06-16 Thread Kenneth R Westerback
On Thu, Jun 16, 2011 at 11:18:30PM +0200, Claudio Jeker wrote:
 On Wed, Jun 15, 2011 at 11:06:16PM -0400, Kenneth R Westerback wrote:
  On Wed, Jun 15, 2011 at 09:50:51PM -0400, Kenneth R Westerback wrote:
   On Tue, Jun 14, 2011 at 10:23:36PM +0200, Claudio Jeker wrote:
On Wed, Jun 08, 2011 at 09:53:24AM +0200, Claudio Jeker wrote:
 Next step on my quest to unify pf_test and pf_test6.
 Move the fragment handling and some other protocol specific tests into
 pf_setup_pdesc(). IPv6 already does this mostly but only IPv4 did 
 not. So
 this diff brings that more into sync. It also includes some additional
 cleanups.
 
 Works for me but needs some more testing.

New version with fixes found by bluhm@ (mostly make sure that the right
header and mbufs are used in all cases).

-- 
:wq Claudio
   
   Blows up REAL good on my 6xamd64 box. Within a minute or two.
   
   I put some debug in and pf_scrub() is being passed a NULL 'm' parameter
   from pf_test(). Hand transcribed trace:
   
   pf_scrub()+0x12
   pf_test()+0x93b
   ipv4_input()+0x22a
   ipintr()+0x51
   netintr()+0xda
   softintr_dispatch()+0x5d
   Xsoftnet()+0x2d
   
   This box is my nfs server and is using the default pf.conf file as far
   as I know. Also blew up on my firewall as soon as traffic started
   transitting it. Same trace as far as I can see.
   
    Ken
   
  
  panic'ing my way along the stack I find that the problem starts in
  pf_reassemble(), when the 'if (!pf_isfull_fragment(frag))' test
  leaves m0 as NULL and returns PF_PASS to pf_normalize_ip(). *m0 is
  tested and found to be NULL, so pf_normalize_ip() returns PF_PASS to
  pf_setup_pdesc(). Where *m0 is tested for NULL and causes *action to
  be set to PF_PASS and pf_setup_pdesc() to return -1 to pf_test. m is
  set to *m0 (i.e. NULL) and then pf_test goto's done:. action is PF_PASS
  and 'if (s)' fails so control passes to the first statement of the else,
  which is a pf_scrub() call with m being NULL. Boom.
  
 
 Yes, very good analysis. I came to the same conclusion. I do not
 understand why we do the goto done; case for PF_PASS in case of a
 pf_setup_pdesc() failure. Since in that case *m0 is NULL and so we can
 just return directly from there. I changed my diff to do exactly that. On
 further inspection I think there is no other case where pf_setup_pdesc()
 returns -1 but action is set to PF_PASS. IMO this is a lot saver then
 trying to execute all that code after the done: label.
 
 New diff below
 -- 
 :wq Claudio

This doesn't immediately crash my nfs server like the original did. I'll
let you know if anything else goes wrong. :-)

 Ken



Testers needed for USB-attached athn(4) diff

2011-06-16 Thread Matthew Dempsky
If you have a USB-attached athn(4) device, please test the diff below
and report back to me with a dmesg.

Index: dev/ic/ar5008.c
===
RCS file: /home/mdempsky/anoncvs/cvs/src/sys/dev/ic/ar5008.c,v
retrieving revision 1.19
diff -u -p -r1.19 ar5008.c
--- dev/ic/ar5008.c 6 Jan 2011 07:27:15 -   1.19
+++ dev/ic/ar5008.c 17 Jun 2011 05:06:59 -
@@ -357,7 +357,7 @@ ar5008_gpio_read(struct athn_softc *sc, 
 {
KASSERT(pin  sc-ngpiopins);
if ((sc-flags  ATHN_FLAG_USB)  !AR_SREV_9271(sc))
-   return (!(AR_READ(sc, AR7010_GPIO_IN)  pin)  1);
+   return (!((AR_READ(sc, AR7010_GPIO_IN)  pin)  1));
return ((AR_READ(sc, AR_GPIO_IN_OUT)  (sc-ngpiopins + pin))  1);
 }