I recently bought a Lenovo ThinkServer TS140 to replace my aging HP
Microserver. Rather than using a standard serial console to admin the
machine, I've been playing around with the Intel AMT serial-over-LAN
capabilities. The following notes might help others who'd like to use this
feature with OpenBSD; hopefully they'll save you some hair-tearing.

The Intel AMT technology can piggyback on the onboard NIC, sharing the
same IP and MAC as the operating system. I'm not a fan of that idea, so I
opted to leave the onboard NIC as a dedicated management interface and add
another NIC for the OS. So, in my system, em0 (onboard) is used only for
serial-over-LAN administration, and em1 (PCI-E card) is used by OpenBSD.

Lenovo published a pretty decent PDF on configuring AMT, available here:

http://www.lenovo.com/images/products/server/pdfs/tech_resources/thinkserver_config_amt_ts140_ts440_tr.pdf

To get serial-over-LAN working, you can largely follow that PDF, but for
steps 18 and 19, you can leave IDER and KVM disabled. For step 20, Legacy
Redirection Mode needs to be enabled.

The serial-over-LAN device is presented as a puc(4) card with com4
attaching to it:

puc0 at pci0 dev 22 function 3 "Intel 8 Series KT" rev 0x04: ports: 1 com
com4 at puc0 port 0 apic 8 int 19: ns16550a, 16 byte fifo

To get a working console, I edited /etc/ttys like so:
tty04   "/usr/libexec/getty std.9600"   vt220   on  secure

Then, to get the console working at boot, I configured /etc/boot.conf as
follows:
machine comaddr 0x0000f0e0/0x0008
set tty com4

The "machine commaddr 0x0000f0e0/0x0008" line was worked out by running
'pcidump -v' and finding the BAR io addr for this device:

 0:22:3: Intel 8 Series KT
        0x0000: Vendor ID: 8086 Product ID: 8c3d
        0x0004: Command: 0007 Status: 00b0
        0x0008: Class: 07 Subclass: 00 Interface: 02 Revision: 04
        0x000c: BIST: 00 Header Type: 00 Latency Timer: 00 Cache Line
Size: 00
        0x0010: BAR io addr: 0x0000f0e0/0x0008
        0x0014: BAR mem 32bit addr: 0xf7d3e000/0x00001000
        0x0018: BAR empty (00000000)
        0x001c: BAR empty (00000000)
        0x0020: BAR empty (00000000)
        0x0024: BAR empty (00000000)
        0x0028: Cardbus CIS: 00000000
        0x002c: Subsystem Vendor ID: 17aa Product ID: 30a5
        0x0030: Expansion ROM Base Address: 00000000
        0x0038: 00000000
        0x003c: Interrupt Pin: 02 Line: 0a Min Gnt: 00 Max Lat: 00
        0x00c8: Capability 0x01: Power Management
        0x00d0: Capability 0x05: Message Signaled Interrupts (MSI)

That completed the setup on the ThinkServer side. To connect to it from my
workstation, I installed the amtterm-cli package and ran 'amtterm
192.168.1.19' (the IP address I'd assigned to the AMT interface during
setup).

Playing around with powering up/shutting down/rebooting produced a lot of
erratic results that left me scratching my head. I'd be able to connect,
then suddenly lose the connection and be unable to reestablish it. I
eventually noticed in my workstation's ARP table that the MAC for the
management interface had changed to all zeros. Obviously, that's going to
cause some connectivity issues!

Apparently, the serial-over-LAN function works just fine through the boot
process, up until the OS initializes the NIC. Connectivity drops, and the
MAC ends up all zeros. I was able to partially work around this by
creating a hostname.em0 file containing 'up' on the ThinkServer. By
bringing the interface up but otherwise unconfigured, the correct MAC
address is retained.

Now, If I reboot during a serial-over-LAN session, I see the normal boot
messages up until the NIC is initialized, and then the connection is
dropped. However, I'm able to re-open the connection just a few seconds
later, once the OS brings the interface up.

Other than this disconnect issue, it basically works like any other serial
console. If anyone has any clues on ways to resolve that disconnect issue,
I'd love to hear about it.

Full dmesg follows:

OpenBSD 5.8-current (GENERIC.MP) #1289: Sat Aug 29 12:12:47 MDT 2015
    dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4162596864 (3969MB)
