Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration of Scalar into the Unpriv spec has began. #384

Open
wmat opened this issue Feb 15, 2024 · 19 comments
Open

Integration of Scalar into the Unpriv spec has began. #384

wmat opened this issue Feb 15, 2024 · 19 comments

Comments

@wmat
Copy link
Contributor

wmat commented Feb 15, 2024

Note that I have began integrating the Scalar spec into the Unprivileged spec. I'll update this issue with a Pull Request reference against riscv-isa-manual when I have one.

@nibrunieAtSi5
Copy link
Contributor

nibrunieAtSi5 commented Feb 15, 2024

Thank you @wmat.

@ben-marshall / @mjosaarinen for your information.

@mjosaarinen
Copy link
Collaborator

Thanks, added a note in README.md as discussed in the TG meeting. ef1eeb9

@ben-marshall
Copy link
Member

Great to hear @wmat 👍

@ThinkOpenly
Copy link

Process question: given there are human-readable documentation and Sail descriptions for both scalar and vector, is there a specified order as to how things get integrated into the canonical repositories? Does vector depend on scalar? Does the documentation have to be updated before the Sail descriptions are added, or are they done simultaneously?

(My real question is when to expect the Sail specifications to be updated, but want to learn the process as well. Thanks!)

@wmat
Copy link
Contributor Author

wmat commented Mar 6, 2024

Let me try to answer as I understand the current specifications. As I understand it, scalar & vector are separate specifications and do not necessarily reoly on each other. Any SAIL code in either spec would be self contained and have been manually added. At present SAIL descriptions would need to be manually updated in the applicable scalar crypto or vector crypto chapter if they change in the SAIL model.

@latifbhatti
Copy link

I hope this message finds you well. I wanted to provide some insight into the use of Sail pseudo code rather than actual Sail code in the RISC-V Vector Cryptography Extension specification.

As stated in the Vector Crypto spec, the original intention was to include actual Sail code in the specification. However, due to the absence of an approved RISC-V Vector Sail Model at the time of completing the Vector Cryptography extension specification, there was no basis on which to build the required Vector Sail model. (section of riscv vector crypto spec 1.0 (1.2. Sail Specifications)). its mean riscv vector extension is important to implement vector crypto spec 1.0 extension.

only zvkt extension of vector crypto extension depended on scalar crypto extension.
reference: (Chapter 2. Extensions Overview (riscv vector crypto(1.0))) "It is important to note that the Vector Crypto instructions are independent of the implementation of the Zkt( (including Zvbb, Zvkb, and Zvbc) extension and do not require that Zkt is implemented" and detail discussion in 2.15. Zvkt - Vector Data-Independent Execution Latency section.

I share this information based on my understanding. If you have any concerns or questions about this information, please feel free to discuss them with me. I appreciate your attention to this matter. If you have additional information to share, I would be grateful for your input.

Thank you for the conversation.

@ThinkOpenly
Copy link

[...] scalar & vector are separate specifications and do not necessarily reoly on each other. Any SAIL code in either spec would be self contained and have been manually added. At present SAIL descriptions would need to be manually updated in the applicable scalar crypto or vector crypto chapter if they change in the SAIL model.

I intended to distinguish between the human-readable ISA spec, and the Sail reference itself (https://github.com/riscv/sail-riscv). It sounds like you are referring just to the ISA spec, am I correct?

When should one expect the Sail code here to be integrated into that RISC-V Sail reference repository?

@wmat
Copy link
Contributor Author

wmat commented Mar 8, 2024 via email

@wmat
Copy link
Contributor Author

wmat commented Mar 12, 2024

Quick question, where Bitmanip instructions are included in the Scalar Crypto spec, should they be included when integrated as a chapter? The reason I ask is that the Bitmanip spec will be a chapter of it's own shortly and this will create duplication I think.

@wmat
Copy link
Contributor Author

wmat commented Mar 13, 2024

Quick question, where Bitmanip instructions are included in the Scalar Crypto spec, should they be included when integrated as a chapter? The reason I ask is that the Bitmanip spec will be a chapter of it's own shortly and this will create duplication I think.

NVM, there's no duplication. I see that the Bitmanip content is referenced directly from the Bitmanip repository. This will need to be updated to reference the Bitmanip chapter once it's integrated.

@wmat
Copy link
Contributor Author

wmat commented Mar 14, 2024

I'm ready to merge the scalar-crypto chapter but I'd like to get someone to briefly skim it to make sure nothing jumps out as wrong or incomplete. Note that the content hasn't changed at all, I've simply refactored the asciidoc to fit into the higher level Unprivileged manual.

You can grab the PDF here: https://github.com/riscv/riscv-isa-manual/actions/runs/8268811976/artifacts/1323222855

If that PDF has already been deleted, let me know and I'll generate another for you. I'd appreciate a LGTM response here before I merge it.

Thanks

@wmat
Copy link
Contributor Author

wmat commented Mar 15, 2024

Note that I'll be merging scalar-crypto on Wednesday, March 20th.

@wmat
Copy link
Contributor Author

wmat commented Mar 28, 2024

Scalar crypto is now integrated into the Unprivileged spec. Note that I'll begin asking for Issue closure or transfer to the riscv-isa-manual repo when an issue is still valid. Following that, this repository will be archived.

@ThinkOpenly
Copy link

@wmat where would one expect to find the Sail implementation for this?

@wmat
Copy link
Contributor Author

wmat commented Mar 28, 2024

@ThinkOpenly I asked Bill McSpadden and he say in the SAIL repo, the files of interest are:
riscv_types_kext.sail
riscv_insts_z*.sail

@ThinkOpenly
Copy link

@ThinkOpenly I asked Bill McSpadden and he say in the [SAIL repo]

Thank you for that information!

However, I should've been more specific. I'm looking for the Sail implementation of Zvkned, for example.

(If I am asking in the wrong context, perhaps you could redirect me.)

@wmat
Copy link
Contributor Author

wmat commented Mar 28, 2024

There would appear to be an open PR for that implementation.

@Findecanor
Copy link

Findecanor commented Sep 6, 2024

The descriptions for the "zip" and "unzip" instructions have been swapped in the released Unpriv spec, compared to the latest released Crypto-Scalar spec.

The instruction encodings are also different.

(Credit for finding this goes to PColim on Reddit)

@wmat
Copy link
Contributor Author

wmat commented Sep 6, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants