(no commit message)
[libreriscv.git] / conferences / siliconsalon2022.mdwn
1 # Silicon Salon 2022
2
3 Wed, June 1, 2022 5:00 PM – 8:00 PM BST
4
5 * <https://www.blockchaincommons.com/salons/silicon-salon/>
6 * <https://ftp.libre-soc.org/siliconsalon2022.pdf>
7 * <https://git.libre-soc.org/?p=nmutil.git;a=blob;f=src/nmutil/grev.py;hb=HEAD>
8 * <https://libre-soc.org/openpower/isa/bitmanip/>
9 * <https://libre-soc.org/openpower/sv/bitmanip/>
10 * <https://libre-soc.org/openpower/sv/biginteger/analysis/>
11
12 # Talk
13
14 (with thanks to Bryan Bishop for the transcript)
15
16 * video: <https://www.youtube.com/watch?v=us061o4PBZs>
17 * slides: <https://ftp.libre-soc.org/siliconsalon2022.pdf>
18
19 * The Libre-SOC Hybrid CPU-VPU-GPU
20 * and why Libre/Open is crucial (even in a business context)
21 * Practical gotchas for Silicon Transparency
22 * Sponsored by NLnet's PET Programme
23 * 2022-05-24
24
25 ## Introduction
26
27 This is a quick presentation on the Libre-SOC project and some practical
28 gotchas for silicon transparency. Many thanks to Bryan for inviting me
29 to do this presentation.
30
31 ## What is the Libre-SOC project
32
33 So what is the Libre-SOC project?
34
35 * An entirely libre vector-enhanced Power ISA cmpliant CPU with enough
36 legs to tackle supercomputing-class workloads.
37 <https://libre-soc.org/openpower/sv/>
38 * Working closely with the OpenPOWER Foundation: no rogue custom
39 instructions. Both long-term stability and open-ness is key.
40 <https://openpowerfoundation.org/groups/isa/>
41 * Huge reliance on Python OO and software engineering as applied to
42 HDL. Not just traditional verification: unit tests at every level,
43 formal correctness proofs as unit tests. "python3 setup.py test" to run
44 the tests.
45 <https://gitlab.com/nmigen/nmigen>
46 <https://uspto.report/TM/88980893>
47 * Using libre VLSI tools: coriolis2 (by Sorbonne University), ultimate
48 goal is to have the GDS-II Files publicly reproducible
49 <http://coriolis.lip6.fr/>
50
51 We're developing an entirely libre licensed vector-enhanced Power
52 ISA compliant CPU. Basically with enough legs to tackle supercomputing
53 workloads. What that means in turn is that we're developing pre-stylized
54 vectors ontop of the Power ISA and we're in the process of writing that
55 up to present to the OpenPOWER Foundation ISA working group. There will
56 be no rogue custom instructions in our project at all, everything will
57 get reviewed and be submitted alongside a compliance suite documentation,
58 etc. etc.
59
60 <https://libre-soc.org/openpower/sv/svp64/>
61
62 The history of the Power ISA is that it's 25 years old. It pre-dates
63 the RISC-V instruction set by a long way. As does interestingly their
64 intention to open up the ISA, which was initiated about 10 years ago
65 and one of the key important things there was that IBM wanted to ensure
66 that its allocated its patent pool protection correctly to the OpenPOWER
67 Foundation to be able to protect members.
68
69 I just wanted to get across that the long-term stability and open-ness
70 is very important to IBM and to the OpenPOWER Foundation members.
71
72 We rely hugely on python object-oriented program. We use mgimen which
73 is a trademark HDL that is open-source. We can use the power of python
74 object-orientation to create VLSI and HDL. Verilog is an output from
75 nmigen, right.
76
77 We don't just use traditional verification and development; we have
78 unit tests at every single level, because we are trained as software
79 engineers. Most hardware engineers have never heard of git, their method
80 for doing backups is multiple zip files. We also use formal correctness
81 proofs and formal verification as unit tests within our test suite,
82 down to the lowest level. Each module you just do "python setup.py test"
83 and wait for it to complete once you run that command.
84
85 <https://symbiyosys.readthedocs.io/en/latest/>
86
87 We are also working closely with Sorbonne University because we want to
88 ensure that there is full transparency right down to the silicon. Our
89 ultimate goal is to have the GDS-II files be publicly reproducible and
90 for people to be able to etch away the actual silicon, take photographs,
91 and verify that the actual silicon produced was genuinely what was in
92 the GDS-II files, but not for someone to do that under NDA but for it
93 to be done by an independent third-party who can be trusted. Or even
94 multiple independent trusted third-parties, more to the point.
95
96 ## What challenges does a crypto-wallet ASIC face?
97
98 * Industry-endemic paranoid 5-level-deep NDA chain. Foundry NDAs
99 themselves are under NDA. Sharing between teams inside the same company is
100 prohibited! Cell libraries: NDA'd. PDKs: NDA'd. HDL designs: NDA'd. ((Also
101 SE interfaces are, you guessed it, most commonly NDA'd.))
102 * Power-analysis attacks. Timing attacks. EMF attacks. Standards
103 verification (FIPS ain't it). Toolchain attacks. Cacheing is out:
104 performance will suck.
105 * Achieving full transparency - a critical goal - is almost impossible
106 to achieve. Ultimately, you need to buy (or build) your own Foundry.
107 * Production and development costs (NREs) almost certainly dwarf the
108 sales costs.
109
110 Right. The challenges that a crypto-wallet ASIC faces is first and
111 foremost that there is a massive industry-wide paranoid 5 layer deep NDA
112 chain. Even the foundry NDAs which give you access to the PDKs (platform
113 development kits) and the cell libraries from the foundry, are, the NDAs
114 themselves are under NDA. It's insane. You can have two teams in the
115 same company working at the same time, using the same foundry, using the
116 same geometry, and they are prohibited contractually from talking with
117 each other. It's mentally ill. Your cell libraries are NDA's. The PDK's
118 are NDA'd. Third-party HDL: NDA'd. Firmware, too, NDA'd. The firmware
119 might reveal too much information about the HDL that it is supposed to
120 be associated with, so it's NDA'd. It's completely insane.
121
122 Unfortunately, any point in this NDA chain could be an attack vector. It's
123 been demonstrated that it only takes about 3,000 gates to implement
124 a processor which can if put into the memory bus can compromise the
125 entire design. Intel Management Engine was detected and deliberately
126 marketed as a management negine, but the thing is, you can activate
127 those and program those hidden CPUs, via power fluctuations or by EMF
128 so you can broadcast on a high-frequency using I think even Morse code
129 or other techniques at a rogue onboard processor, to get it to activate
130 and program it. It's mad. The level of attacks that you have to mitigate
131 against is just enormous.
132
133 Power analysis attacks, I remember going to a conference at ITT Madras a
134 few years ago where they showed just the existence of the floating point
135 unit was enough to compromise 95% of the secret key for Rhondial, even
136 though there were no actual floating point instructions being executed. It
137 turned out that it was just that the decode engine had a link to the
138 floating point unit. That was enough to detect what instructions on the
139 integer side were being used.
140
141 <https://www.youtube.com/watch?v=bmsvWvus3mc>
142
143 You have timing attacks too. An EMF burst can actually be used to change
144 bits inside the ASIC, including registers that have been switched off
145 which you would normally expect to prevent writes to certain other areas
146 of the ASIC.
147
148 <https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-811.pdf>
149
150 You then have problems with standards, if there is even a standard at
151 all, it might be written incorrectly, or you might have conformance test
152 suites for FIPS approval- if those are not written correctly.... you
153 also have toolchain attacks, and also cacheing attacks.
154
155 Achieving full transparency while critical is almost impossible to
156 achieve. Ultimately you need to buy or build your own foundry which is
157 the only way to guarantee there are no sidechannel attacks in the foundry.
158
159 The other issue that being a small market, your producion and development
160 costs or NREs are almost certainly going to dwarf any sales in the
161 hardware wallet market.
162
163 How can we mitigate some of these issues?
164
165 ## Pragmatic solutions
166
167 * Use formal correctness proofs at every step. Caveat: proofs are only
168 as good as the mathematicians that write them!
169 * Work with standards bodies (e.g. OpenPOWER Foundation ISA WG) and their
170 membres with similar interests. Custom Extension with zero public review
171 == bad.
172 * Unstable PLLs to detect rogue EMF
173 * Develop a product that has a larger total market (a SoC
174 (system-on-a-chip))
175 * Accept that removing some levels of NDAs will be "out of reach" for now.
176 * Use E-Fabless "ChipIgnite" to at least get the NREs down.
177 * Ultimately: buy your own foundry, make the PDK and cell library
178 public. Only use Libre VLSI tools (limits to around 130 nm at the
179 moment). Everything is "early days" in this space.
180
181 Firstly, use formal correctness proofs at every step. The caveat here
182 is that if the mathematician makes some assumptions particularly if
183 the mathematician is the same person who wrote the HDL, then they end
184 up proving their incorrect HDL is correct. They 100% guarantee that the
185 proof matches the HDL, but the HDL or the technique may be wrong. So one
186 mitigation solution here is to have separate people write the proof,
187 and for the proof to be verified against other people's designs that
188 are independently developed. You need collaboration here, not competition.
189
190 Working with standards bodies is extremely important. The OpenPOWER
191 Foundation has an external RFC process. We do not have to be a secret
192 member and develop everything in private or secret in order to submit
193 extensions to the OpenPOWER Foundation. Whereas with RISC-V, you are
194 forced to join and sign the commercial confidentiality clauses where
195 the entire process from that point on is no different from the ITU. The
196 other aspect is that if you develop a custom extension, then it gets
197 zero public review, and clearly this is bad.
198
199 Another thing is for detection of rogue programs and rogue EMF bursts,
200 there is a technique of using an unstable PLL where you can detect the
201 phase changes and you deliberately route the PLLs throughout the entire
202 ASIC and you monitor the phase changes. If the phase signature over time
203 is not what you would expect when running a specific program, then you
204 can detect that activity. You can detect firstly external EMF bursts,
205 you can detect when people are trying to wiggle the power supply, and
206 you can detect if a rogue program is being run at a particular time, in
207 real-time. The only problem that you have to watch out for is to make sure
208 the PLL the signatures themselves are not used as an attack vector to leak
209 information. You have to secure the actual signature mechanism itself.
210
211 To solve the market size problem, just develop a product that has a larger
212 total market size that solves other problems. Or, you can develop this
213 as part of another product, I think. It can be a sides-sales channel
214 rather than an isolated product, for example.
215
216 At a practical level, we might have to accept that some NDAs can't be
217 removed but we should go as far as we can.
218
219 I think ChipIgnite I think they charge about $8,000 and you can get maybe
220 300 ASICs out of that and you can do the math on that that you can sell a
221 thing at. E-fabless have done many of the things for which a foundry or
222 NPW would normally charge $50,000 they have got it down to an automated
223 process and they knock it off the cost that they charge you. Normally
224 it would be $50,000 for running a tool that would be a manual process,
225 but e-fabless has completely automated that.
226
227 <https://platform.efabless.com/chipignite/>
228 <https://fosdem.org/2022/schedule/event/efabless/>
229
230 Ultimately, you need to buy your own foundry, make the PDK and Cell
231 Library public. Skywater PDK 130nm is now publicly available which is a
232 start. Some cell libraries are publicly available, but not every foundry
233 is following suite yet. They are interested, but not moving yet.
234
235 <https://skywater-pdk.readthedocs.io/en/main/>
236
237 Another thing is that you could only use libre VLSI tools because you
238 want people to be able to independently verify your GDS-II files, then
239 you can't rely on a proprietary toolchain. At the moment you would be
240 limited to about 130 nm, which you can use to achieve 700 Mhz which is
241 not that bad.
242
243 Bottom line is that everything is early days in this space.
244
245 ## Find us online
246
247 <http://libre-soc.org/>
248
249 libera.chat IRC: #libre-soc
250
251 mailing lists: <http://list.libre-soc.org/>
252
253 <http://nlnet.nl/PET>
254
255 <https://libre-soc.org/nlnet/#faq>