Skip to content

Commit d70175b

Browse files
jgoulywilldeacon
authored andcommitted
selftests/arm64: add HWCAP2_HBC test
Add a test for the newly added HWCAP2_HBC. Signed-off-by: Joey Gouly <joey.gouly@arm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/20230804143746.3900803-3-joey.gouly@arm.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent 7f86d12 commit d70175b

File tree

1 file changed

+15
-0
lines changed
  • tools/testing/selftests/arm64/abi

1 file changed

+15
-0
lines changed

tools/testing/selftests/arm64/abi/hwcap.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,13 @@ static void svebf16_sigill(void)
208208
asm volatile(".inst 0x658aa000" : : : "z0");
209209
}
210210

211+
static void hbc_sigill(void)
212+
{
213+
/* BC.EQ +4 */
214+
asm volatile("cmp xzr, xzr\n"
215+
".inst 0x54000030" : : : "cc");
216+
}
217+
211218
static const struct hwcap_data {
212219
const char *name;
213220
unsigned long at_hwcap;
@@ -386,6 +393,14 @@ static const struct hwcap_data {
386393
.hwcap_bit = HWCAP2_SVE_EBF16,
387394
.cpuinfo = "sveebf16",
388395
},
396+
{
397+
.name = "HBC",
398+
.at_hwcap = AT_HWCAP2,
399+
.hwcap_bit = HWCAP2_HBC,
400+
.cpuinfo = "hbc",
401+
.sigill_fn = hbc_sigill,
402+
.sigill_reliable = true,
403+
},
389404
};
390405

391406
static bool seen_sigill;

0 commit comments

Comments
 (0)