On Thu, Jun 25, 2015 at 11:04:00PM +0200, Imre Vadasz wrote:
> On 22:27 Thu 25 Jun , Reyk Floeter wrote:
> > On Thu, Jun 25, 2015 at 09:21:11PM +0200, Mark Kettenis wrote:
> > > There really is no excuse for using dma_alloc(9) if you have the
> > > bus_dmatag_t available.
> > > 
> > > This re-uses tulip_busdma_allocmem(), which simplifies the code for
> > > allocating the dmamap and such.
> > > 
> > > Unfortunately I can't test this myself right now.
> > > 
> > 
> > Fixes the panic on Hyper-V, see dmesg below.
> > 
> > Unrelated to that, no interrupts on the nic with the ioapic enabled
> > (no traffic and autoneg timeouts).  
> > 
> > Reyk
> 
> On DragonFly BSD and NetBSD I was able to get the NIC interrupts working
> with enabled ioapic, by forcing the NIC's IRQ to be configured as
> edge/high triggered instead of level/low in the ioapic.

I had to try this: with a horrible hack(tm) in pci_intr_establish() I
turned de0 into edge triggered and everything works.

Reyk

OpenBSD 5.8-beta (GENERIC.MP) #17: Thu Jun 25 23:54:49 CEST 2015
    root@openbsd.hyperv:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8573091840 (8175MB)
