Subject: VIA C7 CPU and crypto capabilities
To: None <current-users@netbsd.org>
From: Heron Gallegos <gallegos@csxxi.net.mx>
List: current-users
Date: 06/24/2007 23:03:58
Hello

I dont know how to begin my question... I was trying to start the
VIA PadLock ACE. I compiled my custom kernel 4.99.20 with the option
VIA_PADLOCK. I could not see difference between the GENERIC dmesg
and the new one.

My machine is a MSI Axis 700 Lite barebone. The motherboard is mini-ITX
MS-7199 with VIA C7 processor and VIA CN700 and VT8237R+ for north
and southbridge. MSI manual says "Security Feature RGN/AES/SHA-1" in
the mainboard specificatios section.

In the dmesg, I can not see evidence of AES in the cpu flags (complete
dmesg is at end of this mail)

polaris# dmesg | grep cpu0
cpu0 at mainbus0 apid 0: (boot processor)
cpu0: VIA C3 (686-class), 799.99 MHz, id 0x6a9
cpu0: features a7d9bbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu0: features a7d9bbff<PGE,CMOV,PAT,MPC,NOX,MMXX,MMX>
cpu0: features a7d9bbff<FXSR,SSE,SSE2,LONG,3DNOW>
cpu0: features2 181<SSE3,EST,TM2>
cpu0: "VIA Esther processor 1000MHz"
cpu0: I-cache 64 KB 64B/line 4-way, D-cache 64 KB 64B/line 4-way
cpu0: L2 cache 128 KB 64B/line 10-way
cpu0: ITLB 128 4 KB entries 8-way
cpu0: DTLB 128 4 KB entries 8-way
cpu0: using thermal monitor 2
cpu0: Enhanced SpeedStep (1004 mV) 533 MHz
cpu0: unknown Enhanced SpeedStep CPU.
cpu0: using only highest, current and lowest power states.
cpu0: Enhanced SpeedStep frequencies available (MHz): 667 533 533
cpu0: calibrating local timer
cpu0: apic clock running at 99 MHz
cpu0: 4 page colors
polaris#

The CPU name must be C7, 799.99 is ok (I am using low speed)
Note the SpeedStep is incorrectly detected.

Trying to find the cause, I added a "printf" to the file
/sys/arch/x86/x86/via_padlock.c before a new compilation:

void
via_padlock_attach(void)
{
         if (!(cpu_feature_padlock & CPUID_FEAT_VACE)) {
                 printf("PadLock: MYTEST No cpu feature No CPU FEAT VACE\n");
                 return;
         }

and now, the new dmesg display my printf. I would like to investigate the
cause in the source code but it is too easy to burn the brain :)

What can I do?

Thanks in advance

Heron Gallegos
Saltillo Coahuila Mexico

Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     2006, 2007
     The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
     The Regents of the University of California.  All rights reserved.

NetBSD 4.99.20 (POLARIS) #1: Sun Jun 24 21:10:22 CDT 2007
         gallegos@polaris:/sys/arch/i386/compile/POLARIS