avail mem = 4032548864 (3845MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.8 @ 0xedc10 (87 entries)
bios0: vendor LENOVO version "FBKTB3AUS" date 06/16/2015
bios0: LENOVO ThinkServer TS140
acpi0 at bios0: rev 2
acpi0: sleep states S0 S5
acpi0: tables DSDT FACP APIC FPDT FIDT TCPA DBGP LUFT SSDT SSDT MCFG HPET
SSDT SSDT ASF! BGRT EINJ ERST HEST BERT
acpi0: wakeup devices UAR1(S0) UAR2(S0) PS2K(S0) PS2M(S0) PXSX(S0)
RP01(S0) PXSX(S0) RP02(S0) PXSX(S0) RP03(S0) PXSX(S0) RP04(S0) PXSX(S0)
RP05(S0) PXSX(S0) RP06(S0) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Xeon(R) CPU E3-1225 v3 @ 3.20GHz, 3392.66 MHz
cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,SENSOR,ARAT
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Xeon(R) CPU E3-1225 v3 @ 3.20GHz, 3392.15 MHz
cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,SENSOR,ARAT
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 4 (application processor)
cpu2: Intel(R) Xeon(R) CPU E3-1225 v3 @ 3.20GHz, 3392.15 MHz
cpu2:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,SENSOR,ARAT
cpu2: 256KB 64b/line 8-way L2 cache
cpu2: smt 0, core 2, package 0
cpu3 at mainbus0: apid 6 (application processor)
cpu3: Intel(R) Xeon(R) CPU E3-1225 v3 @ 3.20GHz, 3392.15 MHz
cpu3:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,SENSOR,ARAT
cpu3: 256KB 64b/line 8-way L2 cache
cpu3: smt 0, core 3, package 0
ioapic0 at mainbus0: apid 8 pa 0xfec00000, version 20, 24 pins
acpimcfg0 at acpi0 addr 0xf8000000, bus 0-63
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (RP01)
acpiprt2 at acpi0: bus 2 (RP02)
acpiprt3 at acpi0: bus 3 (RP04)
acpiprt4 at acpi0: bus -1 (PEG0)
acpiprt5 at acpi0: bus -1 (PEG1)
acpiprt6 at acpi0: bus -1 (PEG2)
acpiec0 at acpi0: not present
acpicpu0 at acpi0: C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS
acpicpu1 at acpi0: C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS
acpicpu2 at acpi0: C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS
acpicpu3 at acpi0: C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS
acpipwrres0 at acpi0: FN00, resource for FAN0
acpipwrres1 at acpi0: FN01, resource for FAN1
acpipwrres2 at acpi0: FN02, resource for FAN2
acpipwrres3 at acpi0: FN03, resource for FAN3
acpipwrres4 at acpi0: FN04, resource for FAN4
acpitz0 at acpi0: critical temperature is 105 degC
acpitz1 at acpi0: critical temperature is 105 degC
acpibat0 at acpi0: BAT0 not present
acpibat1 at acpi0: BAT1 not present
acpibat2 at acpi0: BAT2 not present
acpibtn0 at acpi0: PWRB
acpibtn1 at acpi0: LID0
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD1F
cpu0: Enhanced SpeedStep 3392 MHz: speeds: 3201, 3200, 3000, 2900, 2700,
2500, 2300, 2200, 2000, 1800, 1700, 1500, 1300, 1100, 1000, 800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Xeon E3-1200 v3 Host" rev 0x06
vga1 at pci0 dev 2 function 0 "Intel HD Graphics P4600" rev 0x06
intagp at vga1 not configured
inteldrm0 at vga1
drm0 at inteldrm0
error: [drm:pid0:i915_write32] *ERROR* Unknown unclaimed register before
writing to 100000
inteldrm0: 1024x768
wsdisplay0 at vga1 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
azalia0 at pci0 dev 3 function 0 "Intel Core 4G HD Audio" rev 0x06: msi
azalia0: No codecs found
xhci0 at pci0 dev 20 function 0 "Intel 8 Series xHCI" rev 0x05: msi
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 "Intel xHCI root hub" rev 3.00/1.00 addr 1
"Intel 8 Series MEI" rev 0x04 at pci0 dev 22 function 0 not configured
puc0 at pci0 dev 22 function 3 "Intel 8 Series KT" rev 0x04: ports: 1 com
com4 at puc0 port 0 apic 8 int 19: ns16550a, 16 byte fifo
com4: console
em0 at pci0 dev 25 function 0 "Intel I217-LM" rev 0x05: msi, address
6c:0b:84:09:f9:bd
em0: PHY reset is blocked due to SOL/IDER session.
ehci0 at pci0 dev 26 function 0 "Intel 8 Series USB" rev 0x05: apic 8 int 17
usb1 at ehci0: USB revision 2.0
uhub1 at usb1 "Intel EHCI root hub" rev 2.00/1.00 addr 1
azalia1 at pci0 dev 27 function 0 "Intel 8 Series HD Audio" rev 0x05: msi
azalia1: codecs: Realtek ALC662
audio0 at azalia1
ppb0 at pci0 dev 28 function 0 "Intel 8 Series PCIE" rev 0xd5
pci1 at ppb0 bus 1
ppb1 at pci0 dev 28 function 1 "Intel 8 Series PCIE" rev 0xd5: msi
pci2 at ppb1 bus 2
em1 at pci2 dev 0 function 0 "Intel 82574L" rev 0x00: msi, address
68:05:ca:3a:8e:b2
ppb2 at pci0 dev 28 function 3 "Intel 8 Series PCIE" rev 0xd5: msi
pci3 at ppb2 bus 3
ppb3 at pci3 dev 0 function 0 "ITExpress IT8893E PCIE-PCI" rev 0x41
pci4 at ppb3 bus 4
ehci1 at pci0 dev 29 function 0 "Intel 8 Series USB" rev 0x05: apic 8 int 23
usb2 at ehci1: USB revision 2.0
uhub2 at usb2 "Intel EHCI root hub" rev 2.00/1.00 addr 1
pcib0 at pci0 dev 31 function 0 "Intel C226 LPC" rev 0x05
ahci0 at pci0 dev 31 function 2 "Intel 8 Series AHCI" rev 0x05: msi, AHCI 1.3
ahci0: port 0: 6.0Gb/s
ahci0: port 1: 6.0Gb/s
ahci0: port 2: 6.0Gb/s
ahci0: port 3: 6.0Gb/s
ahci0: port 4: 1.5Gb/s
scsibus1 at ahci0: 32 targets
sd0 at scsibus1 targ 0 lun 0: <ATA, Samsung SSD 850, EMT0> SCSI3 0/direct
fixed naa.5002538d4019e022
sd0: 238475MB, 512 bytes/sector, 488397168 sectors, thin
sd1 at scsibus1 targ 1 lun 0: <ATA, ST4000VN000-1H41, SC46> SCSI3 0/direct
fixed naa.5000c50079458b1b
sd1: 3815447MB, 512 bytes/sector, 7814037168 sectors
sd2 at scsibus1 targ 2 lun 0: <ATA, ST4000VN000-1H41, SC46> SCSI3 0/direct
fixed naa.5000c500799ccc22
sd2: 3815447MB, 512 bytes/sector, 7814037168 sectors
sd3 at scsibus1 targ 3 lun 0: <ATA, ST4000VN000-1H41, SC46> SCSI3 0/direct
fixed naa.5000c500794576ca
sd3: 3815447MB, 512 bytes/sector, 7814037168 sectors
cd0 at scsibus1 targ 4 lun 0: <HL-DT-ST, DVD-ROM DTA0N, DC01> ATAPI
5/cdrom removable
ichiic0 at pci0 dev 31 function 3 "Intel 8 Series SMBus" rev 0x05: apic 8
int 18
iic0 at ichiic0
sdtemp0 at iic0 addr 0x19: mcp98243
spdmem0 at iic0 addr 0x51: 4GB DDR3 SDRAM ECC PC3-12800 with thermal sensor
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
uhidev0 at uhub0 port 10 configuration 1 interface 0 "APC Back-UPS ES 450
FW:844.K2 .D USB FW:K2" rev 1.10/1.06 addr 2
uhidev0: iclass 3/0, 123 report ids
upd0 at uhidev0
uhub3 at uhub1 port 1 "Intel Rate Matching Hub" rev 2.00/0.05 addr 2
uhub4 at uhub2 port 1 "Intel Rate Matching Hub" rev 2.00/0.05 addr 2
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
sd4 at scsibus3 targ 1 lun 0: <OPENBSD, SR RAID 1, 005> SCSI2 0/direct fixed
sd4: 3815447MB, 512 bytes/sector, 7814036576 sectors
root on sd0a (918dcdbb8c221cb4.a) swap on sd0b dump on sd0b

-- 
Joe Gidi
j...@entropicblur.com

"You cannot buy skill." -- Ross Seyfried

Reply via email to