clarify
[libreriscv.git] / isa_conflict_resolution.mdwn
1 # Resolving ISA conflicts and providing a pain-free RISC-V Standards Upgrade Path
2
3 ## Executive Summary
4
5 A non-invasive backwards-compatible change to make
6 mvendorid and marchid being read-only to be a formal declaration of an
7 architecture having no Custom Extensions, and being permitted to be
8 WARL in order to support multiple simultaneous architectures on the
9 same processor (or hart) permits not only backwards and forwards
10 compatibility with existing implementations of the RISC-V Standard,
11 not only permits seamless transitions to future versions of the
12 RISC-V Standard (something that is not possible at the moment), but
13 permanently fixes the problem of clashes in Custom Extension opcodes
14 on a global basis.
15
16 ## Introduction
17
18 In a lengthy thread that ironically was full of conflict indicative
19 of the future direction in which RISC-V will go if left unresolved,
20 multiple Custom Extensions were noted to be permitted free rein to
21 introduce global binary-encoding conflict with no means of resolution
22 described or endorsed by the RISC-V Standard: a practice that has known
23 disastrous and irreversible consequences for any architecture that
24 permits such practices (1).
25
26 Much later on in the discussion it was realised that there is also no way
27 within the current RISC-V Specification to transition to improved versions
28 of the standard, regardless of whether the fixes are absolutely critical
29 show-stoppers or whether they are just keeping the standard up-to-date (2).
30
31 With no transition path there is guaranteed to be tension and conflict
32 within the RISC-V Community over whether revisions should be made:
33 should existing legacy designs be prioritised, mutually-exclusively over
34 future designs (and what happens during the transition period is absolute
35 chaos, with the compiler toolchain, software ecosystem and ultimately
36 the end-users bearing the full brunt of the impact). If several
37 overlapping revisions are required that have not yet transitioned out
38 of use (which could take well over two decades to occur) the situation
39 becomes disastrous for the credibility of the entire RISC-V ecosystem.
40
41 It was also pointed out that Compliance is an extremely important factor
42 to take into consideration, and that Custom Extensions (as being optional)
43 effectively and quite reasonably fall entirely outside of the scope of
44 Compliance Testing. At this point in the discussion however it was not
45 yet noted the stark problem that the *mandatory* RISC-V Specification
46 also faces, by virtue of there being no transitional way to bring in
47 show-stopping critical alterations.
48
49 To put this into perspective, just taking into account hardware costs
50 alone: with production mask charges for 28nm being around USD $1.5m,
51 engineering development costs and licensing of RTLs for peripherals
52 being of a similar magnitude, no manufacturer is going to back away
53 from selling a "flawed" or "legacy" product (whether it complies with
54 the RISC-V Specification or not) without a bitter fight.
55
56 It was also pointed out that there will be significant software tool
57 maintenance costs for manufacturers, meaning that the probability will
58 be extremely high that they will refuse to shoulder such costs, and
59 will publish and continue to publish (and use) hopelessly out-of-date
60 unpatched tools. This practice is well-known to result in security
61 flaws going unpatched, with one of many immediate undesirable consequences
62 being that product in extremely large volume gets discarded into landfill.
63
64 **All and any of the issues that were discussed, and all of those that
65 were not, can be avoided by providing a hardware-level runtime-enabled
66 forwards and backwards compatible transition path between *all* parts
67 (mandatory or not) of current and future revisions of the RISC-V ISA
68 Standard.**
69
70 The rest of the discussion - indicative as it was of the stark mutually
71 exclusive gap being faced by the RISC-V ISA Standard given that it does
72 not cope with the problem - was an effort by two groups in two clear
73 camps: one that wanted things to remain as they are, and another that
74 made efforts to point out that the consequences of not taking action
75 are clearly extreme and irreversible (which, unfortunately, given the
76 severity, some of the first group were unable to believe, despite there
77 being clear historical precedent for the exact same mistake being made in
78 other architectures, and the consequences on the same being absolutely
79 clear).
80
81 However after a significant amount of time, certain clear requirements came
82 out of the discussion:
83
84 * Any proposal must be a minimal change with minimal (or zero) impact
85 * Any proposal should place no restriction on existing or future
86 ISA encoding space
87 * Any proposal should take into account that there are existing implementors
88 of the (yet to be finalised but still "partly frozen") Standard who may
89 resist, for financial investment reasons, efforts to make any change
90 (at all) that could cost them immediate short-term profits.
91
92 Several proposals were put forward (and some are still under discussion)
93
94 * "Do nothing": problem is not severe: no action needed.
95 * "Do nothing": problem is out-of-scope for RISC-V Foundation.
96 * "Do nothing": problem complicates Compliance Testing (and is out of scope)
97 * "MISA": the MISA CSR enables and disables extensions already: use that
98 * "MISA-like": a new CSR which switches in and out new encodings
99 (without destroying state)
100 * "mvendorid/marchid WARL": switching the entire "identity" of a machine
101 * "ioctl-like": a OO proposal based around the linux kernel "ioctl" system.
102
103 Each of these will be discussed below in their own sections.
104
105 # Do nothing (no problem exists)
106
107 (Summary: not an option)
108
109 There were several solutions offered that fell into this category.
110 A few of them are listed in the introduction; more are listed below,
111 and it was exhaustively (and exhaustingly) established that none of
112 them are workable.
113
114 Initially it was pointed out that Fabless Semiconductor companies could
115 simply license multiple Custom Extensions and a suitable RISC-V core, and
116 modify them accordingly. The Fabless Semi Company would be responsible
117 for paying the NREs on re-developing the test vectors (as the extension
118 licensers would be extremely unlikely to do that without payment), and
119 given that said Companies have an "integration" job to do, it would
120 be reasonable to expect them to have such additional costs as well.
121
122 The costs of this approach were outlined and discussed as being
123 disproportionate and extreme compared to the actual likely cost of
124 licensing the Custom Extensions in the first place. Additionally it
125 was pointed out that not only hardware NREs would be involved but
126 custom software tools (compilers and more) would also be required
127 (and maintained separately, on the basis that upstream would not
128 accept them except under extreme pressure, and then only with
129 prejudice).
130
131 All similar schemes involving customisation of the custom extensions
132 were likewise rejected, but not before the customisation process was
133 mistakenly conflated with tne *normal* integration process of developing
134 a custom processor (Bus Architectures, Cache layouts, peripheral layouts).
135
136 The most compelling hardware-related reason (excluding the severe impact on
137 the software ecosystem) for rejecting the customisation-of-customisation
138 approach was the case where Extensions were using an instruction encoding
139 space (48-bit, 64-bit) *greater* than that which the chosen core could
140 cope with (32-bit, 48-bit).
141
142 Overall, none of the options presented were feasible, and, in addition,
143 with no clear leadership from the RISC-V Foundation on how to avoid
144 global world-wide encoding conflict, even if they were followed through,
145 still would result in the failure of the RISC-V ecosystem due to
146 irreversible global conflicting ISA binary-encoding meanings (POWERPC's
147 Altivec / SPE nightmare).
148
149 This in addition to the case where the RISC-V Foundation wishes to
150 fix a critical show-stopping update to the Standard, post-release,
151 where billions of dollars have been spent on deploying RISC-V in the
152 field.
153
154 # Do nothing (out of scope)
155
156 (Summary: may not be RV Foundation's "scope", still results in
157 problem, so not an option)
158
159 This was one of the first arguments presented: The RISC-V Foundation
160 considers Custom Extensions to be "out of scope"; that "it's not their
161 problem, therefore there isn't a problem".
162
163 The logical errors in this argument were quickly enumerated: namely that
164 the RISC-V Foundation is not in control of the uses to which RISC-V is
165 put, such that public global conflicts in binary-encoding are a hundred
166 percent guaranteed to occur (*outside* of the control and remit of the
167 RISC-V Foundation), and a hundred percent guaranteed to occur in
168 *commodity* hardware where Debian, Fedora, SUSE and other distros will
169 be hardest hit by the resultant chaos, and that will just be the more
170 "visible" aspect of the underlying problem.
171
172 # Do nothing (Compliance too complex, therefore out of scope)
173
174 (Summary: may not be RV Foundation's "scope", still results in
175 problem, so not an option)
176
177 The summary here was that Compliance testing of Custom Extensions is
178 not just out-of-scope, but even if it was taken into account that
179 binary-encoding meanings could change, it would still be out-of-scope.
180
181 However at the time that this argument was made, it had not yet been
182 appreciated fully the impact that revisions to the Standard would have,
183 when billions of dollars worth of (older, legacy) RISC-V hardware had
184 already been deployed.
185
186 Two interestingly diametrically-opposed equally valid arguments exist here:
187
188 * Whilst Compliance testing of Custom Extensions is definitely legitimately
189 out of scope, Compliance testing of simultaneous legacy (old revisions of
190 ISA Standards) and current (new revisions of ISA Standard) definitely
191 is not. Efforts to reduce *Compliance Testing* complexity is therefore
192 "Compliance Tail Wagging Standard Dog".
193 * Beyond a certain threshold, complexity of Compliance Testing is so
194 burdensome that it risks outright rejection of the entire Standard.
195
196 Meeting these two diametrically-opposed perspectives requires that the
197 solution be very, very simple.
198
199 # MISA
200
201 (Summary: MISA not suitable, leads to better idea)
202
203 MISA permits extensions to be disabled by masking out the relevant bit.
204 Hypothetically it could be used to disable one extension, then enable
205 another that happens to use the same binary encoding.
206
207 *However*:
208
209 * MISA Extension disabling is permitted (optionally) to **destroy**
210 the state information. Thus it is totally unsuitable for cases
211 where instructions from different Custom extensions are needed in
212 quick succession.
213 * MISA was only designed to cover Standard Extensions.
214 * There is nothing to prevent multiple Extensions being enabled
215 that wish to simultaneously interpret the same binary encoding.
216 * There is nothing in the MISA specification which permits
217 *future* versions (bug-fixes) of the RISC-V ISA to be "switched in".
218
219 Overall, whilst the MISA concept is a step in the right direction it's
220 a hundred percent unsuitable for solving the problem.
221
222 # MISA-like
223
224 (Summary: basically same as mvend/march WARL except needs an extra CSR where
225 mv/ma doesn't. Along right lines, doesn't meet full requirements)
226
227 Out of the MISA discussion came a "MISA-like" proposal, which would
228 take into account the flaws pointed out by trying to use "MISA":
229
230 * The MISA-like CSR's meaning would be identified by compilers using the
231 mvendor-id/march-id tuple as a compiler target
232 * Each custom-defined bit of the MISA-like CSR would (mutually-exclusively)
233 redirect binary encoding(s) to specific encodings
234 * No Extension would *actually* be disabled: its internal state would
235 be left on (permanently) so that switching of ISA decoding
236 could be done inside inner loops without adverse impact on
237 performance.
238
239 Whilst it was the first "workable" solution it was also noted that the
240 scheme is invasive: it requires an entirely new CSR to be added
241 to the privileged spec (thus making existing implementations redundant).
242 This does not fulfil the "minimum impact" requirement.
243
244 Also interesting around the same time an additional discussion was
245 raised that covered the *compiler* side of the same equation. This
246 revolved around using mvendorid-marchid tuples at the compiler level,
247 to be put into assembly output (by gcc), preserving the required
248 *globally* unique identifying information for binutils to successfully
249 turn the custom instruction into an actual binary-encoding (plus
250 binary-encoding of the context-switching information). (**TBD, Jacob,
251 separate page? review this para?**)
252
253 # mvendorid/marchid WARL
254
255 (Summary: the only idea that meets the full requirements. Needs
256 toolchain backup, but only when the first chip is released)
257
258 Coming out of the software-related proposal by Jacob Bachmeyer, which
259 hinged on the idea of a globally-maintained gcc / binutils database
260 that kept and coordinated architectural encodings (curated by the Free
261 Software Foundation), was to quite simply make the mvendorid and marchid
262 CSRs have WARL (writeable) characteristics. For instances where mvendorid
263 and marchid are readable, that would be taken to be a Standards-mandatory
264 "declaration" that the architecture has *no* Custom Extensions (and that
265 it conforms precisely to one and only one specific variant of the
266 RISC-V Specification).
267
268 This incredibly simple non-invasive idea has some unique and distinct
269 advantages over other proposals:
270
271 * Existing designs - even though the specification is not finalised
272 (but has "frozen" aspects) - would be completely unaffected: the
273 change is to the "wording" of the specification to "retrospectively"
274 fit reality.
275 * Unlike with the MISA idea this is *purely* at the "decode" phase:
276 no internal Extension state information is permitted to be disabled,
277 altered or destroyed as a direct result of writing to the
278 mvendor/march-id CSRs.
279 * Compliance Testing may be carried out with a different vendorid/marchid
280 tuple set prior to a test, allowing a vendor to claim *Certified*
281 compatibility with *both* one (or more) legacy variants of the RISC-V
282 Specification *and* with a present one.
283 * With sufficient care taken in the implementation an implementor
284 may have multiple interpretations of the same binary encoding within
285 an inner loop, with a single instruction (to the WARL register)
286 changing the meaning.
287
288 A couple of points were made:
289
290 * Compliance Testing may **fail** any system that has mvendorid/marchid
291 as WARL. This however is a clear case of "Compliance Tail Wagging Standard
292 Dog".
293 * The redirection of meaning of certain binary encodings to multiple
294 engines was considered extreme, eyebrow-raising, and also (importantly)
295 potentially expensive, introducing significant latency at the decode
296 phase.
297
298 On this latter point, it was observed that MISA already switches out entire
299 sets of instructions (interacts at the "decode" phase). The difference
300 between what MISA does and the mvendor/march-id WARL idea is that whilst
301 MISA only switches instruction decoding on (or off), the WARL idea
302 *redirects* encoding, to *different* engines, fortunately in a deliberately
303 mutually-exclusive fashion.
304
305 Implementations would therefore, in each Extension (assuming one separate
306 "decode" engine per Extension), simply have an extra (mutually-exclusively
307 enabled) wire in the AND gate for any given binary encoding, and in this
308 way there would actually be very little impact on the latency. The assumption
309 here is that there are not dozens of Extensions vying for the same binary
310 encoding (at which point the Fabless Semi Company has other much more
311 pressing issues to deal with that make resolving encoding conflicts trivial
312 by comparison).
313
314 Also pointed out was that in certain cases pipeline stalls could be introduced
315 during the switching phase, if needed, just as they may be needed for
316 correct implementation of (mandatory) support for MISA.
317
318 **This is the only one of the proposals that meet the full requirements**
319
320 # ioctl-like
321
322 (Summary: good solid orthogonal idea. See [[ioctl]] for full details)
323
324 ==RB===
325
326 This proposal adds a standardised extension interface to the RV instruction set by introducing a fixed small number (e.g. 8) of "overloadable" R-type opcodes ext_ctl0, .. ext_ctl7. Each takes a process local interface cookie in rs1. Based on the cookie, the CPU routes the "overloaded" instructions to a "device" on or off the CPU that implements the actual semantics.
327
328 The cookie is "opened" with an additional r-type instruction ext_open that takes a 20 bit identifier and "closed" with an ext_close instruction. The implementing hardware device can use the cookie to reference internal state. Thus, interfaces may be statefull.
329
330 CPU's and devices may implement several interfaces, indeed, are expected to. E.g. a single hardware device might expose a functional interface with 6 overloaded instructions, expose configuration with two highly device specific management interfaces with 8 resp. 4 overloaded instructions, and respond to a standardised save state interface with 4 overloaded instructions.
331
332 Having a standardised overloadable interface simply avoids much of the need for isa extensions for hardware with non standard interfaces and semantics. This is analogous to the way that the standardised overloadable ioctl interface of the kernel almost completely avoids the need for extending the kernel with syscalls for the myriad of hardware devices with their specific interfaces and semantics.
333
334 Since the rs1 input of the overloaded ext_ctl instruction's are taken by the interface cookie, they are restricted in use compared to a normal R-type instruction (it is possible to pass 12 bits of additional info by or ing it with the cookie). Delegation is also expected to come at a small additional performance price compared to a "native" instruction. This should be an acceptable tradeoff in most cases.
335
336 The expanded flexibility comes at the cost: the standard can specify the semantics of the delegation mechanism and the interfacing with the rest of the cpu, but the actual semantics of the overloaded instructions can only be defined by the designer of the interface. Likewise, a device can be conforming as far as delegation and interaction with the CPU is concerned, but whether the hardware is conforming to the semantics of the interface is outside the scope of spec. Being able to specify that semantics using the methods used for RV itself is clearly very valuable. One impetus for doing that is using it for purposes of its own, effectively freeing opcode space for other purposes. Also, some interfaces may become de facto or de jure standards themselves, necessitating hardware to implement competing interfaces. I.e., facilitating a free for all, may lead to standards proliferation. C'est la vie.
337
338 The only "ISA-collisions" that can still occur are in the 20 bit (~10^6) interface identifier space, with 12 more bits to identify a device on a hart that implements the interface. One suggestion is setting aside 2^19 id's that are handed out for a small fee by a central (automated) registration (making sure the space is not just claimed), while the remaining 2^19 are used as a good hash on a long, plausibly globally unique human readable interface name. This gives implementors the choice between a guaranteed private identifier paying a fee, or relying on low probabilities. The interface identifier could also easily be extended to 42 bits on RV64.
339
340
341 ====End RB==
342
343 This proposal basically mirrors the concept of POSIX ioctls, providing
344 (arbitrarily) 8 functions (opcodes) whose meaning may be over-ridden
345 in an object-orientated fashion by calling an "open handle" (and close)
346 function (instruction) that switches (redirects) the 8 functions over to
347 different opcodes.
348
349
350 The "open handle" opcode takes a GUID (globally-unique identifier)
351 and an ioctl number, and stores the UUID in a table indexed by the
352 ioctl number:
353
354 handle_global_state[8] # stores UUID or index of same
355
356 def open_handle(uuid, ioctl_num):
357 handle_global_state[ioctl_num] = uuid
358
359 def close_handle(ioctl_num):
360 handle_global_state[ioctl_num] = -1 # clear table entry
361
362
363 "Ioctls" (arbitrarily 8 separate R-type opcodes) then perform a redirect
364 based on what the global state for that numbered "ioctl" has been set to:
365
366 def ioctl_fn0(*rargs): # star means "take all arguments as a tuple"
367 if handle_global_state[0] == CUSTOMEXT1UUID:
368 CUSTOMEXT1_FN0(*rargs) # apply all arguments to function
369 elif handle_global_state[0] == CUSTOMEXT2UUID:
370 CUSTOMEXT2_FN0(*rargs) # apply all arguments to function
371 else:
372 raise Exception("undefined opcode")
373
374 === RB ==
375
376 not quite I think. It is more like
377
378 // Hardware, implementing interface with UUID 0xABCD
379
380 def A_shutdown(cookie, data):
381 ...
382
383 def A_init(data)
384
385 def A_do_stuff(cookie, data):
386 ...
387
388 def A_do_more_stuff(cookie, data):
389 ...
390
391 interfaceA = {
392 "shutdown": A_shutdown,
393 "init": A_init,
394 "ctl0": A_do_stuff,
395 "ctl1": A_do_more_stuff
396 }
397
398 // hardware implementing interface with UUID = 0x1234
399
400 def B_do_things(cookie, data):
401 ...
402 def B_shutdown(cookie, data)
403 ...
404
405 interfaceB = {
406 "shutdown": B_shutdown,
407 "ctl0": B_do_things
408 }
409
410
411 // The CPU being wired to the devices
412
413 cpu_interfaces = {
414 0xABCD: interfaceA,
415 0x1234: interfaceB
416 }
417
418 // The functionality that the CPU must implement to use the extension interface
419
420 cpu_open_handles = {}
421
422 __handleId = 0
423 def new_unused_handle_id()
424 __handleId = __handleId + 1
425 return __handleId
426
427 def ext_open(uuid, data):
428 interface = cpu_interface[uuid]
429 if interface == NIL:
430 raise Exception("No such interface")
431
432 handleId = new_unused_handle_id()
433 cpu_open_handles[handleId] = (interface, CurrentVirtualMemoryAddressSpace)
434
435 cookie = A_init(data) # Here device takes over
436
437 return (handle_id, cookie)
438
439 def ext_close(handle, data):
440 (handleId, cookie) = handle
441 intf_VMA = cpu_open_handles[handleId]
442 if intf_VMA == NIL:
443 return -1
444
445 (interface, VMA) = intf_VMA
446 if VMA != CurrentVirtualMemoryAddressSpace:
447 return -1
448 assert(interface != NIL)
449 shutdown = interface["shutdown"]
450 if shutdown != NIL:
451
452 err = interface.shutdown(cookie, data) # Here device takes over
453
454 if err != 0:
455 return err
456 cpu_open_handles[handleId] = NIL
457 return 0
458
459 def ext_ctl0(handle, data):
460 (handleId, cookie) = handle
461 intf_VMA = cpu_open_handles[handleId]
462 if intf_VMA == NIL:
463 raise Exception("No such interface")
464
465 (interface, VMA) = intf_VMA
466 if VMA != CurrentVirtualMemoryAddressSpace:
467 raise Exception("No such interface") #Disclosing that the interface exists in different address is security hole
468
469 assert(interface != NIL)
470 ctl0 = interface["ctl0"]
471 if ctl0 == NIL:
472 raise Exception("No such Instruction")
473
474 return ctl0(cookie, data) # Here device takes over
475
476
477 The other ext_ctl's are similar.
478
479 ==End RB==
480
481
482
483
484 The proposal is functionally near-identical to that of the mvendor/march-id
485 except extended down to individual opcodes. As such it could hypothetically
486 be proposed as an independent Standard Extension in its own right that extends
487 the Custom Opcode space *or* fits into the brownfield spaces within the
488 existing ISA opcode space *or* is used as the basis of an independent
489 Custom Extension in its own right.
490
491 ==RB==
492 I really think it should be in browncode
493 ==RB==
494
495 One of the reasons for seeking an extension of the Custom opcode space is
496 that the Custom opcode space is severely limited: only 2 opcodes are free
497 within the 32-bit space, and only four total remain in the 48 and 64-bit
498 space.
499
500 Despite the proposal (which is still undergoing clarification)
501 being worthwhile in its own right, and standing on its own merits and
502 thus definitely worthwhile pursuing, it is non-trivial and much more
503 invasive than the mvendor/march-id WARL concept.
504
505
506
507 # Comments, Discussion and analysis
508
509 TBD: placeholder as of 26apr2018
510
511 # Summary and Conclusion
512
513 In the early sections (those in the category "no action") it was established
514 in each case that the problem is not solved. Avoidance of responsibility,
515 or conflation of "not our problem" with "no problem" does not make "problem"
516 go away. Even "making it the Fabless Semiconductor's design problem" resulted
517 in a chip being *more costly to engineer as hardware **and** more costly
518 from a software-support perspective to maintain*... without actually
519 fixing the problem.
520
521 The first idea considered which could fix the problem was to just use
522 the pre-existing MISA CSR, however this was determined not to have
523 the right coverage (Standard Extensions only), and also crucially it
524 destroyed state. Whilst unworkable it did lead to the first "workable"
525 solution, "MISA-like".
526
527 The "MISA-like" proposal, whilst meeting most of the requirements, led to
528 a better idea: "mvendor/march-id WARL", which, in combination with an offshoot
529 idea related to gcc and binutils, is the only proposal that fully meets the
530 requirements.
531
532 The "ioctl-like" idea *also* solves the problem, but, unlike the WARL idea
533 does not meet the full requirements to be "non-invasive" and "backwards
534 compatible" with pre-existing (pre-Standards-finalised) implementations.
535 It does however stand on its own merit as a way to extend the extremely
536 small Custom Extension opcode space, even if it itself implemented *as*
537 a Custom Extension into which *other* Custom Extensions are subsequently
538 shoe-horned. This approach has the advantage that it requires no "approval"
539 from the RISC-V Foundation... but without the RISC-V Standard "approval"
540 guaranteeing no binary-encoding conflicts, still does not actually solve the
541 problem (if deployed as a Custom Extension for extending Custom Extensions).
542
543 Overall the mvendor/march-id WARL idea meets the three requirements,
544 and is the only idea that meets the three requirements:
545
546 * **Any proposal must be a minimal change with minimal (or zero) impact**
547 (met through being purely a single backwards-compatible change to the
548 wording of the specification: mvendor/march-id changes from read-only
549 to WARL)
550 * **Any proposal should place no restriction on existing or future
551 ISA encoding space**
552 (met because it is just a change to one pre-existing CSR, as opposed
553 to requiring additional CSRs or requiring extra opcodes or changes
554 to existing opcodes)
555 * **Any proposal should take into account that there are existing implementors
556 of the (yet to be finalised but still "partly frozen") Standard who may
557 resist, for financial investment reasons, efforts to make any change
558 (at all) that could cost them immediate short-term profits.**
559 (met because existing implementations, with the exception of those
560 that have Custom Extensions, come under the "vendor/arch-id read only
561 is a formal declaration of an implementation having no Custom Extensions"
562 fall-back category)
563
564 So to summarise:
565
566 * The consequences of not tackling this are severe: the RISC-V Foundation
567 cannot take a back seat. If it does, clear historical precedent shows
568 100% what the outcome will be (1).
569 * Making the mvendorid and marchid CSRs WARL solves the problem in a
570 minimal to zero-disruptive backwards-compatible fashion that provides
571 indefinite transparent *forwards*-compatibility.
572 * The retro-fitting cost onto existing implementations (even though the
573 specification has not been finalised) is zero to negligeable
574 (only changes to words in the specification required at this time:
575 no vendor need discard existing designs, either being designed,
576 taped out, or actually in production).
577 * The benefits are clear (pain-free transition path for vendors to safely
578 upgrade over time; no fights over Custom opcode space; no hassle for
579 software toolchain; no hassle for GNU/Linux Distros)
580 * The implementation details are clear (and problem-free except for
581 vendors who insist on deploying dozens of conflicting Custom Extensions:
582 an extreme unlikely outlier).
583 * Compliance Testing is straightforward and allows vendors to seek and
584 obtain *multiple* Compliance Certificates with past, present and future
585 variants of the RISC-V Standard (in the exact same processor,
586 simultaneously), in order to support end-customer legacy scenarios and
587 provide the same with a way to avoid "impossible-to-make" decisions that
588 throw out ultra-costly multi-decade-investment in proprietary legacy
589 software at the same as the (legacy) hardware.
590
591 -------
592
593 # Conversation Exerpts
594
595 The following conversation exerpts are taken from the ISA-dev discussion
596
597 ## (1) Albert Calahan on SPE / Altiven conflict in POWERPC
598
599 > Yes. Well, it should be blocked via legal means. Incompatibility is
600 > a disaster for an architecture.
601 >
602 > The viability of PowerPC was badly damaged when SPE was
603 > introduced. This was a vector instruction set that was incompatible
604 > with the AltiVec instruction set. Software vendors had to choose,
605 > and typically the choice was "neither". Nobody wants to put in the
606 > effort when there is uncertainty and a market fragmented into
607 > small bits.
608 >
609 > Note how Intel did not screw up. When SSE was added, MMX remained.
610 > Software vendors could trust that instructions would be supported.
611 > Both MMX and SSE remain today, in all shipping processors. With very
612 > few exceptions, Intel does not ship chips with missing functionality.
613 > There is a unified software ecosystem.
614 >
615 > This goes beyond the instruction set. MMU functionality also matters.
616 > You can add stuff, but then it must be implemented in every future CPU.
617 > You can not take stuff away without harming the architecture.
618
619 ## (2) Luke Kenneth Casson Leighton on Standards backwards-compatibility
620
621 > For the case where "legacy" variants of the RISC-V Standard are
622 > backwards-forwards-compatibly supported over a 10-20 year period in
623 > Industrial and Military/Goverment-procurement scenarios (so that the
624 > impossible-to-achieve pressure is off to get the spec ABSOLUTELY
625 > correct, RIGHT now), nobody would expect a seriously heavy-duty amount
626 > of instruction-by-instruction switching: it'd be used pretty much once
627 > and only once at boot-up (or once in a Hypervisor Virtual Machine
628 > client) and that's it.
629
630 ## (3) Allen Baum on Standards Compliance
631
632 > Putting my compliance chair hat on: One point that was made quite
633 > clear to me is that compliance will only test that an implementation
634 > correctly implements the portions of the spec that are mandatory, and
635 > the portions of the spec that are optional and the implementor claims
636 > it is implementing. It will test nothing in the custom extension space,
637 > and doesn't monitor or care what is in that space.
638
639 # References
640
641 * <https://groups.google.com/a/groups.riscv.org/forum/#!topic/isa-dev/7bbwSIW5aqM>
642 * <https://groups.google.com/a/groups.riscv.org/forum/#!topic/isa-dev/InzQ1wr_3Ak%5B1-25%5D>