| 6 | #include <unistd.h> /* close() */ |
| 7 | |
| 8 | int main(void) |
| 9 | { |
| 10 | int fd, ret; |
| 11 | |
| 12 | fd = open("/dev/kvm", O_RDWR); |
| 13 | if (fd < 0) { |
| 14 | perror("Failed to open /dev/kvm"); |
| 15 | return -errno; |
| 16 | } |
| 17 | |
| 18 | ret = ioctl(fd, KVM_CHECK_EXTENSION, KVM_CAP_ARM_EL1_32BIT); |
| 19 | if (ret < 0) { |
| 20 | perror("Error checking /dev/kvm for 32-bit EL1 support"); |
| 21 | ret = 0; |
| 22 | } |
| 23 | |
| 24 | close(fd); |
| 25 | |
| 26 | /* |
| 27 | * KVM_CHECK_EXTENSION returns 1 for supported, 0 for unsupported so |
| 28 | * invert it to match typical success/fail codes in programs. |
| 29 | */ |
| 30 | return !ret; |
| 31 | } |
nothing calls this directly
no outgoing calls
no test coverage detected