avail mem = 8309399552 (7924MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.3 @ 0xf8ec0 (216 entries)
bios0: vendor American Megatrends Inc. version "090006" date 05/23/2012
bios0: Microsoft Corporation Virtual Machine
acpi0 at bios0: rev 0
acpi0: sleep states S0 S5
acpi0: tables DSDT FACP WAET SLIC OEM0 SRAT APIC OEMB
acpi0: wakeup devices
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 1647.71 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,SSE3,PCLMUL,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,LONG,LAHF,ABM,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,RTM
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 120MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 1975.61 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,SSE3,PCLMUL,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,LONG,LAHF,ABM,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,RTM
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 0, package 1
ioapic0 at mainbus0: apid 0 pa 0xfec00000, version 11, 24 pins
ioapic0: misconfigured as apic 2, remapped to apid 0
acpiprt0 at acpi0: bus 0 (PCI0)
acpicpu0 at acpi0
acpicpu1 at acpi0
allocated pic ioapic0 type level pin 9 level 9 to cpu0 slot 9 idt entry 144
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel 82443BX" rev 0x03
pcib0 at pci0 dev 7 function 0 "Intel 82371AB PIIX4 ISA" rev 0x01
pciide0 at pci0 dev 7 function 1 "Intel 82371AB IDE" rev 0x01: DMA, channel 0 
wired to compatibility, channel 1 wired to compatibility
allocated pic ioapic0 type edge pin 14 level 6 to cpu0 slot 14 idt entry 96
wd0 at pciide0 channel 0 drive 0: <Virtual HD>
wd0: 128-sector PIO, LBA48, 10240MB, 20971520 sectors
wd0(pciide0:0:0): using PIO mode 4, DMA mode 2
allocated pic ioapic0 type edge pin 15 level 6 to cpu0 slot 15 idt entry 97
atapiscsi0 at pciide0 channel 1 drive 0
scsibus1 at atapiscsi0: 2 targets
cd0 at scsibus1 targ 0 lun 0: <Msft, Virtual CD/ROM, 1.0> ATAPI 5/cdrom 
removable
cd0(pciide0:1:0): using PIO mode 4, DMA mode 2
piixpm0 at pci0 dev 7 function 3 "Intel 82371AB Power" rev 0x02: SMBus disabled
vga1 at pci0 dev 8 function 0 "Microsoft VGA" rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
de0 at pci0 dev 10 function 0 "DEC 21140" rev 0x20allocated pic ioapic0 type 
edge pin 11 level 7 to cpu0 slot 11 idt entry 112
, 21140A pass 2.0: apic 0 int 11, normal, address 00:15:5d:01:9b:03
isa0 at pcib0
isadma0 at isa0
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
allocated pic ioapic0 type edge pin 6 level 6 to cpu0 slot 6 idt entry 98
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
fd1 at fdc0 drive 1: density unknown
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
allocated pic ioapic0 type edge pin 4 level 9 to cpu0 slot 4 idt entry 145
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
allocated pic ioapic0 type edge pin 3 level 9 to cpu0 slot 3 idt entry 146
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
allocated pic ioapic0 type edge pin 1 level 9 to cpu0 slot 1 idt entry 147
allocated pic ioapic0 type edge pin 12 level 9 to cpu0 slot 12 idt entry 148
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
cpu0: interrupt masks:
IPL 0 mask 7ffffffffff25a5 unmask f80000000000da5a
IPL 1 mask 7ffffffffff25a5 unmask f80000000000da5a
IPL 2 mask 7ffffffffff25a5 unmask f80000000000da5a
IPL 3 mask 7ffffffffff25a5 unmask f80000000000da5a
IPL 4 mask 27ffffffffff25a5 unmask d80000000000da5a
IPL 5 mask 37ffffffffff25a5 unmask c80000000000da5a
IPL 6 mask 37ffffffffffe5e5 unmask c800000000001a1a
IPL 7 mask 37ffffffffffede5 unmask c80000000000121a
IPL 8 mask 3fffffffffffede5 unmask c00000000000121a
IPL 9 mask 3fffffffffffffff unmask c000000000000000
IPL 10 mask 3fffffffffffffff unmask c000000000000000
IPL 11 mask 3fffffffffffffff unmask c000000000000000
IPL 12 mask 7fffffffffffffff unmask 8000000000000000
IPL 13 mask 7fffffffffffffff unmask 8000000000000000
IPL 14 mask ffffffffffffffff unmask 0
IPL 15 mask ffffffffffffffff unmask 0
cpu0 source 1 is pin 1 from pic ioapic0 maxlevel 9
        handler 0xffffffff81089f40 level 9
cpu0 source 3 is pin 3 from pic ioapic0 maxlevel 9
        handler 0xffffffff81087490 level 9
cpu0 source 4 is pin 4 from pic ioapic0 maxlevel 9
        handler 0xffffffff81087490 level 9
cpu0 source 6 is pin 6 from pic ioapic0 maxlevel 6
        handler 0xffffffff815977a0 level 6
cpu0 source 9 is pin 9 from pic ioapic0 maxlevel 9
        handler 0xffffffff81640370 level 9
cpu0 source 11 is pin 11 from pic ioapic0 maxlevel 7
        handler 0xffffffff813b6000 level 7
cpu0 source 12 is pin 12 from pic ioapic0 maxlevel 9
        handler 0xffffffff81089f40 level 9
cpu0 source 14 is pin 14 from pic ioapic0 maxlevel 6
        handler 0xffffffff813c44e0 level 6
cpu0 source 15 is pin 15 from pic ioapic0 maxlevel 6
        handler 0xffffffff813c44e0 level 6
cpu0 source 59 is pin 0 from pic softintr_pic0 maxlevel 8
        handler 0x0 level 8
cpu0 source 60 is pin 0 from pic softintr_pic0 maxlevel 5
        handler 0x0 level 5
cpu0 source 61 is pin 0 from pic softintr_pic0 maxlevel 4
        handler 0x0 level 4
cpu0 source 62 is pin 0 from pic lapic maxlevel 12
        handler 0x0 level 12
cpu0 source 63 is pin 0 from pic lapic maxlevel 14
        handler 0x0 level 14
cpu1: interrupt masks:
IPL 0 mask 7ffffffffffffff unmask f800000000000000
IPL 1 mask 7ffffffffffffff unmask f800000000000000
IPL 2 mask 7ffffffffffffff unmask f800000000000000
IPL 3 mask 7ffffffffffffff unmask f800000000000000
IPL 4 mask 27ffffffffffffff unmask d800000000000000
IPL 5 mask 37ffffffffffffff unmask c800000000000000
IPL 6 mask 37ffffffffffffff unmask c800000000000000
IPL 7 mask 37ffffffffffffff unmask c800000000000000
IPL 8 mask 3fffffffffffffff unmask c000000000000000
IPL 9 mask 3fffffffffffffff unmask c000000000000000
IPL 10 mask 3fffffffffffffff unmask c000000000000000
IPL 11 mask 3fffffffffffffff unmask c000000000000000
IPL 12 mask 7fffffffffffffff unmask 8000000000000000
IPL 13 mask 7fffffffffffffff unmask 8000000000000000
IPL 14 mask ffffffffffffffff unmask 0
IPL 15 mask ffffffffffffffff unmask 0
cpu1 source 59 is pin 0 from pic softintr_pic0 maxlevel 8
        handler 0x0 level 8
cpu1 source 60 is pin 0 from pic softintr_pic0 maxlevel 5
        handler 0x0 level 5
cpu1 source 61 is pin 0 from pic softintr_pic0 maxlevel 4
        handler 0x0 level 4
cpu1 source 62 is pin 0 from pic lapic maxlevel 12
        handler 0x0 level 12
cpu1 source 63 is pin 0 from pic lapic maxlevel 14
        handler 0x0 level 14
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on wd0a (02632bce06e92172.a) swap on wd0b dump on wd0b

Reply via email to