You are not logged in.

#1 2023-05-11 19:33:30

potuz
Member
Registered: 2009-10-23
Posts: 129

disable crypto extensions from qemu

This is not Arch specific but since I am running on Arch I figured I'd ask here. I have a binary that I cross compiled with `aarch64-linux-gnu-gcc` and can run with qemu in user mode with `qemu-aarch64 ./binary` . This binary uses crypto extensions and I am hoping that there's a way to disable the crypto extensions in the machine so that it sigills or similar, something like `qemu-aarch64 -cpu max,crypto=off ./binary`. Is there a way to do this?

Offline

#2 2023-05-12 10:23:58

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,256

Re: disable crypto extensions from qemu

The man page for qemu-system-aarch64 does mention crypto many times, but I doubt I understand what you want to achieve.

I have a binary that I cross compiled with

That suggests you have sourcecode for the binary .  Disable crypto extensions and enable support for "sigills" (whatever they are) at build time seems the simplest solution .

If I misunderstood you, please explain your goal in more detail .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2023-05-13 12:21:36

potuz
Member
Registered: 2009-10-23
Posts: 129

Re: disable crypto extensions from qemu

I want to test runtime cpu detection, so I need to compile with SHA instructions and check at runtime that the qemu emulator is actually detecting the cpu capabilities for it or not. The default `qemu-aarch64` in user mode does have these enabled and I see the code running those paths. But I couldn't figure out a way to disable the crypto extensions and run the same binary as if it would be run on a CPU that doesn't have crypto extensions, for example a RPI4, it should detect this at runtime and not run the SHA instructions that woudn't be supported. Hopefully this is clear.

EDIT: as in the original post it would also work, I want to run this same binary, with the SHA instructions, in a CPU like the RPI4 that doesn't support them, and the program should crash

Last edited by potuz (2023-05-13 12:23:24)

Offline

Board footer

Powered by FluxBB