https://bugs.kde.org/show_bug.cgi?id=369509

--- Comment #6 from Julian Seward <jsew...@acm.org> ---
> > My only big concern here is the lack of hwcaps support in Vex/Valgrind.
> > That could be done in a followup bug, but it needs to happen fairly
> > soon.
>
> Sorry, I'm not clear about this. Do you mean we need to add new IR
> primitives to Valgrind to support new hardware capabilities or to be
> able to detect the current hardware capabilities in order to determine
> if the subject binary can be executed? If it's the latter I've posted
> a patch for detecting AArch64 hardware capabilities to
> https://bugs.kde.org/show_bug.cgi?id=413547

The 413547 patch does the hw capabilities detection needed to decide which
regtests to run, and it looks like you've successfully added the relevant bits
for AArch64.  But it doesn't do those tests for Valgrind itself, hence V has
no way to know whether the host has (eg) 8.1 support and so whether
guest_arm64_toIR.c should decode 8.1 instructions.  So far you've gotten away
with "down translating" 8.1 on the guest side to 8.0 on the host side.  But
that's not a long-term solution.

What needs to happen is:

* add VEX_HWCAPS_ARM64_whatever constants (see existing definitions)

* add code in VG_(machine_get_hwcaps) to query the host's capabilities.

The relevant capabilities description is eventually passed to disInstr_ARM64,
which can use it to choose whether to decode or not decode an instruction.

For the definitions of VEX_HWCAPS_ARM64_* that you want, I suggest looking at
VEX_HWCAPS_AMD64_* as examples.  But for actually detecting capabilities in
VG_(machine_get_hwcaps), I suggest you use the signal-longjmp scheme that is
used by the existing arm32 code.

Given that your tests/arm64_features.c lists 40+ capability subsets for 8.1, I
suggest you only add VEX_HWCAPS_ARM64_* for the ones you want to implement.
Also, it might be worth considering whether it's possible to merge some of
those classes -- maybe some of the features are implemented in groups?

All of this should be done in a new patch.  This patch (v8.1-a LSE
instructions) looks ready to go.

Finally .. I'm unclear what the top level set of capabilities you're aiming to
implement, is.  Could you please open a meta-bug which simply links to all the
other bugs involved?  So as to have a single "starting point".

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to