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

Introduce InsnBuffer and other improvements #213

Merged
merged 3 commits into from
Jan 25, 2024

Conversation

p4zuu
Copy link
Collaborator

@p4zuu p4zuu commented Jan 11, 2024

  • Introduce InsnBuffer for similar Instructions fields.
  • Add unit tests for x86 instructions deocding
  • Add documentation for svsm::cpu::insn

@p4zuu p4zuu force-pushed the insn_buffer branch 2 times, most recently from 43ada50 to e2be477 Compare January 11, 2024 11:24
src/cpu/insn.rs Outdated Show resolved Hide resolved
@joergroedel
Copy link
Member

Hi Thomas,

In general this looks good to me.

What is you long-term plan with the decoder, do you plan to turn it into a full x86-64 instruction decoder at some point?

p4zuu added 3 commits January 24, 2024 15:06
The Instruction type uses u8 arrays of different sizes, let's declare
a new generic InsnBuffer making the Instruction fields handling
prettier.

Also declare a Index and IndexMut traits for InsnBuffer to make
indexing easier.

Signed-off-by: Thomas Leroy <[email protected]>
Since not all x86 instructions have prefixes, let's use
Instruction::prefixes as an Option, to which we assigne a Some()
only if a prefix is found while decoding.

Signed-off-by: Thomas Leroy <[email protected]>
Add a few lines of documentation for insn mod.

Signed-off-by: Thomas Leroy <[email protected]>
@p4zuu
Copy link
Collaborator Author

p4zuu commented Jan 24, 2024

Hi Thomas,

In general this looks good to me.

What is you long-term plan with the decoder, do you plan to turn it into a full x86-64 instruction decoder at some point?

We had in mind with Carlos that we could give this project to an intern or a working student.
Otherwise, if we very need a full decoder, I will work on it myself :)

@joergroedel
Copy link
Member

Alright, at some point we need a full decoder, but there is still some time.

@joergroedel joergroedel merged commit 33dc856 into coconut-svsm:main Jan 25, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants