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

Qira patches to QEMU version 3.1.0 #1

Closed
wants to merge 7 commits into from
Closed

Conversation

Hamled
Copy link

@Hamled Hamled commented Mar 25, 2019

Summary

This updates Qira's QEMU patch to work with version 3.1.0.

Details

The first commit is my recreation of the original QEMU patch, done manually because of the extent of changes between version 2.5.1 and 3.1.0.

The remaining commits are minimal changes to enable QEMU to build successfully.

I've tested this (with related changes to Qira's build scripts) and had some success getting it to build both in the Docker container for Ubuntu 16.04 and on Arch Linux.

TODO

  • Create a v3.1.0-qira branch pointing at the same commit from v3.1.0 tag
  • Edit this PR to be merged against that branch instead of master

Notes

  • I am not very familiar with Qira yet, so I can't fully test the functionality. I'm not seeing any error messages in Qira's terminal output or Chrome's console when running docker/test.sh, and the automated tests all pass (but those also passed on un-patched 3.1.0 so I think they're not very comprehensive).

I attempted to be as literal as possible, but this was not actually
a cherry-pick. There were so many re-arranged files from v2.5.1 where
the patch was last applied, that the merge conflicts were just nonsense.

Additional fixes to get QEMU to build are in follow commits.
I'm really not sure about this one. I can't see how QEMU would build for
anyone without --disable-capstone, without this change.

Surely this must be a misconfiguration of my own system? However, the
Capstone documentation for their C API clearly shows to use
\#include <capstone/capstone.h>

here: http://www.capstone-engine.org/lang_c.html
Standard QEMU passes only the pointer to the start of the translation
block's instructions, however for Qira tracking we need more details
from the `TranslationBlock` structure.

This updates the `tcg_qemu_tb_exec` function to take a pointer to the
`TranslationBlock` to execute, to minimize the changes needed to
build with the Qira patch.

We should probably determine if it would be possible to move the Qira
tracking code into `cpu_tb_exec` instead, which would not require
modifying the signature of `tcg_qemu_tb_exec` (although it is only
called from that one location).
The `next_tb` variable was renamed to `ret` at some point.
@geohot
Copy link
Owner

geohot commented Mar 28, 2019

Will merge if you change to not push to master.

@Hamled
Copy link
Author

Hamled commented Mar 28, 2019

Which branch should it merge into? The qira branch is too out of date for this to merge correctly, I think.

@geohot
Copy link
Owner

geohot commented Mar 28, 2019

Can you merge into a new branch? The one referenced in the main qira PR.

@Hamled
Copy link
Author

Hamled commented Mar 28, 2019

I don't believe I have sufficient permissions on your fork to create a new branch for the PR to be merged into.

I think you'll need to do that part, and then I can update the PR (although I'd wager you also have access to modify the PR).

@geohot
Copy link
Owner

geohot commented Mar 29, 2019

Merged into v3.1.0-qira. Thanks!

@geohot geohot closed this Mar 29, 2019
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.

2 participants