[PATCH v3 6/6] RISC-V: selftests: Add CBO tests

Andrew Jones ajones at ventanamicro.com
Mon Sep 18 03:41:06 PDT 2023


On Mon, Sep 04, 2023 at 07:02:27PM +0200, Andrew Jones wrote:
> Add hwprobe test for Zicboz and its block size. Also, when Zicboz is
> present, test that cbo.zero may be issued and works. Additionally
> test that the Zicbom instructions cause SIGILL and also that cbo.zero
> causes SIGILL when Zicboz is not present. Pinning the test to a subset
> of cpus with taskset will also restrict the hwprobe calls to that set.

Palmer pointed out that there's no guarantee to get illegal-instruction
exceptions when Zicbom/Zicboz are not present. Indeed, the unpriv spec
states

"""
 The behavior upon decoding a reserved instruction is UNSPECIFIED.

   Some platforms may require that opcodes reserved for standard use raise
   an illegal-instruction exception. Other platforms may permit reserved
   opcode space be used for non-conforming extensions.
"""

This implies that cannot do the illegal-instruction checks for when
hwprobe reports the extension isn't present. That's a pity, but I
guess I should rip it out. Or, maybe I'll keep it, but only run it
under a command line switch.

Thanks,
drew



More information about the linux-riscv mailing list