angr / vex

A patched version of VEX to work with PyVEX.
GNU General Public License v2.0
104 stars 44 forks source link

s390x: allow lifting of vector instructions #26

Closed mephi42 closed 4 years ago

mephi42 commented 5 years ago

guest_s390_toIR lifts vector instructions only if host supports them, which is never going to happen when using it on x86, so let's fool the check.

Additionally, in context of rebasing discussion, I thought it would make sense to make hacks like this stand out. So I wrapped it in PYVEX ifdef.

twizmwazin commented 5 years ago

@rhelmot Unless someone else takes it on, I'm probably not going to get around to the whole rebase thing for a while, at least until after CI stuff. In the interest of not blocking on something without a concrete timeline, do we want to merge this and #25?

rhelmot commented 5 years ago

Yes, we should merge these.

mephi42 commented 4 years ago

I've just realized that I accidentally undind 87028799cd56 ("s390x: handle EXRL when its target is in the same buffer") - the new code fixes this.

rhelmot commented 4 years ago

I think generally anything that happens in toir instead of isel that depends on the host configuration instead of the guest configuration should be considered a bug. Feel free to change that - I'm ok with this but would prefer the cleaner approach.

@twizmwazin, reminder that this is assigned to you.

mephi42 commented 4 years ago

Actually, in the meantime all the host endianness checks have been removed.

What remains are various feature checks (presence of decimal floating point, vectors, etc), but, well, that's how upstream developers wanted it to be. For now I added a workaround to pretend the host has some of these features (maybe I'll need to add more in the future? for binaries I'm looking at only two were necessary).

I will ask the maintainers what they think about moving feature checks to isel, but that might be a bit harder to get through than host endianness changes.

rhelmot commented 4 years ago

btw @mephi42, I noticed that one of the s390 tests in pyvex was failing: https://dev.azure.com/angr/pyvex/_build/results?buildId=1506&view=ms.vss-test-web.build-test-results-tab&runId=24146&resultId=100082&paneView=debug

mephi42 commented 4 years ago

Thanks for merging this!

You also need https://github.com/angr/pyvex/pull/186 - it fixes the test and adds a couple new ones,