--
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+un...@groups.riscv.org.
To post to this group, send email to hw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/hw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/mhng-99966160-5466-4cfc-b3d8-48ad48d3dc74%40palmer-si-x1c4.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/mhng-99966160-5466-4cfc-b3d8-48ad48d3dc74%40palmer-si-x1c4.
However at
Cambridge and ETHZ we recently observed a problem with the PLIC claim
mechanism if the idempotency PMA is not implemented. Since I assume the
latter is an optional and perhaps rather complicated feature,
--
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+un...@groups.riscv.org.
To post to this group, send email to hw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/hw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/e93dee44-11ac-860f-47bd-204b2b4b7479%40cam.ac.uk.
However at
Cambridge and ETHZ we recently observed a problem with the PLIC claim
mechanism if the idempotency PMA is not implemented. Since I assume the
latter is an optional and perhaps rather complicated feature,The idempotency check can be very simple; and holding loads till commit (or till the relaxed cache is ordered) is only slightly annoying. Unless I'm misunderstanding the issue, I would think a Unix-platform processor would be required to understand the difference between device IO and cacheable regions, no? If not, the PLIC would not be the only problematic device in the system.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/CAJ9VFiFiZCO6Jjg5qW2WRUd4EUjz9kJm2XxEyXrRFdOO2O9C1w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/CA%2B%2B6G0DY0Rim9MYA5Cja3N_ptU8NXMbu3%2B6_fuka7Kmb1cuM0w%40mail.gmail.com.
In a multi-hart system, using a single read ensures that the reading hart atomically claims the next pending interrupt ID without risking a race with other harts.
This is a common pattern for memory-mapped I/O devices - for
example, consider FIFO registers.
- Paul
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/CAKoatx20eE%2BDf0HzbuUcWa%3DU0v8uCL-Tpx8FRGSY9E4vQdVbGA%40mail.gmail.com.
Seems like we have established that microarchitecture can handle this. But I did not understand the argument for architecting a system deliberately where reads have side effects?
However at
Cambridge and ETHZ we recently observed a problem with the PLIC claim
mechanism if the idempotency PMA is not implemented. Since I assume the
latter is an optional and perhaps rather complicated feature,The idempotency check can be very simple; and holding loads till commit (or till the relaxed cache is ordered) is only slightly annoying. Unless I'm misunderstanding the issue, I would think a Unix-platform processor would be required to understand the difference between device IO and cacheable regions, no? If not, the PLIC would not be the only problematic device in the system.-Chris
On Fri, Apr 5, 2019 at 8:16 AM Dr Jonathan Kimmitt <jr...@cam.ac.uk> wrote:
Dear Palmer,
I appreciate your pragmatic decision to adopt the specification of the
SiFive PLIC as a working model of how things should be done. However at
Cambridge and ETHZ we recently observed a problem with the PLIC claim
mechanism if the idempotency PMA is not implemented. Since I assume the
latter is an optional and perhaps rather complicated feature, we were
wondering whether it would be possible to support an optional
specification to the PLIC to use a write operation to claim an interrupt
instead of a read. The bug arises because, to maximise performance,
speculative load instructions are initiated at the beginning of the
pipeline, this will have the effect of claiming the interrupt whether or
not that instruction reaches the commit stage. As you know in Linux this
claim routine happens with interrupts off but there is always the
possibility of a machine mode interrupt or other event causing a
pipeline flush. Another option would be to force the PLIC to support
atomic reads. I appreciate backward compatibility is an issue and there
could be sound architectural reasons why your group chose to do it this way..
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/CAJ9VFiFiZCO6Jjg5qW2WRUd4EUjz9kJm2XxEyXrRFdOO2O9C1w%40mail.gmail.com..
Definitely, but it missing a character from a UART and causing a hang-up on a System are two different things in user experience (although both are wrong) ;-)The differentiation between NC and memory Region can be efficiently handled in the cache, while waiting for a load to be (and remain non-speculative) is, imho, another story. So I need to drain the remaining pipeline and mask-off all interrupt sources before I can commit the load..
the "opportunity for throwing exceptions" in particular hold a write hazard (dependency) preventing and prohibiting all "sequentially identified as future" instructions from committing (doing any kind of irreversible write-damaging operation), until such time as the condition where the exception *could* occur is known (absolutely, guaranteed) *not* to occur... the exception-write-hazard is then dropped, and two things happen:
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/CADZArczNm8bc6Bftuntd%2BE19O1MQ8aZ%3DztYTDS9S_BTHM1PSHw%40mail.gmail.com.
could be sound architectural reasons why your group chose to do it this way...
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/CAJ9VFiFiZCO6Jjg5qW2WRUd4EUjz9kJm2XxEyXrRFdOO2O9C1w%40mail.gmail.com...
----Florian ZarubaPhD Student
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+un...@groups.riscv.org.
To post to this group, send email to hw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/hw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/CADZArczNm8bc6Bftuntd%2BE19O1MQ8aZ%3DztYTDS9S_BTHM1PSHw%40mail.gmail..com.
--Samuel A. Falvo II
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/CADZArcxtjzXdHz88_pOBMR21E4iP8Eh2qW7qAiXQJW_naaHp3g%40mail.gmail.com.
could be sound architectural reasons why your group chose to do it this way....
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/CAJ9VFiFiZCO6Jjg5qW2WRUd4EUjz9kJm2XxEyXrRFdOO2O9C1w%40mail.gmail.com....
----Florian ZarubaPhD Student
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+un...@groups.riscv.org.
To post to this group, send email to hw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/hw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/CADZArczNm8bc6Bftuntd%2BE19O1MQ8aZ%3DztYTDS9S_BTHM1PSHw%40mail.gmail...com.
--Samuel A. Falvo II
----Florian ZarubaPhD Student
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+un...@groups.riscv.org.
To post to this group, send email to hw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/hw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/CADZArcxtjzXdHz88_pOBMR21E4iP8Eh2qW7qAiXQJW_naaHp3g%40mail.gmail.com..
--Apologies for all typos. Message sent by combination of an approximate neural network and a smartphone.
On Sat, Apr 6, 2019 at 4:59 PM Florian Zaruba <zar...@iis.ee.ethz.ch> wrote:
>
> in your response, you are implying that I have a way to simply not do loads speculatively,
> which I don't (otherwise it would, of course, be easy).
i'm not: i'm saying that the method that is needed is identical to
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/CAJ9VFiGgCDd6XWU2Lm_MkRcoPfRiOSz6btZ0vChg7DvDLfmmyQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/23722.33906.576602.874520%40KAMacBookPro2016.hsd1.ca.comcast.net.
The problem with such a recommendation is that it would imply that there is something race-prone or incorrect about reads from MMIO device registers with read side-effects.
- Paul
If it’s not possible to implement any small improvements due to incompatibility with existing silicon we should at least document potential race hazards and recommend that non-idempotent interfaces use atomic transactions in future releases. This will help to get the message across to potential implementors. Sent from my iPhone
On 8 Apr 2019, at 00:14, kr...@berkeley.edu
wrote: While one of the goals of the RISC-V project has always been to encourage experimentation, there is also a great desire for standardization to allow reuse of software effort. Oftentimes, a software-friendly portable standard will require hardware implementers to do more than the bare minimum needed for certain core styles in restricted use cases. Originally, we left the interrupt controller unspecified in theg privileged spec as different systems have different needs, but there was considerable demand for a standard interrupt controller for Linux to save software effort. The Linux source code is modular enough to support many different styles of interrupt controller, but supporting multiple different Linux binary distributions is a non-trivial effort, and we did not want to repeat the mistakes of earlier ISAs in this regard. So, we developed the PLIC spec as a simple standard centralized interrupt controller for SMP Unix-like systems. Our constraints on initial PLIC design were that it be purely memory-mapped, instead of having some special connection to the core pipeline logic beyond the external asynchronous interrupt input, and that it not require the A extension (although Linux now does require A exists). Of course there are many possible improvements to make to the PLIC spec, but first we want to standardize the existing PLIC v1 before working on a PLIC v2. Small improvements to the PLIC are not worth any resulting incompatibilities. Goals of a PLIC v2 are a large jump in functionality including, e.g., handling virtualization well, but that will require experience with implementations of hypervisors. Krste
The “we” in “want to support” is not you or I, but the people supporting Unix distributions and writing compliance suites. They would have to agree to do the work to support all three options in the PLIC v1 and make available in standard distributions.
I’d rather spend my “annoy Unix maintainers” credit on working on a better PLIC v2.
Krste
> M
>
--
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+un...@groups.riscv.org.
To post to this group, send email to hw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/hw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/CAKoatx3P37hBvyrfjSK_XqbFs40jKUByWwfrmrPn8LuY6p-EhA%40mail.gmail.com.
On Apr 8, 2019, at 9:17 PM, Prof. Michael Taylor <prof....@gmail.com> wrote:The “we” in “want to support” is not you or I, but the people supporting Unix distributions and writing compliance suites. They would have to agree to do the work to support all three options in the PLIC v1 and make available in standard distributions.
I’d rather spend my “annoy Unix maintainers” credit on working on a better PLIC v2.
Krste
Just curious, will this “let’s not annoy the software people” argument be made everytime SiFive has developed something and hacked in preliminary support in the Linux kernel?
Aren’t we talking about basically one or two lines of code in this file?
I am sure that the changes to Florian’s design (and all others who travel down this path and then realize too late) will be much greater.
--> M
>
Apologies for all typos. Message sent by combination of an approximate neural network and a smartphone.
--
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+un...@groups.riscv.org.
To post to this group, send email to hw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/hw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/CAKoatx3P37hBvyrfjSK_XqbFs40jKUByWwfrmrPn8LuY6p-EhA%40mail.gmail.com.
On Apr 8, 2019, at 10:57 PM, Dr Jonathan Kimmitt <jr...@cam.ac.uk> wrote:See inline comments.
Sent from my iPhoneOn 9 Apr 2019, at 04:52, Krste Asanovic <kr...@berkeley.edu> wrote:
I’d agree overhead of issuing two memory operations instead of one for Linux on single-socket SoCs is not that bad overhead, but enough people complain already about the PLIC overheads.
(That assumes you have a strongly ordered PMA on that region, otherwise you’ll see two full I/O bus round trip latencies due to a FENCE in the middle -
I have looked at a disassembly of the PLIC support code in stock RISCV Linux, and lo and behold there is a “fence i, r” right after the interrupt claim. This can be used in a micro architecture specific way to confirm to other harts and the PLIC that a critical synchronisation point has been reached. Unfortunately that instruction does not mention the I/O address that is being fenced.
Perhaps that could be a future enhancement to the RISCV user specification, if it’s not frozen already. I’m not personally a fan of non idempotent I/O but it’s a bit late to complain now.
The true key to better interrupt performance in PLICv2 is vectored interrupt control and multiple register banks, not tinkering with a few loads here and there.
--
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+un...@groups.riscv.org.
To post to this group, send email to hw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/hw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/DEE2ECC5-3B38-48BB-A428-1EB92C6F9023%40berkeley.edu.
There are not many examples of Linux capable RISCV silicon out there. Until there are, it makes sense to use the HiFive-unleashed as a reference. Also there are many software bugs that only show up on multicore. Other FPGA emulation platforms such as the OpenPiton (http://parallel.princeton.edu/openpiton/) support RISCV but not sufficiently maturely to be tape-out ready (yet).
The goal of a single Linux image is a laudable one, but it does
mean loads of drivers being compiled in that may not be loaded. So
this is not a block on incompatible interrupt controllers as such.
Nor do we expect every peripheral and every micro-architecture to
be open-source. And of course it would not mean that a particular
device driver patch is correct, if that peripheral is not present
on the HiFive.
On Apr 8, 2019, at 9:17 PM, Prof. Michael Taylor <prof....@gmail.com> wrote:The “we” in “want to support” is not you or I, but the people supporting Unix distributions and writing compliance suites. They would have to agree to do the work to support all three options in the PLIC v1 and make available in standard distributions.
I’d rather spend my “annoy Unix maintainers” credit on working on a better PLIC v2.
Krste
Just curious, will this “let’s not annoy the software people” argument be made everytime SiFive has developed something and hacked in preliminary support in the Linux kernel?“Donning SiFive hat”: SiFive donated the PLIC design to fill a vacuum in Unix land. In other areas, SiFive has donated an initial version of a spec that was then changed in Foundation Task Group after SiFive put early version into silicon (debug, CLIC). We didn’t force our implementation down people’s throats, but donated the substantial initial effort and then changed our existing in-silicon designs based on community feedback to support others' use cases.
“Donning Foundation hat”: For this particular case of the PLIC interface, first note that for a commercial Unix SoC project, you generally
can’t sell a commercial core or use a free core, that speculatively executes all MMIO accesses.
So, there’s incentive to retain the current PLIC interface as it is faster and supported by cores you would use in a Unix platform. Asking the community to support an optional second slower idempotent PLIC interface for other cores does not seem like a good use of Foundation resources right now.Aren’t we talking about basically one or two lines of code in this file?Of course, any group can port Linux to their variants. As you well know, it’s not how many lines are changed to support a variant, it’s the multiplicative effect of how many simultaneous variants there are to support.(It’d be easy to highlight the single bit change needed to accommodate an alternate encoding of an ADD instruction, for example.The support ramifications would be massive, despite the tiny difference of the alternate encoding.)
I am sure that the changes to Florian’s design (and all others who travel down this path and then realize too late) will be much greater.The PLIC spec has been out for years, and has been implemented by several developers outside of SiFive.Most commercial SoCs have to deal with devices that have side-effects on reads.This should not be a surprise to anyone building a core intended to be widely used.
Again, there is a plan to develop a PLIC v2 which is a more substantial upgrade over current PLIC. This could try to avoid non-idempotent accesses for example, but I can guess there will be significant push back if that implies lower performance. While Unix is less concerned with low-level interrupt handler overheads, AMP systems can mix Unix on some
cores and RTOS on others, and PLIC interrupt latency will be more exposed.
Krste--> M
>
Apologies for all typos. Message sent by combination of an approximate neural network and a smartphone.--
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+un...@groups.riscv.org.
To post to this group, send email to hw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/hw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/CAKoatx3P37hBvyrfjSK_XqbFs40jKUByWwfrmrPn8LuY6p-EhA%40mail.gmail.com.
The problem is not just PLIC.PCIe device config can indicate non-prefetchable BAR, which means the BAR has read side effects:
I don’t think anybody will waste their time trying to give feedback on v2 after reading this thread.
--I don’t really care about the PLIC, our designs will work either way, but the process seems pretty broken.The takeaway I got from this is that two of the long-time major open source stake holders in RISC-V, ETHZ and Cambridge, raised a concern and the response was super dismissive.Krste--> M
>
Apologies for all typos. Message sent by combination of an approximate neural network and a smartphone.--
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+un...@groups.riscv.org.
To post to this group, send email to hw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/hw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/CAKoatx3P37hBvyrfjSK_XqbFs40jKUByWwfrmrPn8LuY6p-EhA%40mail.gmail.com.
Apologies for all typos. Message sent by combination of an approximate neural network and a smartphone.
I don’t think anybody will waste their time trying to give feedback on v2 after reading this thread.
I don’t really care about the PLIC, our designs will work either way, but the process seems pretty broken.
There's probably a miscommunication or a misunderstanding about
what the "UNIX-class Platform Specification" proposal is, and
isn't, intended to be. This is perhaps an artifact of this list
being oriented towards hardware designers and engineers, rather
than software developers.
It doesn't help that the name of the proposed specification is
confusing. Despite being called "UNIX-class", there is nothing
preventing anyone from porting, running, and distributing the
Linux kernel, or any other operating system, to systems that don't
align with what ends up in the "UNIX-class Platform Specification"
(beyond the license terms of the software itself, of course).
This is almost always the right approach for new devices. Every
ARM Linux-based smartphone SoC vendor - Samsung, Qualcomm, TI,
many others - has taken this approach, maintaining their own
"forks" of open-source software and providing that to their users.
Similarly, there is nothing preventing anyone from sending code changes for their specialized hardware to the open-source projects to ask that their changes be included in "mainline" project code. Of course, the maintainers may reject those changes, or require changes to be made to the proposed code, or may take a long time to include the changes. That's simply the nature of the process. Maintainer responsibilities include ensuring a codebase can be easily developed going forward, and that it doesn't spiral out of control due to complexity.
For example, suppose someone creates a hardware device that breaks key assumptions in decades of microprocessor or SoC design practice, that requires code changes all over an operating system to function. Open source maintainers may be reluctant to merge code changes for that device. That reluctance still wouldn't block that operating system from running on the device, since whoever creates those devices can just distribute their own "board support package", until the rest of the world comes around to appreciating what they've done. This is what all the major SoC providers do today. Linux-class hardware designs don't exist in a vacuum. Those hardware designs rely on software to run on them to be useful, and the process is a way of focusing maintainers' limited resources on the parts of the codebase that need those resources the most.
Similarly, just as open-source software developers have limited
resources, so too do the major operating system distribution
maintainers, like Red Hat, the Debian Project, Canonical (Ubuntu),
Microsoft, etc. Even for the ARM architecture - a
change-restricted, proprietary architecture, backed by billions of
dollars of capital - it is only barely becoming practical to
download a single binary image that boots and runs on devices from
different ARM vendors. For ARM, many distribution providers don't
even try. That single bootable system image is much easier for
Intel devices, for many reasons. One major reason is that Intel
has enforced a consistent platform interface and specification
across their ecosystem, in cooperation with the OS distribution
providers. If OS distribution vendors target those
specifications, they can feel reasonably confident that their
software will boot and at least limp along on future systems. The
RISC-V community doesn't have the same options, since Intel
maintains iron-clad corporate control of their instruction set and
platform architecture. The RISC-V community has to take a more
collaborative, open approach.
Thus a more useful way to think of the RISC-V "UNIX-class" proposal might be as a "Major OS Distribution Platform Specification" proposal. One of the goals is to provide a document where OS distribution vendors, hardware vendors, and other interested members of the RISC-V community can come together to define what the boot and operating system interface should look like, and define expectations for hardware, firmware, and software binaries that should "just work" across different device vendors.
Will the "UNIX-class" platform specification restrict which
devices can run "UNIX" or Linux? No. Just as there are millions
of Linux-class ARM devices in the world that will never run Red
Hat Enterprise Linux for ARM, in devices like smartphones,
thermostats, smartwatches, and cellphone base stations; the same
will likely be true for RISC-V. However, there will be a subset
of hardware devices whose designers do target these traditional
desktop or server use-cases, and for them, the "UNIX-class
Platform Specification" will be important.
- Paul
--
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+un...@groups.riscv.org.
To post to this group, send email to hw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/hw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/41adef0b-d91b-75d5-8ec1-bbef68c40b1e%40cl.cam.ac.uk.