Index | Thread | Search

From:
Mike Larkin <mlarkin@nested.page>
Subject:
Re: AMD SEV 4/5: Add ccp(4) to MAKEDEV
To:
Alexander Bluhm <alexander.bluhm@gmx.net>
Cc:
tech@openbsd.org
Date:
Sun, 8 Sep 2024 23:46:23 -0700

Download raw body.

Thread
On Mon, Sep 02, 2024 at 03:52:45PM +0200, Alexander Bluhm wrote:
> On Wed, Aug 28, 2024 at 03:26:33PM +0200, Hans-J?rg H?xer wrote:
> > this will add ccp(4) to MAKEDEV (after sync).
>
> Two questions come to my mind:
> - do we need ccp0 ccp1 ccp2 ?
> - would /deb/psp be more suitable ?
>
> I do have a machine where two ccp attach.  Full dmesg below.
>
> ccp0 at pci4 dev 0 function 2 "AMD 17h Crypto" rev 0x00: msix: RNG
> ccp1 at pci5 dev 0 function 1 "AMD 17h Crypto" rev 0x00: msix: RNG
>

Maybe one per physical CPU package? Shrug.

> It does not support SEV, and it is unclear how a PSP would work
> there.  I discussed with hshoexer@ and we concluded to keep a single
> /dev/ccp without numbering for now.  We can change when we find a
> machine that needs it.
>
> To avoid further confusion we prefered ccp over psp.  But now jsg@
> moved the relevant part from dev/ic/ccp.c to dev/ic/psp.c .  ccp
> (cryptographic co-processor) does not need ioctl.  Only psp (platform
> security processor) is used by /dev/ccp.  Should we call it /dev/psp?
>
> Naming is hard.
>
> bluhm
>
> > ----------------------------------------------------------------------------
> > commit 39cb0e19f7e1908cabb66b407151fbc74b6c3cd9
> > Author: Hans-Joerg Hoexer <hshoexer@genua.de>
> > Date:   Wed Aug 28 13:15:25 2024 +0200
> >
> >     ccp(4): Add ccp(4) to MAKEDEV
> >
> > diff --git a/etc/MAKEDEV.common b/etc/MAKEDEV.common
> > index 1e7bb3d235a..516133c9d02 100644
> > --- a/etc/MAKEDEV.common
> > +++ b/etc/MAKEDEV.common
> > @@ -167,6 +167,7 @@ target(all, bpf)dnl
> >  target(all, kcov)dnl
> >  target(all, dt)dnl
> >  target(all, kstat)dnl
> > +target(all, ccp)dnl
> >  dnl
> >  _mkdev(all, {-all-}, {-dnl
> >  show_target(all)dnl
> > @@ -535,3 +536,5 @@ __devitem(kstat, kstat, Kernel Statistics)dnl
> >  _mkdev(kstat, kstat, {-M kstat c major_kstat_c 0 640-})dnl
> >  __devitem(efi, efi, EFI runtime services)dnl
> >  _mkdev(efi, efi, {-M efi c major_efi_c 0 600-})dnl
> > +__devitem(ccp, ccp, Cryptographic Co-Processor)dnl
> > +_mkdev(ccp, ccp, {-M ccp c major_ccp_c 0 600-})dnl
> > diff --git a/etc/etc.amd64/MAKEDEV.md b/etc/etc.amd64/MAKEDEV.md
> > index ccc5a3c37bd..e2b8b478edd 100644
> > --- a/etc/etc.amd64/MAKEDEV.md
> > +++ b/etc/etc.amd64/MAKEDEV.md
> > @@ -99,6 +99,7 @@ _DEV(vmm, 10)
> >  _DEV(vscsi, 89)
> >  _DEV(pvbus, 95)
> >  _DEV(kstat, 51)
> > +_DEV(ccp, 101)
> >  dnl
> >  divert(__mddivert)dnl
> >  dnl
>
>
> OpenBSD 7.6-beta (GENERIC.MP) #0: Sun Sep  1 20:17:36 CEST 2024
>     root@ot33.obsd-lab.genua.de:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> real mem = 17028726784 (16239MB)
> avail mem = 16489250816 (15725MB)
> random: good seed from bootblocks
> mpath0 at root
> scsibus0 at mpath0: 256 targets
> mainbus0 at root
> bios0 at mainbus0: SMBIOS rev. 2.8 @ 0xdab19000 (51 entries)
> bios0: vendor American Megatrends Inc. version "1.0c" date 06/30/2020
> bios0: genua Super Server
> acpi0 at bios0: ACPI 6.1
> acpi0: sleep states S0 S5
> acpi0: tables DSDT FACP APIC FPDT FIDT SSDT SPMI SSDT MCFG SSDT CRAT CDIT BERT EINJ HEST HPET SSDT UEFI SSDT WSMT
> acpi0: wakeup devices S0D0(S0) S0D1(S0) S0D2(S0) S0D3(S0) S1D0(S0) S1D1(S0) S1D2(S0) S1D3(S0)
> acpitimer0 at acpi0: 3579545 Hz, 32 bits
> acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
> cpu0 at mainbus0: apid 0 (boot processor)
> cpu0: AMD EPYC 3151 4-Core Processor, 2700.00 MHz, 17-01-02, patch 0800126f
> cpu0: cpuid 1 edx=178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT> ecx=76d8320b<SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND>
> cpu0: cpuid 6 eax=4<ARAT> ecx=1<EFFFREQ>
> cpu0: cpuid 7.0 ebx=209c01a9<FSGSBASE,BMI1,AVX2,SMEP,BMI2,RDSEED,ADX,SMAP,CLFLUSHOPT,SHA>
> cpu0: cpuid d.1 eax=f<XSAVEOPT,XSAVEC,XGETBV1,XSAVES>
> cpu0: cpuid 80000001 edx=2fd3fbff<NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG> ecx=35c233ff<LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,SKINIT,TCE,TOPEXT,CPCTR,DBKP,PCTRL3,MWAITX>
> cpu0: cpuid 80000007 edx=6799<HWPSTATE,ITSC>
> cpu0: cpuid 80000008 ebx=1007<IBPB>
> cpu0: cpuid 8000001F eax=f<SME,SEV,PFLUSH_MSR,SEVES> ecx=f edx=1
> cpu0: 32KB 64b/line 8-way D-cache, 64KB 64b/line 4-way I-cache, 512KB 64b/line 8-way L2 cache, 8MB 64b/line 16-way L3 cache
> cpu0: smt 0, core 0, package 0
> mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
> cpu0: apic clock running at 100MHz
> cpu0: mwait min=64, max=64, C-substates=1.1, IBE
> cpu1 at mainbus0: apid 2 (application processor)
> cpu1: AMD EPYC 3151 4-Core Processor, 2700.00 MHz, 17-01-02, patch 0800126f
> cpu1: smt 0, core 1, package 0
> cpu2 at mainbus0: apid 8 (application processor)
> cpu2: AMD EPYC 3151 4-Core Processor, 2700.00 MHz, 17-01-02, patch 0800126f
> cpu2: smt 0, core 4, package 0
> cpu3 at mainbus0: apid 10 (application processor)
> cpu3: AMD EPYC 3151 4-Core Processor, 2700.00 MHz, 17-01-02, patch 0800126f
> cpu3: smt 0, core 5, package 0
> cpu4 at mainbus0: apid 1 (application processor)
> cpu4: AMD EPYC 3151 4-Core Processor, 2700.00 MHz, 17-01-02, patch 0800126f
> cpu4: smt 1, core 0, package 0
> cpu5 at mainbus0: apid 3 (application processor)
> cpu5: AMD EPYC 3151 4-Core Processor, 2700.00 MHz, 17-01-02, patch 0800126f
> cpu5: smt 1, core 1, package 0
> cpu6 at mainbus0: apid 9 (application processor)
> cpu6: AMD EPYC 3151 4-Core Processor, 2700.00 MHz, 17-01-02, patch 0800126f
> cpu6: smt 1, core 4, package 0
> cpu7 at mainbus0: apid 11 (application processor)
> cpu7: AMD EPYC 3151 4-Core Processor, 2700.00 MHz, 17-01-02, patch 0800126f
> cpu7: smt 1, core 5, package 0
> ioapic0 at mainbus0: apid 128 pa 0xfec00000, version 21, 24 pins, can't remap
> ioapic1 at mainbus0: apid 129 pa 0xefff0000, version 21, 32 pins, can't remap
> acpimcfg0 at acpi0
> acpimcfg0: addr 0xf0000000, bus 0-127
> acpihpet0 at acpi0: 14318180 Hz
> acpiprt0 at acpi0: bus 0 (PCI0)
> acpiprt1 at acpi0: bus -1 (D0A0)
> acpiprt2 at acpi0: bus 1 (D0A2)
> acpiprt3 at acpi0: bus 2 (ASTB)
> acpiprt4 at acpi0: bus 3 (D0A4)
> acpiprt5 at acpi0: bus -1 (D0B0)
> acpiprt6 at acpi0: bus -1 (D0B1)
> acpiprt7 at acpi0: bus 5 (S0D0)
> acpiprt8 at acpi0: bus 6 (BR17)
> acpipci0 at acpi0 PCI0: 0x00000010 0x00000011 0x00000000
> acpicmos0 at acpi0
> com0 at acpi0 UAR1 addr 0x3f8/0x8 irq 4: ns16550a, 16 byte fifo
> com0: console
> com1 at acpi0 UAR2 addr 0x2f8/0x8 irq 3: ns16550a, 16 byte fifo
> "IPI0001" at acpi0 not configured
> dwiic0 at acpi0 I2CA addr 0xfedc2000/0x1000 irq 10
> iic0 at dwiic0
> dwiic1 at acpi0 I2CB addr 0xfedc3000/0x1000 irq 11
> iic1 at dwiic1
> dwiic2 at acpi0 I2CC addr 0xfedc4000/0x1000 irq 12
> iic2 at dwiic2
> dwiic3 at acpi0 I2CD addr 0xfedc5000/0x1000 irq 13
> iic3 at dwiic3
> dwiic4 at acpi0 I2CE addr 0xfedc6000/0x1000 irq 14
> iic4 at dwiic4
> dwiic5 at acpi0 I2CF addr 0xfedcb000/0x1000 irq 15
> iic5 at dwiic5
> amdgpio0 at acpi0 GPIO uid 0 addr 0xfed81500/0x300 irq 7, 184 pins
> acpibtn0 at acpi0: PWRB
> acpicpu0 at acpi0: C2(0@400 io@0x814), C1(0@1 mwait), PSS
> acpicpu1 at acpi0: C2(0@400 io@0x814), C1(0@1 mwait), PSS
> acpicpu2 at acpi0: C2(0@400 io@0x814), C1(0@1 mwait), PSS
> acpicpu3 at acpi0: C2(0@400 io@0x814), C1(0@1 mwait), PSS
> acpicpu4 at acpi0: C2(0@400 io@0x814), C1(0@1 mwait), PSS
> acpicpu5 at acpi0: C2(0@400 io@0x814), C1(0@1 mwait), PSS
> acpicpu6 at acpi0: C2(0@400 io@0x814), C1(0@1 mwait), PSS
> acpicpu7 at acpi0: C2(0@400 io@0x814), C1(0@1 mwait), PSS
> acpipwrres0 at acpi0: P0SA
> acpipwrres1 at acpi0: P3SA
> acpipwrres2 at acpi0: P0SA
> acpipwrres3 at acpi0: P3SA
> acpipwrres4 at acpi0: P0SA
> acpipwrres5 at acpi0: P3SA
> acpipwrres6 at acpi0: P0SA
> acpipwrres7 at acpi0: P3SA
> acpipwrres8 at acpi0: P0SA
> acpipwrres9 at acpi0: P3SA
> acpipwrres10 at acpi0: P0SA
> acpipwrres11 at acpi0: P3SA
> acpipwrres12 at acpi0: P0SA
> acpipwrres13 at acpi0: P3SA
> acpipwrres14 at acpi0: P0SA
> acpipwrres15 at acpi0: P3SA
> ipmi at mainbus0 not configured
> cpu0: 2700 MHz: speeds: 2700 1900 1200 MHz
> pci0 at mainbus0 bus 0
> ksmn0 at pci0 dev 0 function 0 "AMD 17h Root Complex" rev 0x00
> pchb0 at pci0 dev 1 function 0 "AMD 17h PCIE" rev 0x00
> ppb0 at pci0 dev 1 function 3 "AMD 17h PCIE" rev 0x00: msi
> pci1 at ppb0 bus 1
> ppb1 at pci1 dev 0 function 0 "ASPEED Technology AST1150 PCI" rev 0x04
> pci2 at ppb1 bus 2
> vga1 at pci2 dev 0 function 0 "ASPEED Technology AST2000" rev 0x41
> wsdisplay at vga1 not configured
> ppb2 at pci0 dev 1 function 5 "AMD 17h PCIE" rev 0x00: msi
> pci3 at ppb2 bus 3
> em0 at pci3 dev 0 function 0 "Intel I350" rev 0x01: msi, address 3c:ec:ef:7a:d3:4c
> em1 at pci3 dev 0 function 1 "Intel I350" rev 0x01: msi, address 3c:ec:ef:7a:d3:4d
> em2 at pci3 dev 0 function 2 "Intel I350" rev 0x01: msi, address 3c:ec:ef:7a:d3:4e
> em3 at pci3 dev 0 function 3 "Intel I350" rev 0x01: msi, address 3c:ec:ef:7a:d3:4f
> pchb1 at pci0 dev 2 function 0 "AMD 17h PCIE" rev 0x00
> pchb2 at pci0 dev 3 function 0 "AMD 17h PCIE" rev 0x00
> pchb3 at pci0 dev 4 function 0 "AMD 17h PCIE" rev 0x00
> pchb4 at pci0 dev 7 function 0 "AMD 17h PCIE" rev 0x00
> ppb3 at pci0 dev 7 function 1 "AMD 17h PCIE" rev 0x00
> pci4 at ppb3 bus 5
> vendor "AMD", unknown product 0x145a (class instrumentation unknown subclass 0x00, rev 0x00) at pci4 dev 0 function 0 not configured
> ccp0 at pci4 dev 0 function 2 "AMD 17h Crypto" rev 0x00: msix: RNG
> xhci0 at pci4 dev 0 function 3 "AMD 17h xHCI" rev 0x00: msix, xHCI 1.0
> usb0 at xhci0: USB revision 3.0
> uhub0 at usb0 configuration 1 interface 0 "AMD xHCI root hub" rev 3.00/1.00 addr 1
> pchb5 at pci0 dev 8 function 0 "AMD 17h PCIE" rev 0x00
> ppb4 at pci0 dev 8 function 1 "AMD 17h PCIE" rev 0x00
> pci5 at ppb4 bus 6
> vendor "AMD", unknown product 0x1455 (class instrumentation unknown subclass 0x00, rev 0x00) at pci5 dev 0 function 0 not configured
> ccp1 at pci5 dev 0 function 1 "AMD 17h Crypto" rev 0x00: msix: RNG
> ahci0 at pci5 dev 0 function 2 "AMD FCH AHCI" rev 0x51: msi, AHCI 1.3.1
> ahci0: port 0: 6.0Gb/s
> ahci0: port 2: 1.5Gb/s
> scsibus1 at ahci0: 32 targets
> sd0 at scsibus1 targ 0 lun 0: <ATA, WDC WDS250G2B0A, 4010> naa.5001b448bab0d42d
> sd0: 238475MB, 512 bytes/sector, 488397168 sectors, thin
> cd0 at scsibus1 targ 2 lun 0: <TEAC, DV-W28SS-B, 1.6A> removable
> piixpm0 at pci0 dev 20 function 0 "AMD FCH SMBus" rev 0x59: SMI
> iic6 at piixpm0
> iic7 at piixpm0
> pcib0 at pci0 dev 20 function 3 "AMD FCH LPC" rev 0x51
> pchb6 at pci0 dev 24 function 0 "AMD 17h Data Fabric" rev 0x00
> pchb7 at pci0 dev 24 function 1 "AMD 17h Data Fabric" rev 0x00
> pchb8 at pci0 dev 24 function 2 "AMD 17h Data Fabric" rev 0x00
> pchb9 at pci0 dev 24 function 3 "AMD 17h Data Fabric" rev 0x00
> pchb10 at pci0 dev 24 function 4 "AMD 17h Data Fabric" rev 0x00
> pchb11 at pci0 dev 24 function 5 "AMD 17h Data Fabric" rev 0x00
> pchb12 at pci0 dev 24 function 6 "AMD 17h Data Fabric" rev 0x00
> pchb13 at pci0 dev 24 function 7 "AMD 17h Data Fabric" rev 0x00
> isa0 at pcib0
> isadma0 at isa0
> pcppi0 at isa0 port 0x61
> spkr0 at pcppi0
> vmm0 at mainbus0: SVM/RVI
> uhub1 at uhub0 port 1 configuration 1 interface 0 "Genesys Logic USB2.0 Hub" rev 2.00/32.98 addr 2
> ugen0 at uhub1 port 3 "Identiv uTrust 2700 R Smart Card Reader" rev 2.00/2.02 addr 3
> uftdi0 at uhub1 port 4 configuration 1 interface 0 "FTDI FT232R USB UART" rev 2.00/6.00 addr 4
> ucom0 at uftdi0 portno 1: usb0.1.00004.0
> uhub2 at uhub0 port 2 configuration 1 interface 0 "Genesys Logic USB2.0 Hub" rev 2.00/32.98 addr 5
> uhub3 at uhub2 port 3 configuration 1 interface 0 "ATEN International product 0x7000" rev 2.00/0.00 addr 6
> uhub3: port 2 power on failed, TIMEOUT
> uhidev0 at uhub3 port 1 configuration 1 interface 0 "ATEN International product 0x2419" rev 1.10/1.00 addr 7
> uhidev0: iclass 3/1
> ukbd0 at uhidev0: 8 variable keys, 6 key codes
> wskbd0 at ukbd0 mux 1
> uhidev1 at uhub3 port 1 configuration 1 interface 1 "ATEN International product 0x2419" rev 1.10/1.00 addr 7
> uhidev1: iclass 3/1
> ums0 at uhidev1: 3 buttons, Z dir
> wsmouse0 at ums0 mux 0
> uhidev2 at uhub0 port 3 configuration 1 interface 0 "GASIA PS2toUSB Adapter" rev 1.10/2.01 addr 8
> uhidev2: iclass 3/1
> ukbd1 at uhidev2: 8 variable keys, 6 key codes
> wskbd1 at ukbd1 mux 1
> uhidev3 at uhub0 port 3 configuration 1 interface 1 "GASIA PS2toUSB Adapter" rev 1.10/2.01 addr 8
> uhidev3: iclass 3/1, 3 report ids
> ums1 at uhidev3 reportid 1: 5 buttons, Z dir
> wsmouse1 at ums1 mux 0
> uhid0 at uhidev3 reportid 2: input=1, output=0, feature=0
> ucc0 at uhidev3 reportid 3: 573 usages, 20 keys, array
> wskbd2 at ucc0 mux 1
> vscsi0 at root
> scsibus2 at vscsi0: 256 targets
> softraid0 at root
> scsibus3 at softraid0: 256 targets
> root on sd0a (c0227a64aecf2156.a) swap on sd0b dump on sd0b