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