total memory = 494 MB
rbus: rbus_min_start set to 0x40000000
avail memory = 475 MB
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "i8254" frequency 1193182 Hz quality 100
BIOS32 rev. 0 found at 0xf92c0
mainbus0 (root)
cpu0 at mainbus0 apid 0: (boot processor)
cpu0: VIA C3 (686-class), 799.99 MHz, id 0x6a9
cpu0: features a7d9bbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu0: features a7d9bbff<PGE,CMOV,PAT,MPC,NOX,MMXX,MMX>
cpu0: features a7d9bbff<FXSR,SSE,SSE2,LONG,3DNOW>
cpu0: features2 181<SSE3,EST,TM2>
cpu0: "VIA Esther processor 1000MHz"
cpu0: I-cache 64 KB 64B/line 4-way, D-cache 64 KB 64B/line 4-way
cpu0: L2 cache 128 KB 64B/line 10-way
cpu0: ITLB 128 4 KB entries 8-way
cpu0: DTLB 128 4 KB entries 8-way
cpu0: using thermal monitor 2
cpu0: Enhanced SpeedStep (1004 mV) 533 MHz
cpu0: unknown Enhanced SpeedStep CPU.
cpu0: using only highest, current and lowest power states.
cpu0: Enhanced SpeedStep frequencies available (MHz): 667 533 533
cpu0: calibrating local timer
cpu0: apic clock running at 99 MHz
cpu0: 4 page colors
ioapic0 at mainbus0 apid 2
ioapic0: pa 0xfec00000, version 3, 24 pins
acpi0 at mainbus0: Advanced Configuration and Power Interface
acpi0: using Intel ACPI CA subsystem version 20060217
acpi0: X/RSDT: OemId <CN700 ,AWRDACPI,42302e31>, AslId <AWRD,00000000>
acpi0: SCI interrupting at int 9
acpi0: fixed-feature power button present
timecounter: Timecounter "ACPI-Fast" frequency 3579545 Hz quality 1000
ACPI-Fast 24-bit timer
ACPI Object Type 'Processor' (0x0c) at acpi0 not configured
acpibut0 at acpi0 (PNP0C0C): ACPI Power Button
acpibut1 at acpi0 (PNP0C0E): ACPI Sleep Button
PNP0C01 [System Board] at acpi0 not configured
PNP0A03 [PCI/PCI-X Host Bridge] at acpi0 not configured
PNP0C02 [Plug and Play motherboard register resources] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C02 [Plug and Play motherboard register resources] at acpi0 not configured
PNP0000 [AT Interrupt Controller] at acpi0 not configured
PNP0200 [AT DMA Controller] at acpi0 not configured
attimer1 at acpi0 (PNP0100): AT Timer
attimer1: io 0x40-0x43 irq 0
PNP0B00 [AT Real-Time Clock] at acpi0 not configured
pcppi1 at acpi0 (PNP0800)
pcppi1: io 0x61
midi0 at pcppi1: PC speaker (CPU-intensive output)
sysbeep0 at pcppi1
npx1 at acpi0 (PNP0C04)
npx1: io 0xf0-0xff irq 13
npx1: reported by CPUID; using exception 16
com3 at acpi0 (PNP0501-1)
com3: io 0x3f8-0x3ff irq 4
com3: ns16550a, working fifo
com4 at acpi0 (PNP0501-2)
com4: io 0x2f8-0x2ff irq 3
com4: ns16550a, working fifo
pckbc1 at acpi0 (PNP0303): kbd port
pckbc1: io 0x60,0x64 irq 1
PNP0C0B [ACPI Fan] at acpi0 not configured
acpitz0 at acpi0: ACPI Thermal Zone
acpitz0: unable to get polling interval; using default of 30.0s
acpitz0: active cooling level 0: 80.0C
acpitz0: critical 80.0C passive 57.0C
apm0 at acpi0: Power Management spec V1.2
pcppi1: attached to attimer1
pckbd0 at pckbc1 (kbd slot)
pckbc1: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pchb0 at pci0 dev 0 function 0
pchb0: VIA Technologies product 0x0314 (rev. 0x00)
agp0 at pchb0 (v3): aperture at 0xe8000000, size 0x10000000
pchb1 at pci0 dev 0 function 1
pchb1: VIA Technologies product 0x1314 (rev. 0x00)
pchb2 at pci0 dev 0 function 2
pchb2: VIA Technologies product 0x2314 (rev. 0x00)
pchb3 at pci0 dev 0 function 3
pchb3: VIA Technologies product 0x3208 (rev. 0x00)
pchb4 at pci0 dev 0 function 4
pchb4: VIA Technologies product 0x4314 (rev. 0x00)
pchb5 at pci0 dev 0 function 7
pchb5: VIA Technologies product 0x7314 (rev. 0x00)
ppb0 at pci0 dev 1 function 0: VIA Technologies VT8377CE CPU-AGP Bridge (rev. 0x00)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: VIA Technologies VT3314 CN900 UniChrome Integrated Graphics (rev. 0x01)
wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation), using wskbd0
wsmux1: connecting to wsdisplay0
direct rendering for vga1 unsupported
viaide0 at pci0 dev 15 function 0
viaide0: VIA Technologies VT8237 SATA Controller (rev. 0x80)
viaide0: bus-master DMA support present
viaide0: primary channel wired to native-PCI mode
viaide0: using ioapic0 pin 20 (irq 11) for native-PCI interrupt
atabus0 at viaide0 channel 0
viaide0: secondary channel wired to native-PCI mode
atabus1 at viaide0 channel 1
viaide1 at pci0 dev 15 function 1
viaide1: VIA Technologies VT8237 ATA133 controller
viaide1: bus-master DMA support present
viaide1: primary channel configured to compatibility mode
viaide1: primary channel interrupting at ioapic0 pin 14 (irq 14)
atabus2 at viaide1 channel 0
viaide1: secondary channel configured to compatibility mode
viaide1: secondary channel ignored (disabled)
uhci0 at pci0 dev 16 function 0: VIA Technologies VT83C572 USB Controller (rev. 0x81)
uhci0: interrupting at ioapic0 pin 21 (irq 10)
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: VIA Technologies UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 16 function 1: VIA Technologies VT83C572 USB Controller (rev. 0x81)
uhci1: interrupting at ioapic0 pin 21 (irq 10)
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: VIA Technologies UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2 at pci0 dev 16 function 2: VIA Technologies VT83C572 USB Controller (rev. 0x81)
uhci2: interrupting at ioapic0 pin 21 (irq 11)
usb2 at uhci2: USB revision 1.0
uhub2 at usb2
uhub2: VIA Technologies UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
uhci3 at pci0 dev 16 function 3: VIA Technologies VT83C572 USB Controller (rev. 0x81)
uhci3: interrupting at ioapic0 pin 21 (irq 11)
usb3 at uhci3: USB revision 1.0
uhub3 at usb3
uhub3: VIA Technologies UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub3: 2 ports with 2 removable, self powered
ehci0 at pci0 dev 16 function 4: VIA Technologies VT8237 EHCI USB Controller (rev. 0x86)
ehci0: interrupting at ioapic0 pin 21 (irq 5)
ehci0: BIOS has given up ownership
ehci0: EHCI version 1.0
ehci0: companion controllers, 2 ports each: uhci0 uhci1 uhci2 uhci3
usb4 at ehci0: USB revision 2.0
uhub4 at usb4
uhub4: VIA Technologies EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub4: 8 ports with 8 removable, self powered
pcib0 at pci0 dev 17 function 0
pcib0: VIA Technologies VT8237 (Apollo KT600) PCI-ISA Bridge (rev. 0x00)
auvia0 at pci0 dev 17 function 5: VIA Technologies VT8237 AC'97 Audio (rev 0x60)
auvia0: interrupting at ioapic0 pin 22 (irq 5)
auvia0: ac97: VIA Technologies unknown (0x56494182) codec; 18 bit DAC, 18 bit ADC, no 3D stereo
auvia0: ac97: ext id 9c3<AC97_23,LDAC,SDAC,CDAC,DRA,VRA>
audio0 at auvia0: full duplex, mmap, independent
vr0 at pci0 dev 18 function 0: VIA VT6102 (Rhine II) 10/100 Ethernet
vr0: interrupting at ioapic0 pin 23 (irq 10)
vr0: Ethernet address: 00:19:db:29:9e:18
ukphy0 at vr0 phy 1: Generic IEEE 802.3u media interface
ukphy0: OUI 0x0002c6, model 0x0032, rev. 10
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
isa0 at pcib0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
isapnp0: no ISA Plug 'n Play devices found
PadLock: No cpu feature No CPU FEAT VACE <------------------------------------------------
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
Kernelized RAIDframe activated
wd0 at atabus2 drive 0: <TOSHIBA MK6034GAX>
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 57231 MB, 116280 cyl, 16 head, 63 sec, 512 bytes/sect x 117210240 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd1 at atabus2 drive 1: <TOSHIBA MK6034GAX>
wd1: drive supports 16-sector PIO transfers, LBA48 addressing
wd1: 57231 MB, 116280 cyl, 16 head, 63 sec, 512 bytes/sect x 117210240 sectors
wd1: 32-bit data port
wd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd0(viaide1:0:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA)
wd1(viaide1:0:1): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA)
uhidev0 at uhub0 port 1 configuration 1 interface 0
uhidev0: Creative Labs Notebook Optical Mouse, rev 1.10/0.00, addr 2, iclass 3/1
ums0 at uhidev0: 5 buttons and Z dir.
wsmouse0 at ums0 mux 0
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25, vt100 emulation)