BinaryAnalysisPlatform / qemu

Official QEMU mirror
Other
9 stars 12 forks source link

Add the read for the 0 register of the (RA|0) case from the ISA. #29

Closed Rot127 closed 1 year ago

XVilka commented 1 year ago

@Rot127 have you checked these changes against the mainstream QEMU?

XVilka commented 1 year ago

@wargio take a look please

Rot127 commented 1 year ago

@XVilka

have you checked these changes against the mainstream QEMU?

Well, QEMU checks if the rA variable is 0 and then does operations as if it was never there. The ISA though explicitly states, that 0 is used. LLVM implements this with a special 0 register and is therefore closer to the ISA. And with the update of Capstone to mimic LLVM more closely, tracing this was an addition. Instead of this PR we can ignore the reads of the 0 register in rz-tracetest (I think).

Should have pointed all this out in the PR description. @ivg Any comments?

Rot127 commented 1 year ago

i wonder if these patches should go to qemu upstream

I doubt that they see any use in this. Why doing an additional operation of adding 0 to something if you can also just skip it?

wargio commented 1 year ago

makes sense.